[En-Nut-Discussion] SAM7X Watchdog

HU Daidai rtems at 126.com
Tue Jul 18 03:05:37 CEST 2006


Hi,

There is an idiom in Chinese, the man who can release the bell from a tigger is just the one who fastened it.  In fact, this ugly code is put here by me.  It should be useless now
, and may be removed safely.

I beggan the SAM7X port with WinARM/OpenOCD/Wiggler debug tools.  In order to set more breakpoints and save time of burning flash, I first downloaded program to internal SRAM and debug it.  To avoid being puzzled from the strange REMAP design, SRAM was allocated in the fixed address 0x200000 in that time.  By default, SAM7X runs from the boot ROM, while watchdog is enabled.  I have no idea to disable it when debugging, so the clear WDT operation must be done.

For code size and interrupt response reasone, debugging in SRAM and booting from internal ROM is not allowed now.  It is the time to over the history of this code.

------------------				 
HU Daidai
2006-07-18

-------------------------------------------------------------
>Frome:Harald Kipp
>Date:2006-07-18 01:27:59
>Subject:[En-Nut-Discussion] SAM7X Watchdog

>Hi,

>Anyone able to explain this part of arch/arm/os/nutinit.c to me?

>#ifdef MCU_AT91SAM7X256
>         /*
>          * We have only one chance to disable the WDT by writing WDT_MR.  This
>          * may cause trouble when debug in RAM.  If code burned in flash 
>enabled
>          * WDT, we have no idea to disable but clear it.
>          */
>         outr(WDT_WDCR, 0xA5000000 | WDT_WDRSTT);
>#endif

>After adding

>         /*
>          * The watchdog is enabled after processor reset. Disable it.
>          */
>         ldr     r1, =WDT_BASE
>         ldr     r0, =WDT_WDDIS
>         str     r0, [r1, #WDT_MR_OFF]

>to crtat91sam7x256_rom.S, the triggering in the idle thread shown
>above can be removed, right?

>If I understood everything correctly, the watchdog disable
>must be configurable, because WDT_MR can be written once only.

>Did I overlook something?

>Harald




More information about the En-Nut-Discussion mailing list