Problem with RA6M3 IWDT, WDT and software reset, not working sometimes.

I have a problem with RA6M3 IWDT, WDT and software reset.
After reset the microcontroller sometimes does not work.
After the first power-up everything is ok, the problem appears only after a watch dog reset or a software reset.
I have automatic watch dog start enabled and the supply voltage monitor enabled.
I have tried this on multiple units and the problem is reproducible.
I do not use low power modes.
The microcontroller remains in the idle state until the power is turned off and on again.
Current consumption does not increase in the suspended state.

My setup is:

Microcontroller: RA6M3

IDE: e2studio

Thank you in advance

Parents
  • Hello,

    Thank you for your response. I would appreciate if you could share the code snippet of the respected query so that, I can recreate the issue and find the actual problem. Also, which FSP version are you using?

    Regards,

    Payodhi

  • Hello,

    Thank you for your answer.

    I'm using FSP version 3.5.0.

    OFS0 settings
    Independent WDG
    Start Mode IWDG is automatically activated after a reset
    Timeout Period 2048 cycles
    Dedicated Clock Frequency DIV 256
    Window End Position 0%
    Window Start Position 100%
    Reset Interrupt Request Select Reset is enabled
    Stop Control Counting continues
    WDT
    Start Mode Automatically activate WDT after a reset
    Timeout Period 16384 cycles
    Clock Frequency Division Ratio 8192
    Window End Position 0%
    Window Start Position 100%
    Reset Interrupt Request Reset
    Stop Control Counting continues

    After reset I call:

    R_IWDT_Open (&g_wdt1_ctrl, &g_wdt1_cfg);
    R_IWDT_Refresh(&g_wdt1_ctrl);
    R_WDT_Open (&g_wdt0_ctrl, &g_wdt0_cfg);
    R_WDT_Refresh (&g_wdt0_ctrl);

    In the main loop I call:

    R_IWDT_Refresh(&g_wdt1_ctrl);
    R_WDT_Refresh (&g_wdt0_ctrl);

    My Software Reset Procedure:

    NVIC_SystemReset ();

    Sometimes after a software reset the microcontroller locks up and stays in this state until the power is turned off. After the WDG is activated it behaves the same.

    I also use the RA6M5 microcontroller and this problem does not occur.

    Thank you in advance.

  • Can you clarify what a 'lock up' looks like ? Do you have a debugger connected ? Does the code hang anywhere ? 

  • I have debug turned off for the duration of testing.

    I noticed that sometimes after a software reset the microcontroller hangs. And despite the watchdog being enabled it does not restart. I wrote a test program that does not refresh the watchdog. After starting the program the microcontroller resets. After a random time, sometimes even after several hours, the microcontroller hangs and remains in this state until the power is turned off. I checked if the oscillator works using an oscilloscope and it works. I tested such operation on over 100 pieces and it is always the same. As the first action of my code I turn on the LED diode, and the LED diode does not light up.

    Generally my software does not hang, it works all the time. Sometimes, at customers' places there are situations when the device hangs and the watchdog does not work.

  • Hi mg,

    I modified a blinky project and added wdt/iwdt/software reset.  This uses FSP 5.1.0. The green led blinks  1Hz for POR, 2Hz for software reset, 4Hz/8Hz for wdt/iwdt reset.  I am inclined to believe the watch dog causes a reset, but the reset wasn't able to clear whatever fault you observed.. ra6m3_blinky_wdt_iwdt.zip

  • Shouldn't the watchdog reset the microcontroller again in such a situation? What could be the reason that the reset does not restart the software? Why does the test program hang, there is no software hang, only the watchdog is not refreshed?

  • Here is modified program.  I added segger rtt print to show the wdt/iwdt count down.

    Also added 

    R_DEBUG->DBGSTOPCR_b.DBGSTOP_WDT = 0;

    R_DEBUG->DBGSTOPCR_b.DBGSTOP_IWDT = 0;

    so watch dog continue to count when a debugger is connected.

    00> SEGGER J-Link V7.92o - Real time terminal output
    00> SEGGER J-Link-OB-S124 V1.0, SN=831750484
    00> Process: e2-server-gdb.exe
    00> freq : 2, clear_wdt : 0 
    00> wdt : 12569, iwdt : 2014, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 1983, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 1951, sw count : 6,clear_wdt : 0
    ........
    00> wdt : 12569, iwdt : 97, sw count : 6,clear_wdt : 0
    00> wdt : 12570, iwdt : 65, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 34, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 2, sw count : 6,clear_wdt : 0
    00> freq : 8, clear_wdt : 1 
    00> wdt : 15430, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 14476, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 13522, iwdt : 2040, sw count : 24,clear_wdt : 1
    ......
    00> wdt : 2071, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 1117, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 163, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> freq : 4, clear_wdt : 2 
    00> wdt : 14477, iwdt : 2032, sw count : 11,clear_wdt : 2
    00> wdt : 14477, iwdt : 2032, sw count : 10,clear_wdt : 2
    00> wdt : 14477, iwdt : 2032, sw count : 9,clear_wdt : 2
    ..........
    00> wdt : 14477, iwdt : 2032, sw count : 3,clear_wdt : 2
    00> wdt : 14477, iwdt : 2032, sw count : 2,clear_wdt : 2
    00> wdt : 14477, iwdt : 2033, sw count : 1,clear_wdt : 2
    00> freq : 2, clear_wdt : 0 
    00> wdt : 12569, iwdt : 2014, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 1983, sw count : 6,clear_wdt : 0
    

    ra6m3_blinky_wdt_iwdt_2.zip

Reply
  • Here is modified program.  I added segger rtt print to show the wdt/iwdt count down.

    Also added 

    R_DEBUG->DBGSTOPCR_b.DBGSTOP_WDT = 0;

    R_DEBUG->DBGSTOPCR_b.DBGSTOP_IWDT = 0;

    so watch dog continue to count when a debugger is connected.

    00> SEGGER J-Link V7.92o - Real time terminal output
    00> SEGGER J-Link-OB-S124 V1.0, SN=831750484
    00> Process: e2-server-gdb.exe
    00> freq : 2, clear_wdt : 0 
    00> wdt : 12569, iwdt : 2014, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 1983, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 1951, sw count : 6,clear_wdt : 0
    ........
    00> wdt : 12569, iwdt : 97, sw count : 6,clear_wdt : 0
    00> wdt : 12570, iwdt : 65, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 34, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 2, sw count : 6,clear_wdt : 0
    00> freq : 8, clear_wdt : 1 
    00> wdt : 15430, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 14476, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 13522, iwdt : 2040, sw count : 24,clear_wdt : 1
    ......
    00> wdt : 2071, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 1117, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> wdt : 163, iwdt : 2040, sw count : 24,clear_wdt : 1
    00> freq : 4, clear_wdt : 2 
    00> wdt : 14477, iwdt : 2032, sw count : 11,clear_wdt : 2
    00> wdt : 14477, iwdt : 2032, sw count : 10,clear_wdt : 2
    00> wdt : 14477, iwdt : 2032, sw count : 9,clear_wdt : 2
    ..........
    00> wdt : 14477, iwdt : 2032, sw count : 3,clear_wdt : 2
    00> wdt : 14477, iwdt : 2032, sw count : 2,clear_wdt : 2
    00> wdt : 14477, iwdt : 2033, sw count : 1,clear_wdt : 2
    00> freq : 2, clear_wdt : 0 
    00> wdt : 12569, iwdt : 2014, sw count : 6,clear_wdt : 0
    00> wdt : 12569, iwdt : 1983, sw count : 6,clear_wdt : 0
    

    ra6m3_blinky_wdt_iwdt_2.zip

Children
No Data