下载程序可以,为啥调试就不行呢?
STMicroelectronics ST-LINK GDB server. Version 5.8.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
LogFile Name : debug.log
Logging Level : 31
Listen Port Number : 61235
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
请检查您的 ST-LINK 是否正常连接.
调式程序运行到这里,停了下来,是咋回事?感觉是内存不够的原因
STMicroelectronics ST-LINK GDB server. Version 5.8.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
LogFile Name : debug.log
Logging Level : 31
Listen Port Number : 61235
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Target connection mode: Default
Reading ROM table for AP 0 @0xe00fffd0
Hardware watchpoint supported by the target
COM frequency = 4000 kHz
ST-LINK Firmware version : V2J24S4
Device ID: 0x410
PC: 0x8007874
ST-LINK device status: HALT_MODE
ST-LINK detects target voltage = 3.23 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61235...
Accepted connection on port 61235...
Debugger connected
Wrapping read detected. Addr: 0xffffffff; Length: 4
Wrapping read detected. Addr: 0xffffffff; Length: 4
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x00000008
NVIC_CFGFSR_REG = 0x00000000
TraceCaptureStart and SWV event set to APP_TRUE
ST-LINK device status: RUN_MODE
用的什么IDE?
@crystal266 RT_thread studio
@crystal266 这个IDE的GCC编译出来的文件太大,占了太多空间,MCU空间快被占完,导致调试无法进行,应该是这个原因
@paul096 编译出来的文件是多大的,单片机是多大的?
@crystal266 单片机64K 编译后文件57K
@paul096 你建立一个最简工程,就是基于芯片创建工程后不添加其他软件包,这时候编译出来的文件比较小,这种情况下可以调试吗?
@crystal266 小一些的工程,比如51K的工程,有时候也会出现同样的问题,有时候又可以调试,但是调式过程不顺利。我换到一个质量好的开发板,调试是没问题的,可能我这个不好调试的开发板STM32芯片是盗版的,导致调式无法顺利进行。
@paul096 是国产的芯片吗?建议跑 RTT 标准版本使用大 flash 和 ram 的芯片,64KB的运行 nano版本合适一点。