Watchdog timer does not restart the system.

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

Watchdog timer does not restart the system.

17,031 Views
natile
Contributor I

When touching/opening the file /dev/watchdog for activate the timer , I get the folowing line instead of system restart:

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

what is this mean ?

The watchdog mechanism out of it works well and if i kick the timer i dong get this message, but if not - its display in the console instead of the restart as i expect.

I work on development kit var-som-mx6 quad  kernel version 3.10.53 based on yocto daisy. please let me know if you need more details.

Nati

Labels (4)
0 Kudos
20 Replies

7,284 Views
1282497337
Contributor II

hi ,community

when I use the 3.14.52(kernel), imx6D7CVT08AD use the watchdog 2 to reset the system , I encounter the same issue,

the hardware : the net WDOG_B connected to GPIO_1

nxpwdog.png

the issue discription:

   1#:  execute ./wdt_driver_test.out 1 2 0,the system is not reset,but I got the messige line : 

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog,

so then I execute ./memtool -16 0x20c0000=0x34 ,the same messige print.

   2#: I modified the dts 

file pathname :***/dts/imx6qdl.dtsi

wdog1: wdog@020bc000 {
compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
reg = <0x020bc000 0x4000>;
interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6QDL_CLK_DUMMY>;
};

wdog2: wdog@020c0000 {
compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
reg = <0x020c0000 0x4000>;
interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6QDL_CLK_DUMMY>;
status = "disabled";
};

file pathname :***/dts/imx6qdl-sabresd.dtsi

&wdog1 {
status = "ok";
};

&wdog2 {
status = "disable";
};

so make the dtb and download ,then execute ./wdt_driver_test.out 1 2 0,and ./memtool -16 0x20bc000=0x34 ,is work ,the system restart,

question :

1. the WDOG1&2 used same driver so they have some difference ?

2. I connect the WDOG1 to any PMIC pin why its can restart the system ?

3. I want to use the WDOG2 to restart the system ,could you tell me how to do this .

thanks!!!

Alee

0 Kudos

7,307 Views
veeranjaneyulug
Contributor III

Hello Tan,

Can you check your watchdog timer in u-boot and kernel level Watchdog timer is ON or OFF .which watchdog timer you are using?.Two watchdog timers is there.

Thanks & Regards

veeranjaneyulu

0 Kudos

7,307 Views
letan
Contributor III

u-boot & kernel are using wdog 2

0 Kudos

7,307 Views
veeranjaneyulug
Contributor III

HI Tan,

Have you configured in u-boot/kernel.

0 Kudos

7,307 Views
letan
Contributor III

Hello Nati,

Did you solve the issue? I encounter the same issue. Could you please let me know on this?

0 Kudos

7,307 Views
BiyongSUN
NXP Employee
NXP Employee

Please try to test in the uboot and linux by setting the register directly.

It can iosolate the software issue.

And which watch dog you are using? watch dog 1?

Uboot:

mw.w 0x20bc000 0x34

Linux:

/unit_tests/memtool -16 0x20bc000=0x34

7,307 Views
sachinrohit
Contributor I

the following is the output for linux (/unit_tests/memtool -16 0x20bc000=0x34) .

root@varsomimx6:~# /unit_tests/memtool -16 0x20bc000=0x34

Writing 16-bit value 0x34 to address 0x020BC000

root@varsomimx6:~#

U-Boot SPL 2013.10 (Aug 27 2015 - 12:00:59)

i.MX6Q SOC P-POP DDR EEPROM configuration

Part number:

Assembly:

Date of production:

Ram size 1024

Boot Device : MMC1

Load image from RAW...

U-Boot 2013.10 (Aug 27 2015 - 12:00:59)

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz

CPU:   Temperature 42 C, calibration data: 0x59a50969

Reset cause: WDOG

Board: Variscite VAR_SOM_MX6 Quad-POP

I2C:   ready

DRAM:  1 GiB

Found PFUZE100! deviceid=10,revid=21

Set POP Voltage

MMC:   FSL_SDHC: 0, FSL_SDHC: 1

*** Warning - bad CRC, using default environment

In:    serial

Out:   serial

Err:   serial

Board: Variscite VAR_SOM_MX6 Quad-POP

Net:   using phy at 7

got MAC-1 address from fuse: f8:dc:7a:04:5a:63

FEC [PRIME]

Hit any key to stop autoboot:  0

mmc0 is current device

reading boot.scr

** Unable to read file boot.scr **

reading uImage

5794040 bytes read in 270 ms (20.5 MiB/s)

Booting from mmc ...

reading imx6q-var-dart.dtb

42080 bytes read in 18 ms (2.2 MiB/s)

## Booting kernel from Legacy Image at 12000000 ...

   Image Name:   Linux-3.14.28-1.1.0.2+ga675c193

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    5793976 Bytes = 5.5 MiB

   Load Address: 10008000

   Entry Point:  10008000

   Verifying Checksum ... OK

## Flattened Device Tree blob at 18000000

   Booting using the fdt blob at 0x18000000

   Loading Kernel Image ... OK

   Using Device Tree in place at 18000000, end 1800d45f

switched to ldo_bypass mode!

Starting kernel ...

It does not proceed further. I had to manually switch off and switch it on back.

In dmesg I see the following output.

dmesg | grep dog

[    1.834178] imx2-wdt 20c0000.wdog: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=0)

Even Uboot fix also does not work.

Please suggest some solution for this.

0 Kudos

7,306 Views
BiyongSUN
NXP Employee
NXP Employee

#1  make sure the power cycle has no such issue

#2  SRS bit and related hardware design to make sure the pmic is reset by watch dog reset.

#3 measure the power supply when hang. please make sure the pimc supply is at the initial status at the reset. and uboot is set the ldo by pass or ldo enable for linux kernel.

0 Kudos

7,306 Views
sachinrohit
Contributor I

Hard reboot has no such issues. Hitting hardware reset button is OK - restarts normally.  Only software reset is not functioning.

0 Kudos

7,306 Views
BiyongSUN
NXP Employee
NXP Employee

#2  SRS bit and related hardware design to make sure the pmic is reset by watch dog reset.

#3 measure the power supply when hang. please make sure the pimc supply is at the initial status at the reset. and uboot is set the ldo by pass or ldo enable for linux kernel

0 Kudos

7,307 Views
sachinrohit
Contributor I

#2  SRS bit and related hardware design to make sure the pmic is reset by watch dog reset.  -- this is ok, watchdog starts rebooting. but it hangs at "Starting kernel .. " line. Not sure why this is happening. I can see in logs that reboot is caused by watchdog.

BTW, ldo by pass mode is enabled in my image.

could you please  elaborate #3? I'm not sure how to do this on Variscite board.

Thanks for the help!

Edit: I managed to check the voltage , its consistently 3.7 before and after .  Anything else i should check for?

Edit 2 : I finally made this work with changes from this commit -- Based on: · varigit/uboot-imx@290eb91 · GitHub and this -- Fix stability issue at 1.2Ghz Quad core MX6 · varigit/linux-2.6-imx@da1da60 · GitHub

thank you all for your time and help.

0 Kudos

7,307 Views
BiyongSUN
NXP Employee
NXP Employee

WDOG1_RESET_B_DEB is the watch dog to tell outside usually pimc the system will reset.

The pmic will receive the signal and get reset as well.

You can see that hardware design in the reference design.

And that is why I ask you to check the power supply when issue is happening.

ldo bypass could not be used in the 1.2G part.

void ldo_mode_set(int ldo_bypass)
{
unsigned char value;
int is_400M;
unsigned char vddarm;

/* increase VDDARM/VDDSOC to support 1.2G chip */
if (check_1_2G()) {
  ldo_bypass = 0; /* ldo_enable on 1.2G chip */
  printf("1.2G chip, increase VDDARM_IN/VDDSOC_IN\n");
  /* increase VDDARM to 1.425V */
  if (i2c_read(0x8, 0x20, 1, &value, 1)) {
   printf("Read SW1AB error!\n");
   return;
  }
  value &= ~0x3f;
  value |= 0x2d;
  if (i2c_write(0x8, 0x20, 1, &value, 1)) {
   printf("Set SW1AB error!\n");
   return;

0 Kudos

7,307 Views
Yuri
NXP Employee
NXP Employee

You may check the WDOG using the test in /unit_tests directory of i.MX6 demo image(s).

/unit_tests# ./wdt_driver_test.out

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()

Also, You may to look to test sources on the host Linux :

/fsl-release-bsp/tmp/work/-poky-linux-gnueabi/imx-test/

Inside each test’s directory you will find the available documentation.

I hope this information helps.

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

7,307 Views
letan
Contributor III

Hi Yuri,

I have got a custom board with i.MX6 Dual. I am encountering the watchdog issue when run ./wdt_driver_test.out 1 2 0

Below is the error logs:

nvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

snvs-secvio 20cc000.caam-snvs: Unhandled Security Violation Interrupt 2 = Watchdog

Could you please help me on this?

0 Kudos

7,307 Views
sachinrohit
Contributor I

Hi Yuri Muhin,

I have got a custom Board with IMX6 ( VARiSCITE VAR-DT6 Custom Board V1.1 ). I am facing very same issue, the watchdog does not restart the system.

My Board details :

uname -r : Linux varsomimx6 3.14.28-1.1.0+gafadf35 #1 SMP PREEMPT Wed Oct 7 05:37:03 PDT 2015 armv7l GNU/Linux

Image built by following these instructions - VAR-SOM-MX6 Yocto Dizzy R1 - Variscite Wiki

dmesg | grep wdt : [    1.834142] imx2-wdt 20c0000.wdog: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=0)

I had tested the unit_test which you mentioned, the following is the output from them. I have tried both ways of testing ( writing and ioctl , result is same )

root@varsomimx6:/unit_tests# ./wdt_driver_test.out  5 0 1

correct 0 or negative sleep time to 1 seconds

Starting wdt_driver (timeout: 5, sleep: 1, test: write)

Trying to set timeout value=5 seconds

The actual timeout was set to 5 seconds

Now reading back -- The timeout is 5 seconds

^Z

[1]+  Stopped(SIGTSTP)        ./wdt_driver_test.out 5 0 1

root@varsomimx6:/unit_tests#

root@varsomimx6:/unit_tests# kill -9 806

root@varsomimx6:/unit_tests# imx2-wdt 20c0000.wdog: Unexpected close: Expect reboot!

you see, I waited for more than two minutes, but nothing happened? I had to kill the process myself. Even after killing, the driver tell that it is going to try a Reboot ( which again does not get fired ).

Is it not the problem with inbuilt watchdog itself? Please explain how to run this unit test successfully.

is there any build that i can straightway download and use?

Regards,

Sachin

0 Kudos

7,307 Views
Yuri
NXP Employee
NXP Employee

Hello,

   please check if the WDOG is enabled in Your system, using descriptions

in Watchdog (WDOG) Driver chapter of the i.MX Linux ref. manual.

Regards,
Yuri.

0 Kudos

7,307 Views
sachinrohit
Contributor I

Hello Yuri,

Thank you for prompt response.

I think the watchdog is by default enabled. This is what I found in dmesg

              [    1.834126] imx2-wdt 20c0000.wdog: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=0)

When I execute  echo s > /dev/watchdog , there is a dmesg shown as [14882.239457] imx2-wdt 20c0000.wdog: Unexpected close: Expect reboot! but nothing happens !!

Am I missing anything?

If watchdog is not enabled, then how do I enable it? In the Manual, under WatchDog (WDOG), it is not mentioned anywhere how to activate. It assumes, the watchdog is already enabled. [ from Manual Watchdog (WDOG) Driver The Watchdog Timer module protects against system failures by providing an escape from unexpected hang or infinite loop situations or programming errors. Some platforms may have two WDOG modules with one of them having interrupt capability. 34.1 Hardware Operation Once the WDOG timer is activated, it must be serviced by software on a periodic basis. If servicing does not take place in time, the WDOG times out. ]

I have also tried a simple program  with basic logic , which should reboot system.

int fd = open("/dev/watchdog", O_WRONLY);

  int ret = 0;

  if (fd == -1) {

  perror("watchdog");

  exit(EXIT_FAILURE);

  }

Please help us with this...

Regards,

Sachin

0 Kudos

7,307 Views
nagendrasarma
Contributor III

hi all

i am having same issue

could you  please help me ?

my case the watchdog is not reseting the system, i have added delay of 700ms before assert reset in the file  "arch/arm/mach-imx/system.c"

now  i observed strange behavior, the system is rebooting till u-boot and then kernel start will hang...

this  problem is with 3.10.17 3.0.35 is working fine

regards

nagendra

0 Kudos

7,307 Views
sachinrohit
Contributor I

Hi Nagendra,

can you please share instructions on how to build 3.0.35 ? ( since it is working ).  I'm using  3.14.28-1.1.0+ga675c193 and still have problem.

Regards,

Sachin

0 Kudos

7,308 Views
natile
Contributor I

Hi

I try this program from the unit_tests directory, it gives me the same result.

Also in the documentation I cant find anything related to that issue.

The watchdog mecanism himself working ok excepts this restart problem.

0 Kudos