在线时间4811 小时
UID3441752
注册时间2017-11-21
NXP金币75971
TA的每日心情 | 开心 2025-7-11 08:53 |
---|
签到天数: 301 天 连续签到: 2 天 [LV.8]以坛为家I
管理员
  
- 积分
- 40204
- 最后登录
- 2025-9-5
|
imxRT系列芯片调试环境搭建
系统需求
调试环境搭建
调试运行程序
结束语
本篇主要介绍如何建立imxRT的软件调试环境,即GCC+GDB+JLinkGDBServer,以期进行程序编写、软件调试,
系统需求
- 1.OS:LINUX Ubuntu 14.04 or higher
- 2.Platform:MIMXRT1050-EVK Board
复制代码
调试环境搭建
Install the Jlink gdb sever + arm-none-eabi-gdb do debug the Code
Type sudo apt-get install gdb-arm-none-eabi, then the gdb will be installed directly in you system, if it does not work, try to download the gcc-arm-none-eabi-7-2017-q4-major-src.tar.bz2 from ARM Developer website. Do not download the latest version. You may meet some issues with the newest one!
Download J-Link Software and Documentation pack for linux, TGZ archive, 64-bit[Beta] from Segger Jlink website and unzip.
Build the gcc-arm-none-eabi, you can follow “How to build toolchain.pdf”, if you use Sudo apt-get to install the gdb, Please ignore the step below.
Export TOOLCHAIN_DIR=…your directory…/gcc-arm-none-eabi-7-2017-q4-major/install-native/
Export ARMGCC_DIR=…your directory…/gcc-arm-none-eabi-7-2017-q4-major/install-native/
Download the i.MXRT SDK ( EVKB-IMXRT1052 armgcc version ) from NXP website
调试运行程序
Cd to the armgcc folder in EVK-IMXRT1052/boards/evkbimxrt1050/demo_apps/hello_world, or you can choose anyone you like to build , type ./clean.sh before type ./build_sdram_debug.sh to build the project, then you will get a .elf in the folder sdram_debug. ( means the name of the elf), or you can test another command-script, to build different version-code->run in SDRAM or in RAM, have fun!
Run J-link GDB server
cp libjlinkarm.so.* /usr/lib
cp 99-jlink.rules /etc/udev/rules.d
cd to the path you place the J-Link software, and type ./JLinkGDBServer -device MCIMXRT1052 -if SWD -speed 4000 -JlinkScriptFile ./ evkmimxrt1050_sdram_init.jlinkscript (you can find this file in the path ./hello_world)
cd to the path where you place the *.elf and Run arm-none-eabi-gdb
Type target remote 127.0.0.1:2331
Type file *.elf
Type load
Then we can use gdb to debug the source code, you can try Some commands like this:
c : run the code
s : single step
n : next step
Connect the EVK to the PC through the usb cable to watch the result
To do that , maybe you will install a series port tester, in linux you can try minicom, type sudo apt-get install minicom
Type sudo minicom -s to setup the serial port, in linux named ttyACM0, and the baud-rate is 115200, then save your configuration.
Type c in the gdb console to run the code and you will see the result in the minicom.
结束语
在本文中,跟大家简单分享了一下在imxRT上搭建软件调试环境的基本流程,算是后续程序移植的先遣兵,打下了基础!后续,还会陆续更新一些机器学习相关的环境搭建部署,如:CMSIS-NN、ARM-NN、COMPUTE-LIBREARY等ARM官方软件库,主要集中在环境的搭建、代码编译移植,即如何让这些库在我们的imx系列芯片上飞奔起来,让机器学习在imx系列上生根发芽,让AI不仅仅能够在MPU上运行,在小小的MCU单片机上也能够实现!当然,这些我们现在都已经实现了,请看官们等候小编陆续更新!欢迎留言骚扰,一起讨论学习!
作者:AIA-XP 文章出处:点击查看
|
|