几年来,我一直使用mbed在线编译器创建.bin文件,然后使用ST-LINK/V2USB加密狗在命令行中像这样刷新它们,一切都运行得无懈可击:
st-flash write 01_blink.NUCLEO_F103RB.bin 0x8000000今天,我下载了STM32CubeIDE for Linux (Fedora30),并开始使用maple mini (STM32F103CBT6)浏览本教程。
在构建项目并开始调试运行后,我得到了输出:
STMicroelectronics ST-LINK GDB server. Version 5.3.2
Copyright (c) 2019, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Waiting for debugger connection...
Debugger connected
-------------------------------------------------------------------
STM32CubeProgrammer v2.2.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_2ZxzGk.log
ST-LINK SN : 34006B063058373138650943
ST-LINK FW : V2J34S7
Voltage : 3.21V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x410
Device name : STM32F101/F102/F103 Medium-density
Flash size : 64 KBytes
Device type : MCU
Device CPU : Cortex-M3
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_Q2zZSF.srec
File : ST-LINK_GDB_server_Q2zZSF.srec
Size : 4648 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 4]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.595
Verifying ...
Download verified successfully
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Error! Failed to read target status
Debugger connection lost.
Shutting down...在那之后,我不能再启动调试会话,因为我得到了这样的结果:

我可以看到LED像预期的那样闪烁,所以我知道程序实际上是被闪烁到电路板上的。但是我不能对STM32CubeIDE做任何进一步的事情,当我像以前一样尝试通过命令行闪存时,现在也不能工作:
[root@localhost Downloads]# st-flash write 01_blink.NUCLEO_F103RB.bin 0x8000000
st-flash 1.5.1-38-gc3577b5
2020-03-24T13:51:09 INFO common.c: Loading device parameters....
2020-03-24T13:51:09 WARN common.c: Invalid flash type, please check device declaration
core status: unknown
Unknown memory region幸运的是,我可以通过使用ST-Link实用程序(在Windows上)并在连接之前按住reset按钮,然后执行完全擦除来返回起点,如下所述:
http://www.kerrywong.com/2012/08/02/the-dreaded-cannot-connect-to-st-link-error-message/
但很明显,这并不是完成任何有效开发的可行方案。我做错了什么?
在“Debug configurations”对话框的“Debugger”选项卡中,我尝试将“Interface”设置为SWD (实际上已经是SWD),并尝试了“Reset behaviour”的所有选项,但结果没有变化。
发布于 2020-03-24 17:00:52
为什么这种情况总是发生?我为一些事情挣扎了几个小时,然后又花了20分钟用截图等方式尽可能简洁和清晰地提出问题,然后在帖子两分钟后我找到了答案,通常是在另一个我在几个小时的搜索中从未见过的答案中。我想我问过的问题有一半是这样结束的。
问题似乎是,除非您声明要使用社署以及在哪些引脚上,否则默认情况下不会启用。因此,一旦新程序被刷新,SWD连接就会失效。我猜mbed程序在默认情况下保留了标准引脚上的SWD的使用,所以这不是一个问题。
无论如何,为了避免这种情况,返回到引脚和配置(双击项目资源管理器中的.ioc文件)。为SWD设置合适的引脚(在我的例子中为PA13,PA14 ),在'System Core‘下,点击SYS并将Debug选项设置为'Serial Wire’。

发布于 2020-06-14 13:29:11
是的,这是正确的iforce2d。启用串行线调试后,现在可以将新程序刷新到电路板(在IDE内),而无需首先使用ST-Link实用程序擦除所有内容。
遵循以下步骤:
一旦你有一个程序在STM32中启用了社保针,那么你将不再被“锁定”,所以你不需要在此…之后再次使用BOOT0 (或重置
注:调试配置(最适合我):调试探针= ST-LINK (OpenOCD);重置模式=软件系统重置。
发布于 2021-04-23 22:27:15
在我的案例(STM32F429I-DISC)中,我发现在社会福利署中使用的其中一个引脚被我错误地分配给了另一个目的。我发布了它,debug开始工作。我刚刚找到了ST电路板的原理图,并检查了社署使用了哪些引脚。
https://stackoverflow.com/questions/60827602
复制相似问题