아래의 경로에서 build_all.sh 을 통해 리눅스에서 빌드를 시도하면 에러가 나는데
./nxp/imx8plus/cortex-m7/SDK_2_13_0_EVK-MMP/boards/evkmimx8mp/demo_apps/hello_world/armgcc$ ./build_all.sh CMake Error at /home/falinux/바탕화면/nxp/imx8plus/cortex-m7/SDK_2_13_0_EVK-MIMX8MP/tools/cmake_toolchain_files/armgcc.cmake:16 (MESSAGE): ***Please set ARMGCC_DIR in envionment variables*** Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:91 (include) CMakeLists.txt:10 (ENABLE_LANGUAGE) |
아래와 같이 추가해주면 일단 빌드가 문제없이 된다.
$ export ARMGCC_DIR=/usr |
imx8 SD 카드의 boot 파티션에 release/hello_world.bin 을 복사해서 넣고
아래의 문장을 uboot 에서 따라하면
If the hello_world.bin is made from the debug/release target, which means the binary file will run at TCM, use the following commands to boot: • fatload mmc 1:1 0x48000000 hello_world.bin;cp.b 0x48000000 0x7e0000 20000; • bootaux 0x7e0000 |
출처 : Getting Started with MCUXpresso SDK for EVK-MIMX8MP
아래와 같이 /dev/ttyUSB3 포트를 통해서 hello world. 가 출력된다.
다만.. 이녀석은 TCM 에서 빌드되어 실행되기로 상정(?)된 파일이기 때문에 리눅스의 sysfs를 통해서 실행하려면
어떤 바이너리를 통해 실행해야 하려나?
b. If the hello_world.bin is made from the ddr_debug/ddr_release target, which means the binary file runs at DRAM, use the following commands: • fatload mmc 1:1 0x80000000 hello_world.bin • dcache flush • bootaux 0x80000000 c. If the hello_world.bin is made from the flash_debug/flash_release target, which means the binary file runs at QSPI/XIP, use the following commands: • sf probe • sf read 0x80000000 0 4 • fatload mmc 1:1 0x80000000 flash.bin • dcache flush • sf erase 0 0x100000 • sf write 0x48000000 0 0x100000 • bootaux 0x8000000 Note: If the Linux OS kernel runs together with M7, make sure the correct dtb file is used. This dtb file reserves resources used by M7 and avoids the Linux kernel from configuring them. Use the following command in U-Boot before running the kernel: setenv fdtfile ‘imx8mp-evk-rpmsg.dtb’ |
+
ddr_release / flash_release의 파일을 실행하려고 했을 때
# echo start > /sys/class/remoteproc/remoteproc0/state [ 193.353375] remoteproc remoteproc0: powering up imx-rproc [ 193.359090] remoteproc remoteproc0: Booting fw image hello_world.elf, size 217076 [ 193.366735] remoteproc remoteproc0: bad phdr da 0x80000000 mem 0x2a8 [ 193.373157] remoteproc remoteproc0: Failed to load program segments: -22 [ 193.380092] remoteproc remoteproc0: Boot failed: -22 -sh: echo: write error: Invalid argument root@imx8mpevk:/lib/firmware# echo -n hello_world.bin > /sys/class/remoteproc/remoteproc0/firmware root@imx8mpevk:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state [ 204.092891] remoteproc remoteproc0: powering up imx-rproc [ 204.098514] remoteproc remoteproc0: Image is corrupted (bad magic) [ 204.104760] remoteproc remoteproc0: Boot failed: -22 -sh: echo: write error: Invalid argument |
relase의 파일을 실행하려 했을 때. 되는거야 안되는거야.. 일단 cortex-m7용 디버그 포트로 출력은 안된다.
# echo -n hello_world.elf > /sys/class/remoteproc/remoteproc0/firmware # echo start > /sys/class/remoteproc/remoteproc0/state [ 366.495958] remoteproc remoteproc0: powering up imx-rproc [ 366.501775] remoteproc remoteproc0: Booting fw image hello_world.elf, size 217076 |
'embeded > i.mx 8m plus' 카테고리의 다른 글
nxp i.mx8mp win iot (0) | 2023.05.26 |
---|---|
rpmsg-lite (0) | 2023.03.23 |
i.mx8m plus cortex-m7 (0) | 2023.02.23 |
i.mx8m plus win iot 실행 (0) | 2023.02.23 |
i.mx8 tensilica dsp (0) | 2023.02.07 |