AnsweredAssumed Answered

WatchDog doesn't do anything on my K60N512 tower!

Question asked by Regis LETOURNEUR on Mar 1, 2011
Latest reply on Mar 4, 2011 by David E Seymour

Hi please could you help me why the command :  scb->AIRCR |= SCB_AIRCR_SYSRESETREQ_MASK;

doesn't do a reboot on my K60N512 kit when time time dog is elapsed!

Regards.

 

see below my code used :

 


/*FUNCTION*------------------------------------------------------
*
* Function Name  : handle_watchdog_expiry
* Returned Value : none
* Comments       :
*     This function is called when a watchdog has expired.
*END*-----------------------------------------------------------*/

void handle_watchdog_expiry
   (
      pointer td_ptr
   )
{
  printf("\n\rWatchdog expired for task: 0x%P", td_ptr);

  VCORTEX_SCB_STRUCT_PTR scb = (VCORTEX_SCB_STRUCT_PTR)&(((CORTEX_SCB_STRUCT_PTR)CORTEX_PRI_PERIPH_IN_BASE)->AIRCR);
  printf("\n\rAIRCR Register : 0x%P", scb->AIRCR);
 
  // Reboot...  
  scb->AIRCR |= SCB_AIRCR_SYSRESETREQ_MASK;

  // __boot();    The boot Branch do nothing!...
  // _mqx_exit(1);   

}

/*FUNCTION*------------------------------------------------------
*
* Function Name  : Init_Task(uint_32 data)
* Returned Value : none
* Comments       :
*     Kick-start all the other tasks used in this demo.
*END*-----------------------------------------------------------*/

void Init_Task(uint_32 data)
{
  uint_32 result;
 
  printf("\n\nKinetiSecure TWR-K60N512 MQX \n");
  printf("\n_mqx_generic_revision : %d \n", _mqx_generic_revision);
 

  /* Create watchdog component. */
   result = _watchdog_create_component(BSP_TIMER_INTERRUPT_VECTOR,
      handle_watchdog_expiry);
   if (result != MQX_OK) {
      printf("\nError creating watchdog component!");
      _mqx_exit(0);
   }




void main(
{
      /* Start watchdog component until 2ms the watchdog expires. */
      if(_watchdog_start(2000) == FALSE){
        printf("\nError starting watchdog component!");
        _mqx_exit(0);
      }    
etc....

}

Outcomes