本文将主要介绍如何使用Visual Studio和VisualGDB为LPC1549 LPCXpresso开发板创建一个使用mbed框架的基础项目。
LPC1549 LPCXpresso开发板载一个LPC-Link调试器,可用于调试板载的固件。
为了能够从VisualGDB调试该开发板,我们将从Segger下载并安装一个特殊的固件,使其与Segger J-Link软件和VisualGDB兼容。
1. 在开始之前,请先从恩智浦网站下载并安装LPCScrypt软件。

3. 打开设备管理器,确保LPC设备已安装驱动程序。如果没有,请从LPCScrypt \ Drivers文件夹安装驱动程序。
4. 运行LPCScrypt \ scripts \ program_JLINK.cmd脚本文件,并确保其成功编程J-Link固件:

如果LPCScrypt没有检测到您的开发板,将其从USB断开,关闭两个USB端口之间的“DFU Link”跳线,然后再次连接USB。
5. 拔下开发板并将其重新插入到USB。仔细检查它现在在设备管理器中是否显示为“Segger J-Link”:

6. 启动Visual Studio,然后打开VisualGDB Embedded Project Wizard:

7. 接下来使用默认的“Embedded Binary -> MSBuild”设置:

8. 选择“Use ARM mbed”,并从列表中选择LPC1549。确保您勾选“Provide default stubs for system calls”复选框:

9. 接下来在“Sample Selection”页面上选择默认LEDBlink示例:

10. 在向导的最后一页上选择“Segger J-Link”,并使用默认设置:

11. 点击“Finish”创建项目。使用Ctrl-Shift-B构建:

12. 按F5开始调试您的项目。一旦您看到板载LED闪烁,请在主循环中的某处设置断点,并确保您可以逐步执行代码:

13. 您可以使用VisualGDB项目属性的Embedded Frameworks页面来引用和配置mbed框架的各种组件(例如RTOS或USB支持):

没有评论:
发表评论