Tool/software:
Hello,
I have created fault handlers for the various kinds of faults such as a bus error. This keeps the fault from escalating to a hard fault and we get a more informative trace back. I only want the fault handlers to stop execution when we are in debug mode (this works great BTW). If not in debug mode I want to reset the CC3235 so it restarts and resumes execution. I'm currently attempting to do this using the SCB AICR register. This is an excerpt of that code:
// Defines to get into the AIRCR register and reset the CPU
#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
/**
* \details Generates a soft reset by writing the SCB->AIRCR register with
* the vector key and the reset bit set.
*
* \param[in] None
* \param[out] None
*
* \return None
*
* \note None
*/
static void SoftReset(void)
{
*(volatile uint32_t *)SCB_AIRCR_ADDR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
SCB_AIRCR_SYSRESETREQ_Msk);
// Wait for the reset
for(;;)
{
// intentional infinite loop until the reset fires.
}
}
However, the reset never occurs. I've attempted reversing the Vector Key, and even just hardcoding the whole thing. Does the AICR reset not work on the CC3235? Some of my google searching has indicated this can be a common problem on ARM cores. I suppose I could enable the Watch Dog and let it reset the processor in this case, but didn't want to take that step unless it was absolutely necessary.
Thanks,
John