From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Tue, 17 Mar 2015 11:48:56 +0100 Subject: [U-Boot] [PATCH] dfu: cmd: trigger watchdog before calling usb_gadget_handle_interrupts In-Reply-To: <20150317105202.3ec3d070@amdc2363> References: <1426170850-25688-1-git-send-email-hs@denx.de> <20150317105202.3ec3d070@amdc2363> Message-ID: <55080698.9020505@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Lukasz, Am 17.03.2015 10:52, schrieb Lukasz Majewski: > Hi Heiko, > >> trigger watchdog before calling usb_gadget_handle_interrupts() >> This prevents board resets when calling dfu command on boards >> which have a watchdog. >> >> Signed-off-by: Heiko Schocher >> --- >> >> common/cmd_dfu.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c >> index e975abe..46af4cf 100644 >> --- a/common/cmd_dfu.c >> +++ b/common/cmd_dfu.c >> @@ -9,6 +9,7 @@ >> */ >> >> #include >> +#include >> #include >> #include >> #include >> @@ -64,6 +65,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int >> argc, char * const argv[]) if (ctrlc()) >> goto exit; >> >> + WATCHDOG_RESET(); >> usb_gadget_handle_interrupts(); >> } >> exit: > > It seems strange for me, that we must reset watchdog when looping in > the dfu. Hmm.. maybe I overlook something, but If you look into this while(1) loop, there is no trigger of the watchdog ... and if I start the dfu command without a USB cable on the board, what triggers the boards watchdog? > What is the WATCHDOG interval on the affected board? ~5 seconds Ah, this is on an at91 board .. and in the drivers/serial/atmel_usart.c atmel_serial_tstc() is no WATCHDOG_RESET... So ctrlc() does not trigger the watchdog bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany