STLINK,CMSIS-DAP问题
前提cubemx生成的project
stlink:
- stlink下载后显示Internal command error
将target option ->debug ->setting ->flash download-> reset and run的勾选取消
或者见百度其他方法 - debug 无法run ,显示cannot access target
debug下单步运行,发现在HAL_MspInit里有__HAL_AFIO_REMAP_SWJ_DISABLE这个函数,看名字就明白不是好东西。。。
在cubemx->pinout->sys->debug->serial wire. generate code后即可debug.
cmsis-dap:
- RDDI_DAP Error
- debug 无法run
解决方法和上面相同
注意在DEBUG时把HAL_Delay函数注释掉否则会在其中绕很久。