2011-03-01 08:00:15     problem with watchdog during boot on bf537

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-03-01 08:00:15     problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98504   

 

Hi everybody,

 

I have a board with a BF537 and I have implemented a watchdog on this board. The first step was to enable the watchdog on u-boot. This step is OK. Then, the second step was to enable the watchdog on linux (the watchdog runs by inittab. This step is also OK.

 

My problem is during the boot. It becomes between u-boot and the moment where the file inittab is running. I don't know where I can implement the watchdog during the boot.

 

In the first attached file, you can see correct logs because I have disabled the watchdog by a jumper on my board. But, you can see on the second attached file that logs are bad when I active the watchdog.  It' my problem.

 

Have you some ideas ?

 

Best regards.

 

log_pb.txt

log_ok.txt

TranslateQuoteReplyEditDelete

 

 

2011-03-01 12:47:50     Re: problem with watchdog during boot on bf537

Mike Frysinger (UNITED STATES)

Message: 98507   

 

there isnt any time during the boot you can activate the watchdog.  the timeout must be long enough to allow u-boot to finish executing and linux userspace start up.

 

so try increasing the watchdog timeout in u-boot.

QuoteReplyEditDelete

 

 

2011-03-02 03:23:21     Re: problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98582   

 

Thank you for your reply,

 

In my board, the watchdog is a supervisor (integrated circuit MAX823T). If there aren't ticks always 1,6 second on the MAX823T, it generates the reset of the board. Ticks are generated by a GPIO of BF537. However, I have a jumper on my board to enable/disable the supervisor. When I disable it during the boot, the boot is correct. Then, I can enable the supervisor. So the watchdog function is OK,  but I have to put the jumper after the complete boot.

 

I want to be able to put the jumper (so enable the watchdog) during the boot process. If I do it, the boot stops (look at the attached file log_pb.txt in my first message). Is there a solution ?

TranslateQuoteReplyEditDelete

 

 

2011-03-02 03:58:01     Re: problem with watchdog during boot on bf537

Aaron Wu (CHINA)

Message: 98583   

 

Looks like the timeout period of MAX823 is fixed, so you may try to add some action in the u-boot to issue the peroper pulse on the GPIO to MAX823 during the booting process?

QuoteReplyEditDelete

 

 

2011-03-02 04:15:35     Re: problem with watchdog during boot on bf537

Mike Frysinger (UNITED STATES)

Message: 98584   

 

you will need to poke the watchdog yourself in your linux board code.  simply add initcalls to your boards file that pokes the gpio.  then when userspace starts up, you can launch a proper watchdog daemon.

QuoteReplyEditDelete

 

 

2011-03-02 04:53:19     Re: problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98586   

 

@Mike Frysinger : In linux, I use the watchdogd that is run by inittab. My problem is only during the boot before the call of inittab.

 

@Aaron Wu : I have implemented the pulse of the GPIO in u-boot with CONFIG_WATCHDOG but I think that this function isn't called during the boot. If you know how to implement it, can you help me ?

TranslateQuoteReplyEditDelete

 

 

2011-03-02 04:58:02     Re: problem with watchdog during boot on bf537

Mike Frysinger (UNITED STATES)

Message: 98587   

 

please read my comment again.  i explicitly told you how to handle the watchdog *before* userspace and thus before any inititab processing.

QuoteReplyEditDelete

 

 

2011-03-02 05:30:54     Re: problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98591   

 

OK and sorry, I have stayed on the last lign.

 

Where is the file in which I could add initcalls ? I don't find it.

TranslateQuoteReplyEditDelete

 

 

2011-03-02 23:45:41     Re: problem with watchdog during boot on bf537

Mike Frysinger (UNITED STATES)

Message: 98615   

 

your boards file.  i dont know what you named your boards file, so i dont know the exact path to it.

 

the BF537-STAMP uses linux-2.6.x/arch/blackfin/mach-bf537/boards/stamp.c.

QuoteReplyEditDelete

 

 

2011-03-03 03:29:03     Re: problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98624   

 

Yes, it's the right board file.

 

I tried to include ''set_gpio_toggle(GPIO_14);'' but it failed. (GPIO_14 is the GPIO that controls the watchdog).

TranslateQuoteReplyEditDelete

 

 

2011-03-03 03:53:12     Re: problem with watchdog during boot on bf537

Mike Frysinger (UNITED STATES)

Message: 98625   

 

i dont know what "it failed" means

QuoteReplyEditDelete

 

 

2011-03-03 04:13:50     Re: problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98626   

 

I tried to use set_gpio_dir, set_gpio_inen and set_gpio_edge functions. It seems to be OK.

TranslateQuoteReplyEditDelete

 

 

2011-03-04 05:04:44     Re: problem with watchdog during boot on bf537

Christophe Crepin (FRANCE)

Message: 98648   

 

I tried to use set_gpio_dir, set_gpio_inen and set_gpio_edge functions. I can enable the watchdog, the board boots very well. But a new problem becomes. The command ''reboot'' in a teraterm doesn't reboot the board. It freezes...

Attachments

Outcomes