karo-electronics / karo-tx-uboot

U-Boot for TXCOM modules
GNU General Public License v2.0
6 stars 5 forks source link

Does not reboot after WDOG reset. #4

Open bamkrs opened 5 years ago

bamkrs commented 5 years ago

If the linux watchdog /etc/watchdog is used and the WDOG triggers an reset, uboot stops after unpacking the kernel - where it should load the DTB - and prints:

ERROR: Did not find a cmdline Flattened Device Tree

After powercycling, the device/uboot boots just fine.

lw-karo commented 5 years ago

Moin moin,

If the linux watchdog /etc/watchdog is used and the WDOG triggers an reset, uboot stops after unpacking the kernel - where it should load the DTB - and prints:

ERROR: Did not find a cmdline Flattened Device Tree

After powercycling, the device/uboot boots just fine.

see: U-Boot/sources/TX*/README: The following variables are automatically created by U-Boot under certain circumstances (these are unset otherwise and won't be created from the saved environment upon boot):
safeboot=1 signifies, that has been detected early during
boot and the above noted safety measures have been
taken.
wdreset=1 signifies, that the module has been booted due to a
watchdog reset. This can be used to change the booting
behaviour depending on the reset source.
You can use these variables in boot scripts e.g. to
select a fallback boot script when a watchdog reset
occured:
setenv bootcmd 'run run bootcmd_${boot_mode}${wdreset} bootm_cmd'
With the default setting of 'boot_mode=nand' this will run either the
commands stored in 'bootcmd_nand' if no watchdog reset happened or
'bootcmd_nand1' when a watchdog reset was detected.
Note: If a watchdog reset occured, a soft reset should be performed
before booting the actual OS, to make sure that the board is correctly
configured (PMIC, cpu_clk, splash image).

Lothar Waßmann --


Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Geschäftsführer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de


dargo600 commented 2 years ago

I have had seen this issue as well on the Sept 18th 2020 release of uboot for tx6 specifically the TX6U-8030 hardware. The reproduce scenario was have watchdog enabled in the kernel but with no daemon running. Then sudo touch /dev/watchdog0.

I would sometimes observe that it repeatedly attempts to reboot more than 3 times and then switches to the rescue partition. Sometimes it reboots so frequently and change the reboot cause from WDOG to POR. Though this doesn't always happen. I think when that happens the wdreset=1 uenv variable will no longer be set. bootcount will either be 3 or 4 because it reboots so many times after failing to find the flattened device tree.