Need assistance with application reset issue in U-Boot on Toradex SOM

Dear Toradex Support Team,

I hope this message finds you well. I am currently facing an issue with my Toradex SOM.

I have created a binary file and sent it to my SOM, placing it in the Var directory. To load the binary, I am using the EXT4LOAD command in the U-Boot terminal, following the instructions provided in this link [link ]. The application successfully starts; however, it unexpectedly resets within U-Boot. I want to understand how to prevent this reset from occurring.

It is important to note that I have not made any modifications to the “hello-world” binary file, and I have only compiled it as instructed.

If I want to stop restarting, I have to press the button, and please see the information.
infoU-Boot.txt (70.9 KB)

I reset the Environment to default, and now everything is back to normal. What was my mistake?
What caused it to get stuck in the U-boot loop?

I would greatly appreciate any guidance or suggestions you can provide to help me troubleshoot and address this issue. Thank you for your attention and support.

Best regards,
Mehrdad

Hi @Mehrdad !

From your infoU-Boot.txt, seems like there is some issue related to the rproc

Boot log from infoU-Boot.txt
Starting kernel ...

[    0.869905] imx-drm 32c00000.bus:display-subsystem: no available port
[    1.288821] rtc-ds1307 0-0032: hctosys: unable to read the hardware clock
[    1.322292] Unable to handle kernel paging request at virtual address ffff7fff92576d3d
[    1.330282] Mem abort info:
[    1.333099]   ESR = 0x96000004
[    1.336155]   EC = 0x25: DABT (current EL), IL = 32 bits
[    1.341468]   SET = 0, FnV = 0
[    1.344530]   EA = 0, S1PTW = 0
[    1.347671]   FSC = 0x04: level 0 translation fault
[    1.352556] Data abort info:
[    1.355437]   ISV = 0, ISS = 0x00000004
[    1.359324]   CM = 0, WnR = 0
[    1.362334] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000049c16000
[    1.369058] [ffff7fff92576d3d] pgd=0000000000000000, p4d=0000000000000000
[    1.375906] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.381482] Modules linked in:
[    1.384539] CPU: 0 PID: 9 Comm: kworker/u8:0 Not tainted 5.15.77-6.2.0+git.aa0ff7e3554e #1-TorizonCore
[    1.393849] Hardware name: Toradex Verdin iMX8M Mini WB on Verdin Development Board (DT)
[    1.401944] Workqueue: events_unbound deferred_probe_work_func
[    1.407789] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    1.414754] pc : rproc_handle_resources.constprop.0+0xb8/0x1a4
[    1.420593] lr : rproc_boot+0x430/0x5f0
[    1.424435] sp : ffff80000a3db9e0
[    1.427750] x29: ffff80000a3db9e0 x28: ffff7fff92576d41 x27: 00000000881a9d3d
[    1.434896] x26: ffff8000098ba560 x25: 0000000000000000 x24: ffff000004f11038
[    1.442041] x23: ffffffff881a9d3d x22: ffff80000a3cd000 x21: 0000000077e566bf
[    1.449185] x20: ffff000004f11000 x19: 0000000000000000 x18: fffffffffffc46c8
[    1.456331] x17: 000000040044ffff x16: 00500072b5503510 x15: 6c6261745f63471f
[    1.463480] x14: 0000000000000001 x13: 0000000000000000 x12: 0000000000000003
[    1.470623] x11: 0101010101010101 x10: 0000000000000034 x9 : 0000000000000000
[    1.477767] x8 : ffff000004ee8280 x7 : 0000000000000000 x6 : 000000000000003f
[    1.484913] x5 : 0000000000000040 x4 : ffff000004f11400 x3 : 0000000000000000
[    1.492058] x2 : 0000000000000400 x1 : ffff80000a0e0fb8 x0 : ffff80000a3cd000
[    1.499207] Call trace:
[    1.501656]  rproc_handle_resources.constprop.0+0xb8/0x1a4
[    1.507145]  rproc_boot+0x430/0x5f0
[    1.510638]  rproc_add+0xcc/0x16c
[    1.513958]  imx_rproc_probe+0x500/0x700
[    1.517886]  platform_probe+0x68/0xe0
[    1.521551]  really_probe+0xbc/0x46c
[    1.525131]  __driver_probe_device+0x114/0x190
[    1.529578]  driver_probe_device+0x40/0x100
[    1.533766]  __device_attach_driver+0xbc/0x160
[    1.538217]  bus_for_each_drv+0x78/0xd0
[    1.542058]  __device_attach+0xa8/0x1e4
[    1.542799] imx6q-pcie 33800000.pcie: iATU unroll: enabled
[    1.545900]  device_initial_probe+0x14/0x20
[    1.551389] imx6q-pcie 33800000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    1.555569]  bus_probe_device+0x9c/0xa4
[    1.555575]  deferred_probe_work_func+0x94/0xe4
[    1.555580]  process_one_work+0x1d4/0x480
[    1.563184] imx6q-pcie 33800000.pcie: host bridge /soc@0/pcie@33800000 ranges:
[    1.566989]  worker_thread+0x2c0/0x470
[    1.571544] imx6q-pcie 33800000.pcie:       IO 0x001ff80000..0x001ff8ffff -> 0x0000000000
[    1.575524]  kthread+0x150/0x160
[    1.575531]  ret_from_fork+0x10/0x20
[    1.582769] imx6q-pcie 33800000.pcie:      MEM 0x0018000000..0x001fefffff -> 0x0018000000
[    1.586502] Code: aa1a03e2 f94037e0 aa1803e1 97d12e90 (b8776ac1)
[    1.594766] imx6q-pcie 33800000.pcie: iATU unroll: enabled
[    1.597905] ---[ end trace 313013836732a124 ]---
[    1.601474] imx6q-pcie 33800000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    1.609652] Kernel panic - not syncing: Oops: Fatal exception
[    1.609655] SMP: stopping secondary CPUs
[    1.609964] Kernel Offset: disabled
[    1.609965] CPU features: 0x00002001,20000846
[    1.609969] Memory Limit: none
[    1.654286] Rebooting in 5 seconds..

To help us try answering this, can you please reproduce the issue and share the output of printenv from your U-Boot?

  • From what I understood, even if the module is rebooting, you are able to stop at U-Boot, right? If yes, you will be able to execute the command printenv, which will dump to the console all the current environment variables from your U-Boot. Please share with us this output.

Best regards,

Hi @henrique.tx ,

Yes, and please check the printenv output below:

Verdin iMX8MM # printenv
altbootcmd=env set rollback 1; run bootcmd
arch=arm
baudrate=115200
board=verdin-imx8mm
board_name=verdin-imx8mm
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_file=Image
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc0 dhcp
bootcmd=run m4boot; run bootcmd_mmc0
bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mfg=fastboot 0
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot
bootcount=1
bootdelay=1
bootfstype=ext4
bootlimit=3
console=ttymxc0
cpu=armv8
devplist=1
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethaddr=00:14:2d:6e:29:14
ethprime=FEC
fastboot_dev=mmc0
fdt_addr=0x43000000
fdt_addr_r=0x50200000
fdt_board=dev
fdtcontroladdr=bdf05880
fdtfile=imx8mm-verdin-wifi-dev.dtb
fileaddr=48200000
filesize=3d6c
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x48200000
kernel_comp_addr_r=0x40200000
kernel_comp_size=0x08000000
load_cmd=ext4load mmc 0:1
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x48200000
loadm4image=ext4load mmc 0:1 0x48200000 /ostree/deploy/torizon/var/igpio_led_output.bin
m4boot=ext4load mmc 0:1 0x48200000 /ostree/deploy/torizon/var/igpio_led_output.bin; cp.b 0x48200000 0x7e0000 15000; dcache flush; bootaux 0x7e0000
m4image=/ostree/deploy/torizon/var/igpio_led_output.bin
m4image_size=15000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=test -n ${fdtfile} || setenv fdtfile imx8mm-verdin-${variant}-${fdt_board}.dtb
ramdisk_addr_r=0x50300000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x50280000
serial#=07219476
serverip=192.168.10.1
setup=setenv setupargs console=tty1 console=${console},${baudrate} consoleblank=0 earlycon
soc=imx8m
soc_type=imx8mm
update_uboot=askenv confirm Did you load flash.bin (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x2 ${blkcnt}; fi
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
variant=wifi
vendor=toradex
ver=U-Boot 2022.04-6.2.0+git.0e1f11392251 (Jan 01 1970 - 00:00:00 +0000)

Environment size: 4779/8188 bytes
Verdin iMX8MM #

and, I used the command below to stop the loop.

Verdin iMX8MM # env default -a
## Resetting to default environment
Verdin iMX8MM # saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
Verdin iMX8MM # reset

It happens when I try to run it automatically,

Thank you so much for your time.

Best regards,
Mehrdad

Hi @Mehrdad,

Sorry for the delay here.

Can you please share which overlays are you using? They will be available on the overlays.txt file on the Linux side.

Best Regards,
Hiago.

Hi Hiago,

I really appreciate your response,

I used 2 overlays:

  • verdin-imx8mm_hmp_overlay.dts
  • verdin-imx8mm_spidev_overlay.dts

Best regards,
Mehrdad
verdin-imx8mm_hmp_overlay.dts (1.1 KB)
verdin-imx8mm_spidev_overlay.dts (683 Bytes)

Hi @Mehrdad,

Thanks for the reply, the overlays look correct. Can you please share with me which image did you install? Then I can try to reproduce the issue on my side as well.

Best Regards,
Hiago.

Hi Hiago,

I used torizon-core-docker-verdin-imx8mm-Tezi_6.2.0+build.2

Thank you so much for your time.

Best regards,
Mehrdad

Hi @Mehrdad,

I wasn’t able to reproduce on my side, I installed the same version of TorizonCore that you did, add the overlay that comes with the image to my overlays.txt file, and loaded my binary. Could you please share the commands you ran into u-boot or the objective that you want to achieve? Would you like the same binary to be loaded every time?

Best Regards,
Hiago.

Hi @hfranco.tx
I run the commands below:
the loading method with commands below:

setenv load_cmd “ext4load mmc 0:1”

setenv m4image “/ostree/deploy/torizon/var/hello_world.bin”

Or

setenv m4image “/ostree/deploy/torizon/var/igpio_led_output.bin”

setenv m4image_size 15000

setenv loadm4image “${load_cmd} ${loadaddr} ${m4image}”

setenv m4boot “${loadm4image}; cp.b ${loadaddr} 0x7e0000 ${m4image_size}; dcache flush; bootaux 0x7e0000”

saveenv

run m4boot

To run it automatically with the boot process, i.e. without need to repeat all the description, add the m4boot to the “bootcmd” alias. Do it by running:

setenv bootcmd “run m4boot; ${bootcmd}”

saveenv

reset

After this part, it goes to the infinite loop and just reset by itself.

please see the binary file:
hello_world.bin (6.1 KB)
igpio_led_output.bin (15.4 KB)

Best regards,
Mehrdad

Hi @Mehrdad,

I tested here on my side with your binaries and it also worked. I followed your steps and added the commands. The only difference is that I’ve increased the binary size, since it’s more than 15KB:

Verdin iMX8MM # printenv m4boot 
m4boot=ext4load mmc 0:1 0x48200000 /ostree/deploy/torizon/var/igpio_led_output.bin; cp.b 0x48200000 0x7e0000 18000; dcache flush; bootaux 0x7e0000
Verdin iMX8MM # printenv bootcmd
bootcmd=run m4boot; run bootcmd_mmc0

Could you also try to increase it?

Best Regards,
Hiago.

1 Like

Hi @hfranco.tx
I increased it to 18000 but still the same issues

Verdin iMX8MM # setenv load_cmd “ext4load mmc 0:1”
Verdin iMX8MM # setenv m4image “/ostree/deploy/torizon/var/hello_world.bin”
Verdin iMX8MM # setenv m4image_size 18000
Verdin iMX8MM # setenv loadm4image “${load_cmd} ${loadaddr} ${m4image}”
Verdin iMX8MM # setenv m4boot “${loadm4image}; cp.b ${loadaddr} 0x7e0000 ${m4image_size}; dcache flush; bootaux 0x7e0000”
Verdin iMX8MM # saveenv
Saving Environment to MMC… Writing to MMC(0)… OK
Verdin iMX8MM # run m4boot
6268 bytes read in 2 ms (3 MiB/s)
'## Starting auxiliary core stack = 0x20020000, pc = 0x1FFE030D…
Verdin iMX8MM # setenv bootcmd “run m4boot; ${bootcmd}”
Verdin iMX8MM # saveenv
Saving Environment to MMC… Writing to MMC(0)… OK
Verdin iMX8MM # reset
resetting …

Attached is a file with all the reptating loops
New Text Document.txt (25.4 KB)

Best regards,
Mehrdad

Hi @Mehrdad,

Can you please share with me the exact hardware you’re using? The full name with version, size of memory…

This is very strange, I can see a kernel panic on the remote proc driver, but I can’t reproduce it on my side. If you don’t launch the Cortex-M, does this error disappears?

Best Regards,
Hiago.

Hi @hfranco.tx

iMX8M Mini Quad 2GB Wi-Fi / Bluetooth IT with verdin development board and
RAM:2GB LPDDR4 (32-bit)

Flash:16GB eMMC

No, it doesn’t happen and it works well but when I try to run it automatically, this happens!

Best regards,
Mehrdad

Hi @hfranco.tx

I used a new SoM [imx8 mini] and installed TorizonCore 6
please see the command below it has the same issue.

U-Boot SPL 2022.04-6.2.0+git.0e1f11392251 (Jan 01 1970 - 00:00:00 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
WDT: Started watchdog@30280000 with servicing (60s timeout)
Trying to boot from MMC1
NOTICE: BL31: v2.6(release):lf_v2.6-g3c1583ba0a
NOTICE: BL31: Built : 00:00:00, Jan 1 1970

U-Boot 2022.04-6.2.0+git.0e1f11392251 (Jan 01 1970 - 00:00:00 +0000)

CPU: i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 57C
Reset cause: POR
DRAM: 2 GiB
Core: 114 devices, 21 uclasses, devicetree: separate
WDT: Started watchdog@30280000 with servicing (60s timeout)
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC… OK
In: serial
Out: serial
Err: serial
Model: Toradex 0055 Verdin iMX8M Mini Quad 2GB WB IT V1.1E
Serial#: 07201697
get_tdx_eeprom: cannot find EEPROM by node
MISSING TORADEX CARRIER CONFIG BLOCKS
get_tdx_eeprom: cannot find EEPROM by node
flash target is MMC:0
Net: eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
Verdin iMX8MM # setenv load_cmd ext4load mmc 0:1
Verdin iMX8MM # setenv m4image /ostree/deploy/torizon/var/hello_world.bin
Verdin iMX8MM # setenv m4image_size 15000
Verdin iMX8MM # setenv loadm4image ${load_cmd} ${loadaddr} ${m4image}
Verdin iMX8MM # setenv m4boot ${loadm4image}; cp.b ${loadaddr} 0x7e0000 ${m4image_size}; dcache flush; bootaux 0x7e0000

Starting auxiliary core stack = 0x00000000, pc = 0x00000000…

Verdin iMX8MM #
askenv base bdinfo blkcache boot bootaux bootcount bootd bootefi bootelf
booti bootm bootp bootvx cfgblock clk clocks cmp …
Verdin iMX8MM #
askenv base bdinfo blkcache boot bootaux bootcount bootd bootefi bootelf
booti bootm bootp bootvx cfgblock clk clocks cmp …
Verdin iMX8MM # saveenv Saving Environment to MMC… Writing to MMC(0)… OK
Verdin iMX8MM # run m4boot
6268 bytes read in 2 ms (3 MiB/s)
Verdin iMX8MM #
Verdin iMX8MM # run m4boot
6268 bytes read in 3 ms (2 MiB/s)
Verdin iMX8MM # setenv bootcmd run m4boot; ${bootcmd}
6268 bytes read in 2 ms (3 MiB/s)
Verdin iMX8MM # saveenv
Saving Environment to MMC… Writing to MMC(0)… OK
Verdin iMX8MM # reset
resetting …

U-Boot SPL 2022.04-6.2.0+git.0e1f11392251 (Jan 01 1970 - 00:00:00 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
WDT: Started watchdog@30280000 with servicing (60s timeout)
Trying to boot from MMC1
NOTICE: BL31: v2.6(release):lf_v2.6-g3c1583ba0a
NOTICE: BL31: Built : 00:00:00, Jan 1 1970

U-Boot 2022.04-6.2.0+git.0e1f11392251 (Jan 01 1970 - 00:00:00 +0000)

CPU: i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 56C
Reset cause: POR
DRAM: 2 GiB
Core: 114 devices, 21 uclasses, devicetree: separate
WDT: Started watchdog@30280000 with servicing (60s timeout)
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC… OK
In: serial
Out: serial
Err: serial
Model: Toradex 0055 Verdin iMX8M Mini Quad 2GB WB IT V1.1E
Serial#: 07201697
get_tdx_eeprom: cannot find EEPROM by node
MISSING TORADEX CARRIER CONFIG BLOCKS
get_tdx_eeprom: cannot find EEPROM by node
flash target is MMC:0
Net: eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
6268 bytes read in 2 ms (3 MiB/s)
Verdin iMX8MM #
Verdin iMX8MM #

Best regards,
Mehrdad

Hi @Mehrdad,

I understand what is happening now, the error is in this line:

It’s missing the double quotes here to create the command. The correct should be:

 Verdin iMX8MM # setenv m4boot "${loadm4image}; cp.b ${loadaddr} 0x7e0000 ${m4image_size}; dcache flush; bootaux 0x7e0000"

This is very important because, without the double quotes, u-boot thinks that each command stops at the “;” character and runs in the wrong way. Can you please try with the double quotes?

Best Regards,
Hiago.

Hi @Mehrdad ,

Hope you are doing well.

Is this issue solved?

Best Regards
Kevin