This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Tiva™ C Series EK-TM4C123GXL - watchdog 1 not start

Other Parts Discussed in Thread: TM4C123GH6PM

hello

I learn the basic configuration of  TM4C123GH6PM and I have a problem with WDT1.

Configuration and start Watchdog0 working properly. When I tried to run Watchdog1 I got the error "Trouble Reading Memory Block at 0x40001000" and WDT1 is not running. Register RCGCWD is correctly, bit R1 = 1.

  • Hi Tomasz,

         Post your code so others can review it.

    -kel

  • The code is reduced only to activate the WDT.
    If I turn WDT0 (reset mode) everything works and the LED blinks.

    #include "utils/ustdlib.h"
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/debug.h"
    #include "driverlib/hibernate.h"
    #include "driverlib/gpio.h"
    #include "driverlib/systick.h"
    #include "driverlib/timer.h"
    #include "driverlib/watchdog.h"
    
    #ifdef DEBUG
    void
    __error__(char *pcFilename, unsigned long ulLine)
    {
    }
    #endif
    
    
    int main(void)
    {
    	SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_INT);  // 40 MHz int
    
    	//green LED on
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
    	GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
    
    
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
    
    	WatchdogStallEnable(WATCHDOG0_BASE);
    
    	WatchdogReloadSet(WATCHDOG0_BASE,0xFEEFEE);
    
    	WatchdogResetEnable(WATCHDOG0_BASE);
    	WatchdogEnable(WATCHDOG0_BASE);
    
    	while(1)
    	{
    
    	}
    }

    For WDT1 memory map is not available (error), WDT1 does not start.
    I tried to insert loops and wait until the WRC bit = 0 in the registry WDTCTL - it did not help.

    #include "utils/ustdlib.h"
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/debug.h"
    #include "driverlib/hibernate.h"
    #include "driverlib/gpio.h"
    #include "driverlib/systick.h"
    #include "driverlib/timer.h"
    #include "driverlib/watchdog.h"
    
    #ifdef DEBUG
    void
    __error__(char *pcFilename, unsigned long ulLine)
    {
    }
    #endif
    
    
    int main(void)
    {
    	SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_INT);  // 40 MHz int
    
    	//green LED on
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
    	GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
    
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG1);
    
    	WatchdogStallEnable(WATCHDOG1_BASE);
    
    	WatchdogReloadSet(WATCHDOG1_BASE,0xFEEFEE);
    
    	WatchdogResetEnable(WATCHDOG1_BASE);
    	// WRC in WDTCTL
    	while(!(HWREG(WATCHDOG1_BASE + 0x008)>>31))
    	{
    	}
    	WatchdogEnable(WATCHDOG1_BASE);
    	// WRC in WDTCTL
    	while(!(HWREG(WATCHDOG1_BASE + 0x008)>>31))
    	{
    	}
    
    	while(1)
    	{
    
    	}
    }

  • Hi Tomasz,

    There is an errata for the issue already on TM4C123

    I have been using WDT1 a lot and since I enable the COM Port on UART-0, it always works for me.


    In the code above, you need to add

    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    before Enabling the clock for WDT1 and it will work

    Amit

  • Thank you very much for your quick help.

    After reading the document and application suggestions everything works well.

  • Thanks for your help.
    Is this issue a hardware defect?

  • Hello Nuno

    Yes, it is a hardware defect.