Watchdog errors with linux4sam 3.6.9 kernel

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

bevenson
Posts: 75
Joined: Fri Oct 28, 2011 7:25 pm

Watchdog errors with linux4sam 3.6.9 kernel

Mon Jun 17, 2013 9:43 pm

I'm using the http://www.github.com/linux4sam/linux-at91.git kernel on branch linux-3.6.9-at91 and I am having problems with the watchdog. I modified the device tree files to add the watchdog, and the watchdog is device is present. However, writing to the watchdog produces this error:

Code: Select all

root@at91sam9x5ek:~# echo "0" > /dev/watchdog                                       
watchdog watchdog0: watchdog did not stop!
I found a patch for the mainline kernel (located here: http://permalink.gmane.org/gmane.linux.kernel/1471610) that sounded like it solved a similar problem but it didn't help. Anyone able to get the watchdog working with this kernel?
gonewithwind
Posts: 30
Joined: Sat May 11, 2013 3:35 am

Re: Watchdog errors with linux4sam 3.6.9 kernel

Tue Jun 18, 2013 5:43 pm

my kernel 3.6.9 watchdog works for sama5d35-ek board. I did not change anything in kernel and dtb. I downloaded the kernel at the same address as yours


Maybe you need enable watchdog in bootstrap code: here:

void hw_init(void)
{
/* Disable watchdog */
- at91_disable_wdt();
+ //at91_disable_wdt(); /* enable wdt */

/* At this stage the main oscillator is supposed to be enabled PCK = MCK = MOSC */
writel(0x00, AT91C_BASE_PMC + PMC_PLLICPR);
bevenson
Posts: 75
Joined: Fri Oct 28, 2011 7:25 pm

Re: Watchdog errors with linux4sam 3.6.9 kernel

Tue Jun 18, 2013 6:18 pm

That's odd. I did enable the watchdog in the AT91Bootstrap and in U-Boot. I am also seeing this in the boot log:

Code: Select all

at91sam9_wdt: enabled (heartbeat=15 sec, nowayout=0)
which I believe only gets printed if the kernel can enable the watchdog. And from looking at the device tree bindings for the sama5d35, it looks like its using the same watchdog driver settings as the SAM9G25. I'll take out the patch I referred to just to confirm that the watchdog still doesn't work for me.

Just to confirm we are at the same spot, here is the last commit I see on my working copy (result of "git log -1"):

Code: Select all

commit 5fe012d4aee98ef82df66e6763882c735902ed0f
Author: Wenyou Yang <wenyou.yang@atmel.com>
Date:   Thu May 9 13:14:59 2013 +0800

    Change internal SRAM memory type to "MT_MEMORY_SO"
    
    Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Is that what you see as the last commit for your kernel?

Thanks,
Bryan
gonewithwind
Posts: 30
Joined: Sat May 11, 2013 3:35 am

Re: Watchdog errors with linux4sam 3.6.9 kernel

Tue Jun 18, 2013 7:04 pm

I am sorry. I changed my kernel to openwrt. I deleted the git( I use cvs). I do not know version. I downloaded about 5 month ago.

the newest version I downloaded is :

git log -1
commit e468857d8b27e37de7c2dfa868f8c05239c6f7ee
Author: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Date: Mon Apr 29 18:14:08 2013 +0200

Input: atmel_tsadcc: fix compilation as a module

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
bevenson
Posts: 75
Joined: Fri Oct 28, 2011 7:25 pm

Re: Watchdog errors with linux4sam 3.6.9 kernel

Tue Jun 18, 2013 8:26 pm

There is one minor, unrelated commit that occurs with the kernel that I have. So as far as the watchdog is concerned, we're running the same thing. Odd why it isn't working on my end.

Anyone else having a similar experience with the sam9x5 chip series?
AntoineC
Posts: 105
Joined: Wed Oct 03, 2012 11:33 am

Re: Watchdog errors with linux4sam 3.6.9 kernel

Wed Jun 19, 2013 10:12 am

Hello,
I do not have the same kernel as you. I download from git the 3.6.10-rc from the Atmel github. I am working on a G25 board

So, I activated the watchdog in the dt, and activate it in the bootstrap (or deactivate the desable). By the way, in bootstrap3, you can change this in the config file by undefining CONFIG_DISABLE_WATCHDOG

I also have this log:

Code: Select all

at91sam9_wdt: enabled (heartbeat=15 sec, nowayout=0)
I have the same "error" print:

Code: Select all

watchdog watchdog0: watchdog did not stop!
But 16 sec later, I have:

Code: Select all

at91sam9_wdt: I will reset your machine !
, and the board reboot. Do you wait enough?

Maybe you could upgrade the release of the kernel. Or look at the change between your version and mine.

Regards
bevenson
Posts: 75
Joined: Fri Oct 28, 2011 7:25 pm

Re: Watchdog errors with linux4sam 3.6.9 kernel

Wed Jun 19, 2013 2:26 pm

AntoineC,

I waited several minutes after triggering the watchdog and the board did not reset. I also confirmed that when I trigger the watchdog on my board running the 2.6.39 kernel that it resets that board. So I suspect there is a difference between the kernel I'm using and the one you're using that is causing my problem.
I download from git the 3.6.10-rc from the Atmel github.
I searched the branches and tags of the repository at both http://github.com/linux4sam/linux-at91/ and http://github.com/at91linux/linux-at91/, and I didn't find any branch or tag called 3.6.10-rc. Was that a typo?

Thanks!
Bryan
AntoineC
Posts: 105
Joined: Wed Oct 03, 2012 11:33 am

Re: Watchdog errors with linux4sam 3.6.9 kernel

Wed Jun 19, 2013 5:18 pm

Sorry, I mixed up version number!!
I was on a 3.6.9, and now I m on a 3.10.0

The exact name on at91 github and not linux4sam (sorry again) is at91-3.10-fixes:

Code: Select all

https://github.com/at91linux/linux-at91/tree/at91-3.10-fixes
With this version, and this time I am sure of it, the watchdog is working (with correct configuration of bootstrap and dt)
bevenson
Posts: 75
Joined: Fri Oct 28, 2011 7:25 pm

Re: Watchdog errors with linux4sam 3.6.9 kernel

Wed Jun 19, 2013 9:22 pm

AntoineC,

Thanks for the help. I'll check to see if there is a lot of watchdog related changes between the kernel you're using and the one I'm using. If it looks pretty simple, I'll try pulling the changes into my end. If not, I may just start using a more recent kernel.

Thanks again,
Bryan
bevenson
Posts: 75
Joined: Fri Oct 28, 2011 7:25 pm

Re: Watchdog errors with linux4sam 3.6.9 kernel

Wed Jul 31, 2013 2:44 pm

I still haven't solved this issue for my setup for the linux-3.6.9-at91 kernel build. I am still seeing the results I have posted previously. The boot log shows that the watchdog is enabled, but triggering the watchdog does not cause the board to reset. I've tried triggering the watchdog by writing a single character to the watchdog (echo "0" > /dev/watchdog), and I've tried both the watchdog-simple and watchdog-test programs under Documentation/watchdog/src/ that comes with the kernel. No luck, but if i use the linux-3.9-at91 kernel I can trigger the watchdog. The linux-3.6.9-at91 kernel has the most complete set of working peripherals that I need to use, so I'd really like to get the watchdog working on this one.

Has anyone else had any success with this kernel? The kernel build I have been using is over at http://www.github.com/evensonbryan/meta-atmel. I do have some minor, local modifications to the device tree files for my hardware. The resulting device tree files as patched are located at http://www.github.com/evensonbryan/at91sam9g25-dt. If anyone can tell me what I'm doing wrong, I'd love to hear it.

Thanks,
Bryan
pavlix
Posts: 1
Joined: Thu Apr 30, 2020 10:27 pm

Re: Watchdog errors with linux4sam 3.6.9 kernel

Thu Apr 30, 2020 10:34 pm

Just in case someone hits this page in 2020 or later...

The “error” is the correct behavior. The “echo” command opens the watchdog and exits which is considered a bad practice. You can use it that way as long as you ignore the error message.

Using watchdog properly from the shell is tricky as it involves opening a file which is not a typical shell operation.

Code: Select all

# check every command
set -e
# open the watchdog
exec 3>/dev/watchdog
# ping the watchdog
echo >&3
# close the watchdog
echo -n V >&3
exec 3>&-
Note: Don't start any backgrounding daemons in your script, or use the following to avoid hijacking the watchdog.

Code: Select all

start-your-daemon 3>&-

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 4 guests