在imxRT上部署软件调试环境

本文介绍了在imxRT10xx上搭建软件调试环境的步骤,包括安装JLink GDB Server、设置环境变量、构建GCC工具链、下载SDK,并详细说明了如何调试运行程序。通过使用GDB Server和GDB进行源代码调试,同时提到了使用minicom进行串口通信查看结果。文章还预告了后续将分享关于机器学习库在imxRT上的部署。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

imxRT系列芯片调试环境搭建


本篇主要介绍如何建立imxRT的软件调试环境,即GCC+GDB+JLinkGDBServer,以期进行程序编写、软件调试,

系统需求

OS:LINUX Ubuntu 14.04 or higher
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单片机上也能够实现!当然,这些我们现在都已经实现了,请看官们等候小编陆续更新!欢迎留言骚扰,一起讨论学习!

未完待续。。。。

PS:转载请注明出处

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值