问题:
STM32CubeIDE默认都是ST-Link的配置,突然换到PTD01 DAP Debugger,需要做调整配置,这里做个记录,为后续开发做点铺垫。STM32CubeIDE使用PTD01 DAP Debugger配置方法。
原理图设计:
原理图设计如下,这里看,没有拉出来复位线,需要使用软件复位,下面配置有说关于复位的方式

修改配置文件
修改配置文件,步骤如下图所示,这里主要时修改工程目录下的.cfg文件

实际修改后的文件如下,这里注意,还对复位方式做了修改

这里给出了复位指令

仍然存在问题:
修改配置文件完成,并使用后,还出现如下问题。这些错误表面还是没有配置好.cfg文件,文件最后给出一个正常使用的配置文件
Debug时提示如下错误

详细错误如下:
Error in final launch sequence: Failed to execute MI command: load D:\\xxx\\DelayTest.elf Error message from debugger back end: Error erasing flash with vFlashErase packet Failed to execute MI command: load D:\\xxx\DelayTest.elf Error message from debugger back end: Error erasing flash with vFlashErase packet Failed to execute MI command: load D:\\xxx\\DelayTest.elf Error message from debugger back end: Error erasing flash with vFlashErase packet Error erasing flash with vFlashErase packet
Error in final launch sequence:
Failed to execute MI command:
target extended-remote localhost:3333
Error message from debugger back end:
localhost:3333: Connection timed out.
Failed to execute MI command:
target extended-remote localhost:3333
Error message from debugger back end:
localhost:3333: Connection timed out.
localhost:3333: Connection timed out.
有效的配置文件参考
有效的配置文件,选择了软复位,可以和读者的.cfg进行比对,看看哪里出错了。如果上述原理图设计了引出了复位线,应该也可以选择硬复位。
# This is an genericBoard board with a single STM32F407IGTx chip
#
# Generated by STM32CubeIDE
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
source [find interface/cmsis-dap.cfg]
set WORKAREASIZE 0x8000
transport select "swd"
set CHIPNAME STM32F407IGTx
set BOARDNAME genericBoard
# Enable debug when in low power modes
set ENABLE_LOW_POWER 1
# Stop Watchdog counters when halt
set STOP_WATCHDOG 1
# STlink Debug clock frequency
set CLOCK_FREQ 8000
# Reset configuration
# use software system reset if reset done
reset_config none
set CONNECT_UNDER_RESET 0
set CORE_RESET 0
# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333
# BCTM CPU variables
source [find target/stm32f4x.cfg]
$_TARGETNAME configure -event gdb-detach {
gdb_detach_hook
reset
}
3万+

被折叠的 条评论
为什么被折叠?



