How to Configure watchdog on NXP imx8mp board.

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

How to Configure watchdog on NXP imx8mp board.

772 Views
krsuresh
Contributor III
Hi Team,
 
According to the reference below, I tried to enable the hardware watchdog, but I could not see the watchdog modules in lsmod/dmesg. Is this the correct way to enable and check the hardware watchdog? 
 
Note:  I see watchdog and watchdog0 in the /dev folder; is it a software watchdog or a hardware watchdog?
 
 
Following changes add in deconfig file,

CONFIG_IMX2_WDT=y
CONFIG_IMX_SC_WDT=y
CONFIG_HAVE_ARM_SMCCC=y
CONFIG_IMX_SCU=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y
CONFIG_WATCHDOG_OPEN_TIMEOUT=0 

I would appreciate your guidance on how to enable hardware watchdog and how to test it.
 
Thanks,
Sureshkumar R
Labels (1)
0 Kudos
Reply
2 Replies

679 Views
krsuresh
Contributor III

Hi @Zhiming_Liu,

 

Thanks for the reply, I am able to test the watchdog with wdt_driver_test.out.

 

Thanks,

Sureshkumar R

0 Kudos
Reply

728 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @krsuresh 

 

Default BSP has enabled the watchdog, and NXP provides test demo in BSP.

root@imx8mpevk:/unit_tests/Watchdog# ls
README  autorun-wdog.sh  dbg_monitor.sh  wdt_driver_test.out
root@imx8mpevk:/unit_tests/Watchdog# ./wdt_driver_test.out

---- Running < ./wdt_driver_test.out > test ----

Usage: wdt_driver_test <timeout> <sleep> <test>
    timeout: value in seconds to cause wdt timeout/reset
    sleep: value in seconds to service the wdt
    test: 0 - Service wdt with ioctl(), 1 - with write()

Source code:

https://github.com/nxp-imx/imx-test/blob/lf-5.15.32_2.0.0/test/wdog/wdt_driver_test.c

 

Test:

root@imx8mpevk:/unit_tests/Watchdog# ./wdt_driver_test.out 10 10 10

---- Running < ./wdt_driver_test.out > test ----

Starting wdt_driver (timeout: 10, sleep: 10, test: write)
Trying to set timeout value=10 seconds
The actual timeout was set to 10 seconds
Now reading back -- The timeout is 10 seconds

U-Boot SPL 2023.04-lf_v2023.04+g49b102d988 (Nov 21 2023 - 07:28:53 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
SEC0:  RNG instantiated
Normal Boot
Trying to boot from BOOTROM
Boot Stage: Primary boot
image offset 0x0, pagesize 0x200, ivt offset 0x0
NOTICE:  Do not release JR0 to NS as it can be used by HAB
NOTICE:  BL31: v2.8(release):android-14.0.0_1.0.0-rc1-1-g08e9d4eef
NOTICE:  BL31: Built : 06:43:30, Nov 21 2023


Best Regards
Zhiming

0 Kudos
Reply