Not able to perform soft restart SAMB11.

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to perform software restart in SAMB11 when it gets hang. I tried the WDT example code with config_wdt.enable_reset = true. But it doesn't restart the system. It reached the wdt alert callback function when wdt overflow occurs but hangs there. I have also tried updating asf, its still not working. Anyone have idea how to soft restart SAMB11 board?

This topic has a solution.
Last Edited: Sun. Apr 16, 2017 - 08:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know why the WDT doesn't reset the chip but there is a system_global_reset() function in system_sam_b.c, maybe you could try calling it in the handler?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have found the same issue.

 

enable_reset does not reset the module.

 

I'm using

 

    wdt_register_callback(&wdt_instance, MCU_WDTdoReset,WDT_CALLBACK_EARLY_WARNING);
    wdt_enable_callback(&wdt_instance, WDT_CALLBACK_EARLY_WARNING);

 

and in the callback I call

 

platform_chip_reset();

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I'm finishing up my firmware I wanted to reduce the code size (also for BLE OTAU) and copied the WDT code to my own code (asf libs have lot's of conditions which are not needed in actual implementation and the linker can also not remove function because it does not know the result of the conditional statements).

 

    system_clock_peripheral_disable(PERIPHERAL_WDT1);
    WDT1->WDOGLOCK.reg = WDT_WRITE_ACCESS_KEY;
    WDT1->WDOGLOAD.reg=(26000000 * 80);
    WDT1->WDOGCONTROL.reg |= WDT_WDOGCONTROL_RESEN;
    system_clock_peripheral_enable(PERIPHERAL_WDT1);

 

And to my absolute surprise it's working now without the early warning and manual platform reset.

 

Note : I've also given up on ULP for now (my pcb crashes after 3~4 days with it), so maybe that's the reason its working now.

Last Edited: Wed. Apr 12, 2017 - 10:38 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks @mvdzwaan for your helpful information.

I was able to restart my board using WDT after I remove system_register_isr() from wdt_set_config() function in wdt_sam_b.c file.

 

enum status_code wdt_set_config(struct wdt_module *const module, Wdt * const hw, const struct wdt_config *const config)
{

   ......

   //system_register_isr(RAM_ISR_TABLE_NMI_INDEX, (uint32_t)wdt_isr_handler);

   ......

}

 

Now the board restart and string "BOUT!" is printed in the terminal software. I don't know if it is suppose to work like that or not.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Paras,

 

so that's why it's working in my case.

 

The WDT does not work when using the ISR. The ISR is only needed for the early warning system, but because of the philosophy of ASF the ISR is always registered and the handler determines if there is a callback and calls it. This is done in all modules...

 

So it's "bad" coding in the ASF, where the ISR should only be registered when using the early warning callback system (and note when using this, you'll need to perform the reset yourself).

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unable to program

I am using SAMB11ZR Kit,while programming i was unable to RESET the Device.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The function initiates a system reset request to reset the MCU.
 */
__STATIC_INLINE void NVIC_SystemReset(void);

 

This function is defined in core_cm0.h