i.MX 8M Mini Cortex-M4程序编译

下载官方SDK
    SDK_2.5.0_EVK-MIMX8MM:https://mcuxpresso.nxp.com/en/dashboard?uvid=172537,需要登陆
    编译参考手册:《docs/Getting Started with MCUXpresso SDK for i.MX 8M Mini.pdf》-《5 Run a demo using ARM® GCC》

安装编译链
    下载:gcc-arm-none-eabi-7-2017-q4-major-linux.bz2
    https://download.csdn.net/download/sunluyao_/10415737,陈熙使用的CSDN会员帮忙下载

    解压并安装:
    tar -xvf gcc-arm-none-eabi-7-2017-q4-major-linux.bz2
    export ARMGCC_DIR=/home/logread/imx8/cortex-M4/gcc-arm-none-eabi-7-2017-q4-major
    export PATH=$PATH:/home/logread/imx8/cortex-M4/gcc-arm-none-eabi-7-2017-q4-major/bin

    logread@logread:~/imx8/cortex-M4$ arm-none-eabi-gcc -v
    Thread model: single
    gcc version 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204] (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 
            
编译文件
    测试程序目录:<install_dir>/boards/<board_name>/<example_type>/<application_name>/armgcc
    /home/logread/imx8/cortex-M4/SDK_2.5.0_EVK-MIMX8MM/boards/evkmimx8mm/demo_apps/hello_world/armgcc
    $ ./build_release.sh
    release/ hello_world.bin  hello_world.elf
    
跑demo
    tftp 0x7e0000 hello_world.bin
    bootaux 0x7e0000
    M4打印hello world.
    
查看文件
    file release/hello_world.elf 
    release/hello_world.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped            
    file release/hello_world.bin 
    release/hello_world.bin: data

在板子运行
    root@OpenWrt:/# /tmp/hello_world.elf 
    Segmentation fault,需要用jlink和gdb跑这个程序

使用Open编译链
    export ARMGCC_DIR=/home/logread/imx8/openwrt/staging_dir/toolchain-aarch64_cortex-a53+neon_gcc-8.3.0_musl
    export PATH=$PATH:/home/logread/imx8/openwrt/staging_dir/toolchain-aarch64_cortex-a53+neon_gcc-8.3.0_musl/bin
        
    /home/logread/imx8/cortex-M4/SDK_2.5.0_EVK-MIMX8MM/tools/cmake_toolchain_files/armgcc.cmake:24:SET(TARGET_TRIPLET "arm-none-eabi")    
        
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mthumb'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mthumb'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mthumb'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mapcs'; did you mean '--specs'?
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mapcs'; did you mean '--specs'?
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mapcs'; did you mean '--specs'?
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mthumb'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mapcs'; did you mean '--specs'?
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mfloat-abi=hard'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mfloat-abi=hard'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mfloat-abi=hard'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mfloat-abi=hard'
    aarch64-openwrt-linux-gcc: error: unrecognized command line option '-mfpu=fpv4-sp-d16'
 

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值