iMX6ULL booting twice when iMX Watchdog is used during U-Boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6ULL booting twice when iMX Watchdog is used during U-Boot

750 Views
JorgeTX
Contributor I

Hello,

I am currently using the NXP watchdog in U-Boot to reset a iMX6ULL (enabled with CONFIG_IMX_WATCHDOG=y).
While the reset itself actually works, some strange behaviour is observed:
The CPU will boot once and, while the kernel is already booting, it will reboot once again.


This can be reproduced by simply executing the 'reset' command during U-Boot.
Checking the first boot, it displays WDOG as the reason for the first boot, but after rebooting during the kernel boot, the second one displays POR as the reboot reason.

This is what the output looks like:

 

Spoiler

U-Boot 2022.07-dirty (Mar 12 2024 - 14:43:07 +0100)

CPU: Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 33C
Reset cause: POR
Watchdog enabled
DRAM: 512 MiB
Core: 79 devices, 17 uclasses, devicetree: separate
NAND: 512 MiB
MMC: FSL_SDHC: 0
Loading Environment from NAND... OK
In: serial
Out: serial
Err: serial
Model: Toradex Colibri iMX6ULL 512MB Wi-Fi / Bluetooth V1.1A, Serial# 06903858
Net: eth0: ethernet@20b4000
Hit any key to stop autoboot: 0
Colibri iMX6ULL # reset
resetting ...

U-Boot 2022.07-dirty (Mar 12 2024 - 14:43:07 +0100)

CPU: Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 33C
Reset cause: WDOG
Watchdog enabled
DRAM: 512 MiB
Core: 79 devices, 17 uclasses, devicetree: separate
NAND: 512 MiB
MMC: FSL_SDHC: 0
Loading Environment from NAND... OK
In: serial
Out: serial
Err: serial
Model: Toradex Colibri iMX6ULL 512MB Wi-Fi / Bluetooth V1.1A, Serial# 06903858
Net: eth0: ethernet@20b4000
Hit any key to stop autoboot: 0
Booting from NAND...
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd5
ubi0: attached by fastmap
ubi0: fastmap pool size: 200
ubi0: fastmap WL pool size: 100
ubi0: attached mtd5 (name "ubi", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 184/92, WL threshold: 4096, image sequence number: 675810611
ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
No size specified -> Using max size (5753280)
Read 5753280 bytes from volume kernel to 81000000
No size specified -> Using max size (39757)
Read 39757 bytes from volume dtb to 82100000
Read 39757 bytes from volume dtb to 82100000
Kernel image @ 0x81000000 [ 0x000000 - 0x57c9c0 ]
## Flattened Device Tree blob at 82100000
Booting using the fdt blob at 0x82100000
Using Device Tree in place at 82100000, end 8210cb4c
Updating MTD partitions...

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.170-3.0.4+gbaa6c24240a4 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Apr 21 02:52:18 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Toradex Colibri iMX6ULL 512MB on Colibri Evaluation Board V3
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x98000000, size 128 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] percpu: Embedded 15 pages/cpu s30796 r8192 d22452 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: user_debug=30 ubi.mtd=ubi root=ubi0:rootfs rw rootfstype=ubifs ubi.fm_autoconvert=1 console=tty1 console=ttymxc0,115200n8 consoleblank=0 video=mxsfb:640x480M-16@60
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 375032K/524288K available (8192K kernel code, 507K rwdata, 2300K rodata, 1024K init, 384K bss, 18184K reserved, 131072K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xa0800000 - 0xff800000 (1520 MB)
[ 0.000000] lowmem : 0x80000000 - 0xa0000000 ( 512 MB)
[ 0.000000] modules : 0x7f000000 - 0x80000000 ( 16 MB)
[ 0.000000] .text : 0x80008000 - 0x80900000 (9184 kB)
[ 0.000000] .init : 0x80c00000 - 0x80d00000 (1024 kB)
[ 0.000000] .data : 0x80d00000 - 0x80d7eec0 ( 508 kB)
[ 0.000000] .bss : 0x80d80000 - 0x80de01d0 ( 385 kB)


(More kernel booting messages)


[ 1.756252] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[ 1.767366] hub 1-0:1.0: USB hub found
[ 1.775029] hub 1-0:1.0: 1 port detected
[ 1.793124] input: AD7879 Touchscreen as /devices/soc0/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-002c/input/input0
[ 1.817641] rtc-ds1307 0-0068: registered as rtc0
[ 1.828012] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc1
[ 1.838683] i2c /dev entries driver
[ 1.847548] IR NEC protocol handler initialized
[ 1.855945] IR RC5(x/sz) protocol handler initialized
[ 1.864877] IR RC6 protocol handler initialized
[ 1.873298] IR JVC protocol handler initialized
[ 1.881682] IR Sony protocol handler initialized
[ 1.890360] IR SANYO protocol handler initialized
[ 1.898883] IR Sharp protocol handler initialized
[ 1.907244] IR MCE Keyboard/mouse protocol handler initialized
[ 1.916767] IR XMP protocol handler initialized


U-Boot 2022.07-dirty (Mar 12 2024 - 14:43:07 +0100)

CPU: Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 33C
Reset cause: POR
Watchdog enabled
DRAM: 512 MiB
Core: 79 devices, 17 uclasses, devicetree: separate
NAND: 512 MiB
MMC: FSL_SDHC: 0
Loading Environment from NAND... OK
In: serial
Out: serial
Err: serial
Model: Toradex Colibri iMX6ULL 512MB Wi-Fi / Bluetooth V1.1A, Serial# 06903858
Net: eth0: ethernet@20b4000
Hit any key to stop autoboot: 0
Booting from NAND...
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd5
ubi0: attached by fastmap
ubi0: fastmap pool size: 200
ubi0: fastmap WL pool size: 100
ubi0: attached mtd5 (name "ubi", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 184/92, WL threshold: 4096, image sequence number: 675810611
ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
No size specified -> Using max size (5753280)
Read 5753280 bytes from volume kernel to 81000000
No size specified -> Using max size (39757)
Read 39757 bytes from volume dtb to 82100000
Kernel image @ 0x81000000 [ 0x000000 - 0x57c9c0 ]
## Flattened Device Tree blob at 82100000
Booting using the fdt blob at 0x82100000
Using Device Tree in place at 82100000, end 8210cb4c
Updating MTD partitions...

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.170-3.0.4+gbaa6c24240a4 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Apr 21 02:52:18 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Toradex Colibri iMX6ULL 512MB on Colibri Evaluation Board V3
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x98000000, size 128 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] percpu: Embedded 15 pages/cpu s30796 r8192 d22452 u61440
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 130048

 

Why does this second boot happen when the kernel has already booted?

Thanks!

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

735 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Dear @JorgeTX ,

 

Watchdog has been enabled in linux bsp, no need to enable it in u-boot.

Here is my test result on L6.1.55 bsp, default setting is 60s.

weidong_sun_0-1710900027630.png

 

Thanks!

Regards,

weidong

 

0 Kudos
Reply

725 Views
JorgeTX
Contributor I

Hi @weidong_sun,

thank you for your answer! I know that the watchdog is enabled in Linux BSP, and using it to reset the board will not double boot it.

However, I am having some problems during U-Boot, and I need to have the watchdog during this time in order to debug, which is why I am asking. Is there any explanation to why it does this double boot? 
Thanks!

0 Kudos
Reply