STM32 F103C8T6 flash锁死的解决方法
STM32 F103C8T6 flash锁死的解决方法。
先让最小板的boot启动方式改为SRAM,默认是Flash方式。再使用STM32 ST-LINK Utility,连接清除flash信息。再改回Flash方式,系统恢复正常,操作步骤如下:
软件开发环境
STM32 Cube IDE
开发板为STM32F103C8T6 最小系统板。
由于开发中不小心,没有使用SYS的Debug Serial Wire,导致锁死Flash
部署程序到stm32最小系统板的时候STM32CubeIDE报下面的错误信息。
Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
ST-Link设备进行初始化时出错。
原因:(4) 没有找到目标设备。
使用STM官网工具软件STM32 ST-LINK Utility
查询后提示Target Detection Fail,无法正确连接STM32目标
解决方法:
将boot0和boot1跳线接到1
下面是默认的Flash boot跳线方式
需要改为SRAM的跳线方式,全部跳到右边靠近1这个位置,如下图。
STM32F103C8T6核心板BOOT启动方式列表。
BOOT0 |
BOOT1 |
MODE |
0 |
X |
FLASH |
1 |
1 |
SRAM |
1 |
0 |
ISP |
插入ST-LINK USB,当我们再使用STM官网工具软件STM32 ST-LINK Utility查询时信息如下,说明连接成功:
接到将Flash数据全部清空。
点1连接
点2清除Flash内容。
点3步里面弹出框,点击ok将数据清空。
Target STM32F10xx Medium-density
Target Voltage 3.2V
然后取出ST-Link后,将跳线帽返回0。
接上系统ST-Link后,使用STM32CubeIDE发送程序。系统提示下面。
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a07524.srec
File : ST-LINK_GDB_server_a07524.srec
Size : 11484 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 11]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:01.059
Verifying ...
Download verified successfully
到此为止一切正常!系统恢复工作。