Verdin Mini M4-UART4 Stops with Kernel Boot

Hello,

I am new to developing on an iMX8M Mini WB with Dahlia Carrier. I have an issue when following the “Heterogeneous Multi-core Processing (HMP) Documentation Overview > How to Run a Hello World on the Cortex-M” documentation. The UART4 port is accessible through the FTDI chip, and “Hello World” successfully streams when U-boot starts the firmware. However, after about two seconds, the debug messages stop streaming. The terminal is still connected. This occurs within a few milliseconds of the first Kernel boot message in the Cortex-A terminal “pca953x 3-0021: failed writing register” in the case shown below.

If I “Hit any key to stop autoboot:” and “run cm_boot”, the UART4 debug messages stream continuously without stopping. This is the desired behavior. I have been developing on the M4 for the last week with this workaround.

I attempted applying a few DT overlays to disable uart4, which had no effect.

In writing this post I tried installing Torizon OS 6.8.1 which RESOLVED this issue. I have confirmed that both Torizon OS 7 and Torizon OS 7 Easy Pairing produce this issue. I will use Torizon OS 6 for now, but want to raise this potential bug as I have found no other threads on this topic.

System Info:

torizon@verdin-imx8mm-15005684:~$ sudo tdx-info
Password: 

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.54-7.1.0-g3493ccd66900 #1-Torizon SMP PREEMPT Tue Dec 17 21:04:41 UTC 2024
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.0/torizon/28c6117959abbf7185a98daaa9ef3bef7020fdd7ea6dbaa0701fc0e45f2a38a2/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.1.0-build.4
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mm-15005684
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Mini WB on Verdin Development Board
Toradex version:          0055 V1.1F
Serial number:            15005684
Processor arch:           aarch64
------------------------------------------------------------

Here is the Cortex-A boot output streamed on ttyUSB3:

U-Boot 2024.07-7.1.0+git.3f772959501c (Jan 01 1970 - 00:00:00 +0000)

CPU:   Freescale i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 44C
Reset cause: POR
DRAM:  2 GiB
Core:  149 devices, 25 uclasses, devicetree: separate
WDT:   Started watchdog@30280000 with servicing every 1000ms (60s timeout)
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... Reading from MMC(0)... OK
In:    serial@30860000
Out:   serial@30860000
Err:   serial@30860000
Model: Toradex 0055 Verdin iMX8M Mini Quad 2GB WB IT V1.1F
Serial#: 15005684
Carrier: Toradex Dahlia V1.1D, Serial# 11469223
Net:   eth0: ethernet@30be0000 [PRIME]
Hit any key to stop autoboot:  0 
16216 bytes read in 3 ms (5.2 MiB/s)
## No elf image at address 0x007e0000
## Starting auxiliary core stack = 0x20020000, pc = 0x1FFE0379...
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
969 bytes read in 1 ms (946.3 KiB/s)
## Executing script at 50280000
7638 bytes read in 3 ms (2.4 MiB/s)
66891 bytes read in 4 ms (15.9 MiB/s)
86 bytes read in 3 ms (27.3 KiB/s)
Working FDT set to 50200000
Applying Overlay: verdin-imx8mm_dsi-to-hdmi_overlay.dtbo
2804 bytes read in 3 ms (912.1 KiB/s)
Applying Overlay: verdin-imx8mm_spidev_overlay.dtbo
561 bytes read in 3 ms (182.6 KiB/s)
11342096 bytes read in 68 ms (159.1 MiB/s)
13127165 bytes read in 79 ms (158.5 MiB/s)
   Uncompressing Kernel Image to 0
## Flattened Device Tree blob at 50200000
   Booting using the fdt blob at 0x50200000
Working FDT set to 50200000
   Loading Device Tree to 00000000bcec2000, end 00000000bcef5fff ... OK
Working FDT set to bcec2000

Starting kernel ...

[    1.106529] pca953x 3-0021: failed writing register
[    1.577346] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e10000 to encoder DSI-34: -517
[    1.589117] imx_sec_dsim_drv 32e10000.mipi_dsi: Failed to attach bridge: 32e10000.mipi_dsi
[    1.597550] imx_sec_dsim_drv 32e10000.mipi_dsi: failed to bind sec dsim bridge: -517
Starting systemd-udevd version 255.13^
sysroot.readonly configuration value: 0 (fs writable: 1)
Using legacy ostree bind mount for /

Torizon OS 7.1.0+build.4 verdin-imx8mm-15005684 ttymxc0

The M4 debug messages on UART4 (ttyUSB2) stop within a few milliseconds of the message “pca953x 3-0021: failed writing register”. Here is the journal around that time:

Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: M4 is started
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mxs-dma 33000000.dma-controller: initialized
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: SoC: i.MX8MM revision 1.0
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Bus freq driver module loaded
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 15, base_baud = 1500000) is a IMX
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: imx-uart 30860000.serial: Console IMX rounded baud rate from 114286 to 114300
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: printk: console [ttymxc0] enabled
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 16, base_baud = 1500000) is a IMX
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 17, base_baud = 1500000) is a IMX
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: brd: module loaded
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: loop: module loaded
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: zram: Added device: zram0
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: usbcore: registered new interface driver usb-storage
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: usbcore: registered new interface driver usbserial_generic
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: usbserial: USB Serial support registered for generic
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: input: 30370000.snvs:snvs-powerkey as /devices/platform/soc@0/30000000.bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input0
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c_dev: i2c /dev entries driver
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: sdhci: Secure Digital Host Controller Interface driver
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: sdhci: Copyright(c) Pierre Ossman
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: sdhci-pltfm: SDHCI platform and OF driver helper
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: ledtrig-cpu: registered to indicate activity on CPUs
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: Entropy delay = 3200
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: Entropy delay = 3600
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: Instantiated RNG4 SH0
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: Instantiated RNG4 SH1
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: device ID = 0x0a16040100000000 (Era 9)
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: job rings = 2, qi = 0
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam algorithms registered in /proc/crypto
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: caam pkc algorithms registered in /proc/crypto
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: rng crypto API alg registered prng-caam
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: caam 30900000.crypto: registering rng-caam
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Device caam-keygen registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: hid: raw HID events driver (C) Jiri Kosina
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: usbcore: registered new interface driver usbhid
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: usbhid: USB HID core driver
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel:  cs_system_cfg: CoreSight Configuration manager initialised
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: platform soc@0: Fixed dependency cycle(s) with /soc@0/bus@30000000/efuse@30350000
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: hantrodec 0 : module inserted. Major = 240
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: hantrodec 1 : module inserted. Major = 240
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: hx280enc: module inserted. Major <239>
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: random: crng init done
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: usbcore: registered new interface driver snd-usb-audio
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: NET: Registered PF_INET6 protocol family
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Segment Routing with IPv6
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: In-situ OAM (IOAM) with IPv6
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: NET: Registered PF_PACKET protocol family
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Key type dns_resolver registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: NET: Registered PF_VSOCK protocol family
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: registered taskstats version 1
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Loading compiled-in X.509 certificates
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Key type .fscrypt registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: Key type fscrypt-provisioning registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mmc0: new HS400 Enhanced strobe MMC card at address 0001
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mmcblk0: mmc0:0001 IB2916 14.6 GiB
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel:  mmcblk0: p1
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mmcblk0boot0: mmc0:0001 IB2916 4.00 MiB
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mmcblk0boot1: mmc0:0001 IB2916 4.00 MiB
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: mmcblk0rpmb: mmc0:0001 IB2916 4.00 MiB, chardev (242:0)
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation.
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation.
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation.
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: reg-fixed-voltage regulator-dsi-hdmi: nonexclusive access to GPIO for (null)
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-0: using pinctrl states for GPIO recovery
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: rtc-ds1307 0-0032: oscillator failed, set time!
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: rtc-ds1307 0-0032: registered as rtc0
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: rtc-ds1307 0-0032: hctosys: unable to read the hardware clock
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: On-module +V0.8_SNVS (LDO2): Bringing 850000uV into 800000-800000uV
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: at24 0-0050: supply vcc not found, using dummy regulator
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: at24 0-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-0: IMX I2C adapter registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-1: using pinctrl states for GPIO recovery
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-1: IMX I2C adapter registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-2: using pinctrl states for GPIO recovery
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-2: IMX I2C adapter registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: nxp-pca9450 0-0025: pca9450a probed.
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-3: using pinctrl states for GPIO recovery
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: pca953x 3-0021: using no AI
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: pca953x 3-0021: failed writing register
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: platform hdmi-connector: Fixed dependency cycle(s) with /soc@0/bus@30800000/i2c@30a50000/hdmi@48
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: platform 32e10000.mipi_dsi: Fixed dependency cycle(s) with /soc@0/bus@30800000/i2c@30a50000/hdmi@48
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c 3-0048: Fixed dependency cycle(s) with /soc@0/bus@32c00000/mipi_dsi@32e10000
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c 3-0048: Fixed dependency cycle(s) with /hdmi-connector
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: at24 3-0050: supply vcc not found, using dummy regulator
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: at24 3-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: at24 3-0057: supply vcc not found, using dummy regulator
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: at24 3-0057: 256 byte 24c02 EEPROM, writable, 16 bytes/write
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: i2c i2c-3: IMX I2C adapter registered
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 2 mkt segment 2 supported-hw 0x4 0x4
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: sdhci-esdhc-imx 30b50000.mmc: Got CD GPIO
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: input: gpio-keys as /devices/platform/gpio-keys/input/input1
Oct 09 15:18:13 verdin-imx8mm-15005684 kernel: clk: Disabling unused clocks

To reiterate, this issue does not occur when using Torizon OS 6 rather than 7.

Thank you!

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!

For the Verdin iMX8M Mini, you don’t need device tree overlays to run the hello world demo application. However, for accessing UART in Torizon OS containers, you need to ensure the UART device is properly mapped.

For both the Verdin iMX8M Mini and Plus, you should:

  1. Connect the USB debug port (X18 on the Dahlia board) to your computer.
  2. Access ttyUSB2 for the Cortex-M4 UART and ttyUSB3 for the U-Boot/Linux Kernel terminal.

To add the UART device to your container in Torizon OS, you can use the following methods:

Using Docker run:

# docker run --rm -it --device /dev/verdin-uart1 torizon/debian:$CT_TAG_DEBIAN

Using Docker Compose:

devices:
  - "/dev/verdin-uart1:/dev/verdin-uart1"

Since you mentioned that this setup works in Torizon OS 6.x but not in 7.x, you might consider continuing with Torizon OS 6.x as a temporary workaround. Additionally, if you need to use a device tree overlay for UART4, you can disable it as shown below:

/dts-v1/;
/plugin/;

{
    compatible = "toradex,verdin-imx8mp-wifi-dahlia",
                 "toradex,verdin-imx8mp-wifi", 
                 "toradex,verdin-imx8mp",
                 "fsl,imx8mp";
};

/* Verdin UART_4 */
/* Used by the M7 and then should not be enabled here. */
&uart4 {
    status = "disabled";
};

I hope this helps you resolve the issue. If you have any more questions, feel free to ask!

Best regards,
Toradex AI Assistant

Hi Charles,
We have elevated this issue to R&D team and will notify here when we have resolutions.
Thank you,

Michael Park
Toradex

Apologies for the long delay. I’ve recently received a response from our R&D team:

Hi, the bad commit is 4f6c9832613b421e56bad2f9e4e2767e43e1f97c (“genpd: imx: scu-pd: initialize is_off according to HW state”), introduced by NXP on kernel 6.6.
Reverting this commit solves the issue (tested in our BSP only).

If this is urgent, for now a revert should fix the issue, if not it is better to wait a bit to check if this is the proper solution and, once its fixed, the customer can download our nightly or take the kernel patch. I have some ideas about the reason of this issue and why reverting solves it, but I am not 100% sure, therefore I posted a regression into the mailing list_[REGRESSION] Kernel reboots unexpectdely on i.MX8X when Cortex-M4 is running and it was started by U-Boot bootaux_ and I am waiting for feedback.

Alexander Samutin
Toradex