查看: 2544|回复: 0

在imxRT上部署软件调试环境

[复制链接]
  • TA的每日心情
    开心
    2025-7-11 08:53
  • 签到天数: 301 天

    连续签到: 2 天

    [LV.8]以坛为家I

    3936

    主题

    7557

    帖子

    0

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    40204
    最后登录
    2025-9-5
    发表于 2020-2-17 10:22:08 | 显示全部楼层 |阅读模式
    imxRT系列芯片调试环境搭建
    系统需求
    调试环境搭建
    调试运行程序
    结束语


    本篇主要介绍如何建立imxRT的软件调试环境,即GCC+GDB+JLinkGDBServer,以期进行程序编写、软件调试,
    系统需求
    1. 1.OS:LINUX Ubuntu 14.04 or higher
    2. 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                   文章出处:点击查看

    qiandao qiandao
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-9-8 01:03 , Processed in 0.070691 second(s), 19 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表