分享

Eclipse配合GDB和jlinkGDBServer仿真调试STM32

 圆锥的布袋 2017-05-14

在Eclipse的IDE环境下,除了可以搭建STM32的编译环境外,还可以配合jlink仿真器实时仿真调试stm32.

Eclipse SDK
Version: 3.7.2
Build id: M20120208-0800



首先需要配置下。

在RUN菜单下的debug  configration中,找到GDB Hardware Debugging选项,选择新建,若没有这个选项需要下载这个插件, 地址在

CDT Juno http://download./tools/cdt/releases/indigo

在新建的选项中,可以命名一个名字,如J-link GDB Server


然后配置下如下参数,在startup选项中的,initialization commands中,设下如下内容:

并选择要加载调试的elf文件。

# Enable flash download and flash breakpoints.
# Flash download and flash breakpoints are features of
# the J-Link software which require separate licenses 
# from SEGGER.
# Select flash device
    monitor flash device = STM32F103ZE
# Enable FlashDL and FlashBPs
    monitor flash download = 1
    monitor flash breakpoints = 1
# Clear all pendig breakpoints
    monitor clrbp
# Set gdb server to little endian
    monitor endian little
# Set JTAG speed to 5 kHz
    monitor speed 5
# Reset the target
    monitor reset
    monitor sleep 100
# Set JTAG speed in khz
    monitor speed auto
# Vector table placed in Flash
    monitor writeu32 0xE000ED08 = 0x00000000

在Run commands下面的编辑框中填入

monitor reg r13 = (0x00000000)
monitor reg pc = (0x00000004)
break ResetHandler
break main
continue


还没有完,还需要配置下jlink的 GDBServer的位置:

在Run菜单的最后一项 Extrnal tools菜单中,选择Extrnal tools configration,

选择program

配置下GDBserver地址


D:\Program Files\SEGGER\JLinkARM_V408l\JLinkGDBServer.exe

arguments: -if SWD

然后再点击Debug就可以仿真调试了。需要注意的是先要启动GdbServer.

附件:截图和Eclipse配合GDBServer仿真STM32流水灯的例子。例子工程在CSDN资源中。




    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多