stlink-opencd-gdb调试程序
2017-06-07 13:50
316 查看
1.
启动openocd server
2. 编写.gdbinit脚本
openocd 操作stm32 flash命令:
1. openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c init -c "reset halt" -c "flash erase_address 0x08000000 0x40000" -c exit
清空从0x80000000地址开始,长度为40000的flash地址
2. openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c init -c "reset run" -c "mdw 0x08000000 0x10000" -c "exit"
将地址从0x80000000开始,长度为0x10000的内容打印到屏幕
20179.27
$ openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg
启动openocd server
2. 编写.gdbinit脚本
target remote localhost:3333 monitor reset monitor halt load3.
$ arm-none-eabi-gdb example.elf 4. (gdb) source .gdbinit 5. 设置断点 b main monitor reset halt 6. continue (这里没有run指令,只有c指令) //注意设置断点后,一定要执行monitor reset halt指令,否则不会停在断点处!!!
openocd 操作stm32 flash命令:
1. openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c init -c "reset halt" -c "flash erase_address 0x08000000 0x40000" -c exit
清空从0x80000000地址开始,长度为40000的flash地址
2. openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c init -c "reset run" -c "mdw 0x08000000 0x10000" -c "exit"
将地址从0x80000000开始,长度为0x10000的内容打印到屏幕
20179.27
相关文章推荐
- 在systemWorkBench中使用st-link调试程序
- STM32单片机使用ST-LINK调试程序时不能设断点
- 【转】使用J-Link GDB Server + Eclipse CDT进行ARM程序调试
- Keil STM32调试,使用ST-Link下载程序时提示“flash timeout.reset the target and try it again”
- Android中用gdb调试一启动就崩溃的程序
- [置顶] 使用gdb调试多进程多线程程序
- 用GDB调试程序---转贴,非常全面的调试技巧
- 使用GDB调试开发板程序
- 使用gcc和 gdb,调试程序
- 使用图形界面调试arm程序: insight + gdb
- gdb 调试,让程序的输出转向到其他terminal
- windows下gdb与gdb_server调试Android的程序
- 用GDB调试程序
- 用GDB调试程序
- 用GDB调试程序(四)
- 用GDB调试程序(三)
- 用GDB调试程序(一)
- 转:用GDB调试程序
- 用gdb调试程序笔记: 以段错误(Segmental fault)为例
- linux下如何用GDB调试c++程序