This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6422: How to configure RTI watchdog expire to reset system

Part Number: AM6422

Hi TI experts,

We are using AM6422 customized board, and want to enable the RTI watchdog expire to reset the system.

I found some similar topic here  

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1255711/am62a7-watchdog-timer-timeout-events-route-to-esm/4813969?tisearch=e2e-sitesearch&keymatch=RTI%252520watchdog%252520ESM#4813969

And followed the guide to patch the ESM initialization in R5 SPL. Below are the patch contents,

in r5 dts,

&cbass_main {
	main_esm: esm@420000 {
		compatible = "ti,j721e-esm";
		reg = <0x0 0x420000 0x0 0x1000>;
		ti,esm-pins = <160>, <161>;
		u-boot,dm-spl;
	};
};
&cbass_mcu {
	u-boot,dm-spl;
	mcu_esm: esm@4100000 {
		compatible = "ti,j721e-esm";
		reg = <0x0 0x4100000 0x0 0x1000>;
		ti,esm-pins = <0>, <1>;
		u-boot,dm-spl;
	};
};

In r5 config,

CONFIG_ESM_K3=y

And the am642_init.c has the same patch content, not list here. 

Then, used the same steps as am64_8.2_wdt_esm_uboot_1.txt to do the test, but under uboot still can not reset the system. 

Below is the details under uboot:

U-Boot SPL 2021.01-g09c541cd6e (Nov 09 2023 - 09:12:54 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
SPL initial stack usage: 13376 bytes
Trying to boot from SPI
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.6(release):v2.6-873-g6541aa24f-dirty
NOTICE:  BL31: Built : 14:08:19, May  3 2022

U-Boot SPL 2021.01-g09c541cd6e (Nov 09 2023 - 09:12:54 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
Trying to boot from SPI
env_buf [32 bytes] too small for value of "mtdids"
## Checking hash(es) for Image uboot ... crc32+ OK
## Checking hash(es) for Image fdt-1 ... crc32+ OK


U-Boot 2021.01-g09c541cd6e (Nov 09 2023 - 09:12:54 +0000)

SoC:   AM64X SRUnknown Revision
DRAM:  xx MiB
Loading Environment from SPIFlash... cadence_spi spi@fc40000: Can't get reset: -2
SF: Detected xx with page size xx Bytes, erase size xx KiB, total xx MiB
OK
In:    serial
Out:   serial
Err:   serial
am65_cpsw_nuss ethernet@8000000: K3 CPSW: nuss_ver: xx cpsw_ver: xx ale_ver: xx Ports:2 mdio_freq:xx
Net:   
Warning: ethernet@8000000port@2 MAC addresses don't match:
Address in ROM is               xxxx
Address in environment is       xxxx
eth1: ethernet@8000000port@2
SF: Detected xx with page size xx Bytes, erase size xx KiB, total xx MiB
Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done
OK
Hit any key to stop autoboot:  0 
=> 
=> md.l 0x43018170 3
43018170: 000200ff 00000000 00000000             ............
=> md.l 0x04518170 3
04518170: 00020fff 00000001 00000000             ............
=> mw.l 0x4518170 0xfff 0x1
=> md.l 0x04518170 3       
04518170: 00000fff 00000001 00000000             ............
=> md.l 0xe000000 0x40
0e000000: 00000000 00000000 00000000 00000000    ................
0e000010: 00000000 00000000 00000000 00000000    ................
0e000020: 00000000 00000000 00000000 00000000    ................
0e000030: 00000000 00000000 00000000 00000000    ................
0e000040: 00000000 00000000 00000000 00000000    ................
0e000050: 00000000 00000000 00000000 00000000    ................
0e000060: 00000000 00000000 00000000 00000000    ................
0e000070: 00000000 00000000 00000000 00000000    ................
0e000080: 00000000 00000000 00000000 00000000    ................
0e000090: 5312aced 00000fff 00000000 0000a35c    ...S........\...
0e0000a0: 01ffffff 00000005 00000005 05050505    ................
0e0000b0: 00000000 00000000 00000000 00000000    ................
0e0000c0: 00000000 00000000 00000000 00000000    ................
0e0000d0: 00000000 00000000 00000000 00000000    ................
0e0000e0: 00000000 00000000 00000000 00000000    ................
0e0000f0: 00000000 00000000 00000000 00000000    ................
=> <INTERRUPT>
=> 
=> mw.l 0xe0000a4 0xa 1
=> mw.l 0xe000090 0xA98559DA 1
=> <INTERRUPT>
=> 
=> md.l 0xe000000 0x40
0e000000: 00000000 00000000 00000000 00000000    ................
0e000010: 00000000 00000000 00000000 00000000    ................
0e000020: 00000000 00000000 00000000 00000000    ................
0e000030: 00000000 00000000 00000000 00000000    ................
0e000040: 00000000 00000000 00000000 00000000    ................
0e000050: 00000000 00000000 00000000 00000000    ................
0e000060: 00000000 00000000 00000000 00000000    ................
0e000070: 00000000 00000000 00000000 00000000    ................
0e000080: 00000000 00000000 00000000 00000000    ................
0e000090: a98559da 00000fff 00000032 0000a35c    .Y......2...\...
0e0000a0: 01ac8cec 0000000a 00000005 05050505    ................
0e0000b0: 00000000 00000000 00000000 00000000    ................
0e0000c0: 00000000 00000000 00000000 00000000    ................
0e0000d0: 00000000 00000000 00000000 00000000    ................
0e0000e0: 00000000 00000000 00000000 00000000    ................
0e0000f0: 00000000 00000000 00000000 00000000    ................
=> <INTERRUPT>

It seems ESM module has some issue. Because when check the 0x4518170 after uboot startup, it's not 0xfff. I changed it to 0xfff manually.

Is there any wrong in my debug steps?

Best Regards

xixiguohx