Watchdog Timer on FitPC2i

Post Reply
adahlin
Posts: 2
Joined: Sat Mar 03, 2012 1:56 am

Watchdog Timer on FitPC2i

Post by adahlin »

Firstly, I've been using several fit pc2i's with ubuntu linux successfully the past few months. It's a great product!

I then went to add the hardware watchdog timer module and ran into a bit of a nightmare. You can't just modprobe the sbc_fitpc2_wdt module because it does a check to see if the board is a FITPC2... which this isn't, it's a FITPC2i. It doesn't actually tell you this, it will say "No such device".

To fix this you need to edit and rebuild the module (this is where it gets... fun).

First you need to download the appropriate linux kernel source. This can be done with:

cd /usr/src/
sudo apt-get source linux-image-$(uname -r)

Using [1] , we can then rebuild just the module against using just the headers of the current kernel.

Before you compile, a couple changes to sbc_fitpc2_wdt.c are necessary though:

First you must comment out line 208 (This is what won't let it be modprobed... our device is a FITPC2i. I can't figure out what the string SHOULD be, so i'm just commenting out the return. This is really poor form though and hopefully someone can help fix this!)
So change:
return -ENODEV;
to:
//return -ENODEV;

next, you need to change the mdelay() calls to msleep() on lines 49 and 51. If you don't, watchdog will use 100% CPU every 10 seconds or so. See [2].

Once that's done, you can compile ([1]) the module and you'll end up with a nice, pretty .ko file to copy over to your /lib/modules/<kernel version>/kernel/devices/watchdog. You can now modprobe and everything should work.

Hopefully this saves someone a lot of time and frustration. Any chance these changes can get pushed to the linux trunk?

[1]http://www.debian-administration.org/ar ... nel_module
[2]http://www.fit-pc.com/forum/viewtopic.p ... 5b9f#p4388

Thanks,

Andrew

sfzhi
Posts: 16
Joined: Tue Aug 16, 2011 10:41 am

Re: Watchdog Timer on FitPC2i

Post by sfzhi »

I'm surprised. I have been using stock sbc_fitpc2_wdt on fit-PC2i for quite a while without any modifications and without any problems. Are you using some ancient kernel version?

adahlin
Posts: 2
Joined: Sat Mar 03, 2012 1:56 am

Re: Watchdog Timer on FitPC2i

Post by adahlin »

Depends on how you define ancient, but 2.6.32-33-generic-pae.

I'll check out the current kernel when I get chance to see if its been updated.

Post Reply

Return to “Linux on fit-PC2”