LINUX下LM3S8962开发-之调试环境建立-系列(1)
[复制链接]
开发环境: 平台:Ubuntu 9.10 内核版本:2.6.31-22-generic
系统自带的openocd没有定制,不好用. 所以只能自己编译 首先下载openocd源码: git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd 完成后进入并配置: cd openocd 把版本降到 0.3.1 git checkout v0.3.1 ./bootstrap ./configure --enable-ft2232_libftdi --enable-maintainer-mode make sudo make install 注意: 如果在configure部分出错,根据出错提示检查一下是否安装了libusb-dev和libftdi-dev,libusb-dev提供usb接口的操作支持,libftdi-dev提供FTDI芯片ft2232D的支持,或者没有安装必要的编译工具.
如果在make部分出现问题,同样根据出错信息检查是否缺失了什么.
下载附件中的配置文件LM3S8962.cfg 这是openocd的配置文件,主要定义了接口和目标,接口为FTDI设备的调试接口,目标为Luminary的Cortex-M3设备. 将LM3S8962开发板通过MINI USB线接在电脑上,打开终端,输入命令: lsusb 如果输出有这么一行: Bus 003 Device 002: ID 0403:bcd8 Future Technology Devices International, Ltd Stellaris Development Board 说明连接没有问题,然后开始通过openocd和目标板进行连接: openocd -f lm3s8962.cfg 输出: mybays@spaceship:~/store/luminary/openocd-cfg$ openocd -f lm3s8962.cfg Open On-Chip Debugger 0.3.1 (2010-09-15-10:11) $URL$ For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs.html 500 kHz jtag_nsrst_delay: 100 jtag_ntrst_delay: 100 srst_only separate srst_gates_jtag srst_open_drain Info : clock speed 500 kHz Info : JTAG tap: lm3s8962.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
说明openocd通过ft2232和MCU LM3S8962建立了连接 打开另外一个终端,输入telnet 127.0.0.1 4444 输出: mybays@spaceship:~/store/luminary/openocd-cfg$ telnet 127.0.0.1 4444 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Open On-Chip Debugger > 这样就可以通过这个界面进行对LM3S8962的完全操作. 以下是几种主要操作: > halt target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x61000000 pc: 0x00003146 msp: 0x2000ff88
> targets TargetName Type Endian TapName State -- ------------------ ---------- ------ ------------------ ------------ 0* lm3s8962.cpu cortex_m3 little lm3s8962.cpu running
> flash probe 0 flash 'stellaris' found at 0x00000000
至此,LM3S8962的调试环境建立完毕,下一步便是LM3S8962的编译环境建立. 下一篇我将会和大家分享如何通过GCC源码来构建自己的交叉编译系统,感兴趣的可以提前看一下我的这篇文章: http://forum.byr.edu.cn/wForum/disparticle.php?boardName=Embedded_System&ID=9011&pos=1
本文章为原创,转载请注明转载地址。 以上步骤参考以下网址: http://www.orcboard.org/wiki/index.php/Information_for_Developers http://www.fpga4u.com/bbs/redirect.php?tid=323&goto=lastpost
|