Issue in loading Freertos Hello World file on Toradex Board. Getting Memeory error

I am trying to boot FreeRTOS Hello world elf on the Toradex Board. But Getting some memory issue.
I first the below steps for remoteproc1 where the state is running but when trying with Hello world elf is not working
Flashing SD image .
Using uuu and the files imx-boot-variant-alt-imx95-19x19-verdin-sd.bin-flash_alt , imx-image-full-imx95-19x19-verdin.wic flash it to SD memory, these file are included in pre-built images.

E.g. on windows terminal:

uuu.exe -b sd_all .\imx-boot-variant-alt-imx95-19x19-verdin-sd.bin-flash_alt .\imx-image-full-imx95-19x19-verdin.wic


**Modifying uboot environment.**
iMX 95 Verdin

Stop in uboot

Add to mmcargs `pd_ignore_unused clk_ignore_unused` and boot. E.g.:
u-boot=> setenv mmcargs "setenv bootargs ${cpuidle} ${jh_clk} ${mcore_args} console=${console} root=${mmcroot} pd_ignore_unused clk_ignore_unused"
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(1)... OK
u-boot=> boot
After that, remote-proc can be used normally, I also share a log example
root@imx95-19x19-verdin:~# cat /sys/devices/platform/imx95-cm7/remoteproc/remoteproc1/state
offline
root@imx95-19x19-verdin:~# echo ~/rpmsg_lite_str_echo_rtos.elf > /sys/devices/platform/imx95-cm7/remoteproc/remoteproc1/firmware
root@imx95-19x19-verdin:~# echo start > /sys/devices/platform/imx95-cm7/remoteproc/remoteproc1/state
root@imx95-19x19-verdin:~# cat /sys/devices/platform/imx95-cm7/remoteproc/remoteproc1/state
running

I am attaching the error document. 
See 'systemctl status weston.service' for details.
[  OK  ] Reached target Graphical Interface.
         Starting Record Runlevel Change in UTMP...
[  OK  ] Finished Record Runlevel Change in UTMP.

NXP i.MX Release Distro 6.6-scarthgap imx95-19x19-verdin ttyLP0

imx95-19x19-verdin login: root
root@imx95-19x19-verdin:~#
root@imx95-19x19-verdin:~# cd /sys/devices/platform/imx95-cm7/
driver/                             modalias                            power/                              subsystem/                          uevent
driver_override                     of_node/                            remoteproc/                         supplier:platform:42430000.mailbox/
root@imx95-19x19-verdin:~# cd /sys/devices/platform/imx95-cm7/remoteproc/
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc# ls
remoteproc1
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc# cd remoteproc1/
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# ls
coredump  device  firmware  name  power  recovery  state  subsystem  uevent
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# cat firmware
rproc-imx-rproc-fw
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo /usr/lib/firmware/
NeutronFirmware.elf                                                imx95-verdin-evk_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf
NeutronKernels.bin                                                 imx95-verdin-evk_m7_TCM_rpmsg_lite_str_echo_rtos.elf
freertos_hello_sm_cm7.elf                                          imx95-verdin-evk_m7_TCM_sai_low_power_audio.elf
imx95-15x15-evk_m7_TCM_power_mode_switch.elf                       jailhouse.bin
imx95-15x15-evk_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf   mali_csffw.bin
imx95-15x15-evk_m7_TCM_rpmsg_lite_str_echo_rtos.elf                nxp/
imx95-15x15-evk_m7_TCM_sai_low_power_audio.elf                     regulatory.db
imx95-19x19-evk_m7_TCM_flexcan_linux.elf                           regulatory.db.p7s
imx95-19x19-evk_m7_TCM_low_power_wakeword.elf                      tee-header_v2.bin
imx95-19x19-evk_m7_TCM_netc_share.elf                              tee-pageable_v2.bin
imx95-19x19-evk_m7_TCM_power_mode_switch.elf                       tee-pager_v2.bin
imx95-19x19-evk_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf   tee-raw.bin
imx95-19x19-evk_m7_TCM_rpmsg_lite_str_echo_rtos.elf                tee.bin
imx95-19x19-evk_m7_TCM_sai_low_power_audio.elf                     tee.elf
imx95-verdin-evk_m7_TCM_power_mode_switch.elf                      wave633c_codec_fw.bin
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo /usr/lib/firmware/imx95-verdin-evk_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf > firmware
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# cat firmware
/usr/lib/firmware/imx95-verdin-evk_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# cat state
offline
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo start > state
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# sync
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# cat state
running
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo stop > state
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo /usr/lib/firmware/imx95-verdin-evk_m7_TCM_rpmsg_lite_str_echo_rtos.elf > firmware
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# cat firmware
/usr/lib/firmware/imx95-verdin-evk_m7_TCM_rpmsg_lite_str_echo_rtos.elf
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo start > state
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# sync
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1#
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo stop > state
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo /usr/lib/firmware/freertos_hello_sm_cm7.elf > firmware
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# cat firmware
/usr/lib/firmware/freertos_hello_sm_cm7.elf
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# sync
root@imx95-19x19-verdin:/sys/devices/platform/imx95-cm7/remoteproc/remoteproc1# echo start > state
[  195.984790] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[  195.991056] Modules linked in: rpmsg_ctrl rpmsg_char snd_soc_fsl_asoc_card mxc_jpeg_encdec crct10dif_ce snd_soc_imx_card polyval_ce polyval_generic snd_soc_imx_audmux v4l2_jpeg snd_soc_fsl_micfil snd_soc_fsl_sai snd_soc_fsl_utils snd_soc_wm8904 ap130x imx_pcm_dma flexcan can_dev pwm_fan fuse
[  196.016866] CPU: 2 PID: 680 Comm: sh Not tainted 6.6.36-lts-next-gd23d64eea511 #1
[  196.024334] Hardware name: NXP i.MX95 19X19 board (DT)
[  196.029457] pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  196.036407] pc : __memcpy+0x110/0x240
[  196.040064] lr : rproc_start+0x64/0x1b4
[  196.043895] sp : ffff8000849f3be0
[  196.047196] x29: ffff8000849f3be0 x28: ffff0000853ad880 x27: 0000000000000000
[  196.054321] x26: 0000000000000000 x25: ffff000084c11e00 x24: ffff00008c3bcc20
[  196.061445] x23: 0000000000000000 x22: ffff000080945038 x21: ffff000080945000
[  196.068575] x20: 0000000000000000 x19: ffff800083075000 x18: fffffffffffedbb0

[  196.075779] x17: 72656572662f6572 x16: 61776d7269662f62 x15: 0000000000000040
Message from syslogd@imx95-19x19-verdin at Tue Feb 27 18:00:41 2024 ...
kernel: Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[  196.095288] x14: ffff800083075000 x13: 0000000000007d08 x12: 0000000000000001
[  196.102412] x11: ffff0000809454d0 x10: 0000000000000003 x9 : ffff80008170f070
[  196.109536] x8 : ffff80008170f070 x7 : 0000000000000001 x6 : ffff800084b47d08
[  196.116660] x5 : ffff8000830750a0 x4 : 00000000000000a0 x3 : 0000000000000000
[  196.123784] x2 : 00000000000000a0 x1 : 0000000000000000 x0 : ffff800083075000
[  196.130915] Call trace:
[  196.133360]  __memcpy+0x110/0x240
[  196.136669]  rproc_boot+0x198/0x57c
[  196.140154]  state_store+0x40/0x104
[  196.143637]  dev_attr_store+0x18/0x2c
[  196.147303]  sysfs_kf_write+0x44/0x54
[  196.150963]  kernfs_fop_write_iter+0x120/0x1cc
[  196.155400]  vfs_write+0x1c0/0x300
[  196.158804]  ksys_write+0x74/0x10c
[  196.162201]  __arm64_sys_write+0x1c/0x28
[  196.166118]  invoke_syscall+0x48/0x114
[  196.169856]  el0_svc_common.constprop.0+0xc0/0xe0
[  196.174553]  do_el0_svc+0x1c/0x28
[  196.177864]  el0_svc+0x40/0xe4
[  196.180921]  el0t_64_sync_handler+0x120/0x12c
[  196.185265]  el0t_64_sync+0x190/0x194
[  196.188932] Code: cb01000e b4fffc2e eb0201df 540004a3 (a940342c)
[  196.195014] ---[ end trace 0000000000000000 ]---

Message from syslogd@imx95-19x19-verdin
NXP i.MX Release Distro 6.6-scarthgap imx95-19x19-verdin ttyLP0
Please help.
For build imx-mkimage -  using NXP Files (Is there anything else?)
For Hello world elf - NXP SDK 24_10 Latest one
Please help, further details message.
Thanks

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To address the memory error you’re encountering when loading the FreeRTOS Hello World ELF file on your Toradex board, here are some steps you can follow:

  1. Verify ELF File Compatibility: Ensure that the ELF file is compatible with your specific Toradex module. It should be built using the correct toolchain and settings tailored for your hardware.

  2. Check Memory Configuration: Memory errors often arise from incorrect memory allocation. Verify that the memory regions defined in your FreeRTOS project align with those available on your Toradex board. Pay special attention to the linker script used during the build process.

  3. Review U-Boot Environment: Double-check the modifications made to the U-Boot environment. Ensure that the boot arguments, such as pd_ignore_unused and clk_ignore_unused, are correctly applied and do not conflict with the memory usage of your ELF file.

  4. Remoteproc Configuration: Since you successfully used remoteproc with another ELF file, compare the configurations. Ensure that the Hello World ELF file is set up similarly, focusing on the firmware path and any specific settings required for your application.

  5. Enable Debugging: If the issue persists, consider enabling debugging options in FreeRTOS to obtain more detailed error messages. This can help identify the exact cause of the memory error.

By following these steps, you should be able to identify and resolve the memory issue with your FreeRTOS Hello World ELF file. If further issues arise, reviewing the build and configuration process for any discrepancies might be helpful.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

Custom Torizon u-boot env.