標(biāo)題: 如何在GCC-ARM下使用ST-LINK調(diào)試器 [打印本頁]

作者: jialinx    時(shí)間: 2015-9-14 14:28
標(biāo)題: 如何在GCC-ARM下使用ST-LINK調(diào)試器
【要點(diǎn)】在開源GCC-ARM下使用ST-LINK進(jìn)行STM32程序的下載和調(diào)試。
1.開發(fā)環(huán)境和編譯器(WIN10-X64)
  (1)eclipse-cpp-mars-R-win32-x86_64.zip (Eclipse IDE for C/C++ Developers Version: Mars Release (4.5.0))
  (2)gcc-arm-none-eabi-4_9-2015q2-20150609-win32.exe (GNU Tools ARM Embedded 2005q2)

2.工具插件
  (1)gnuarmeclipse-build-tools-win64-2.6-201507152002-setup.exe
  (2)gnuarmeclipse-openocd-win64-0.9.0-201505190955-setup.exe

3.編程軟件
  stsw-link004.zip (STM32 ST-LINK Utility)

首先是利用編程軟件將編譯后的文件下載到芯片,設(shè)置如下圖所示







以上界面要填寫的內(nèi)容有兩條:
C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe

-P "${project_loc}/${config_name:${project_name}}/${project_name}.hex" -V -Rst


然后對(duì)GDB OpenOCD的設(shè)置界面填入調(diào)試參數(shù)

-f "C:/Program Files/GNU ARM Eclipse/OpenOCD/0.9.0-201505190955/scripts/interface/stlink-v1.cfg" -f "C:/Program Files/GNU ARM Eclipse/OpenOCD/0.9.0-201505190955/scripts/target/stm32f4x.cfg"

-f "C:/Program Files/GNU ARM Eclipse/OpenOCD/0.9.0-201505190955/scripts/interface/stlink-v2.cfg" -f "C:/Program Files/GNU ARM Eclipse/OpenOCD/0.9.0-201505190955/scripts/target/stm32f4x.cfg"

-f "C:/Program Files/GNU ARM Eclipse/OpenOCD/0.9.0-201505190955/scripts/interface/stlink-v2-1.cfg" -f "C:/Program Files/GNU ARM Eclipse/OpenOCD/0.9.0-201505190955/scripts/target/stm32f4x.cfg"

這里使用ST-LinkV2仿真器,填寫的是stlink-v2.cfg



【圖片】GDB OpenOCD debugging.jpg



參考資料:
2018年4月 Eclipse + OpenOCD + GCC + ST-Link 開發(fā)環(huán)境







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1