AnsweredAssumed Answered

Reseting the K64 chip programatically

Question asked by igor-imx on Mar 24, 2014
Latest reply on Mar 28, 2014 by David E Seymour

Hi Everyone

We were previously working on K60M512Z chip and the following code worked perfect for reseting the device programatically:

 

void deviceReset(void)

{

  VCORTEX_SCB_STRUCT_PTR scb = (VCORTEX_SCB_STRUCT_PTR)&(((CORTEX_SCS_STRUCT_PTR)CORTEX_PRI_PERIPH_IN_BASE)->SCB);

  uint32_t temp_AIRCR=0;

 

  temp_AIRCR = (UINT)scb->AIRCR;   //Read AIRCR register

  temp_AIRCR &= 0x0000ffff;   //DES mask of the top 16-bits

  temp_AIRCR |= 0x05Fa0000;   //DES When writing to AIRCR the update 16-bit must be "0x05FA" per ARMv7-M Architecture Reference Manual (must register on ARM.com to get)

  temp_AIRCR |= SCB_AIRCR_SYSRESETREQ_MASK;   //DES set the SYSRESETREQ bit to generate software reset

// Reboot...

_time_delay (50);

  scb->AIRCR = temp_AIRCR;

 

 

  for(;;)

 

 

  return;

}

 

 

however im testing the same code with K64 chip (MK64FN1M0VLQ12) and its not causing the reset anymore.

Both setups are using MQX 4.1.0

Can anyone shed any light on whats wrong?

thank you in advance

Outcomes