Dear all,
I'm currently developing a solution that has to be able to reboot on request over the UART. The reboot command is received, and the MCU enters reboot process and then halts indefinitely with all debug LED's turned on (half the regular brightness).
I'm using the SysTick for event triggering in normal run-time. Before the SYS_RESET function is called, the SysTick is disabled.
Due to reset I'm not able to debug the chip properly. Hw reset and reboot works fine everytime.
void SYS_RESET(void){
__DSB(); /* Ensure all outstanding memory accesses included buffered write are completed before reset */
SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
(SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
__DSB(); /* Ensure completion of memory access */
for(;;) /* wait until reset */
{
__NOP();
}
}
Thanks!
Hi @Alexis_A ,
if I can pinpoint something, than that would be the stopping of SysTick Timer after a SW reset. I really can't find the mechanism of this error but it is present for some time now. I've sent you the Keil project so You should be able to reproduce the same error on your HW.
What do you mean by not debug properly? This is due to the connection break on reset between Keil and MCU via debugger.
All the best,
Mario
Dear Alexis,
please find in direct message the core of the project I use for my development. This is a simple tasker that runs API's one at a time. The API implemented in this example is a dummy LED blinker.
The occurrence that I experience is that after SYSRESETREQ device doesn't boot rather it stays hung somewhere in the code. The HW reset works fine. I'm thinking that it has to do something with the clearing of the registers after soft-reset but I can't pinpoint the code section that makes this problem.
What do you mean by not debug properly?
I simply mean that Keil uVision debugger stops on reset, and since there is no boot-up the debug is impossible.
Kind regards,
Mario
Hello @Srukonja,
I tried using the NVIC_SystemReset() that is almost the same to the API SYS_RESET, and could do this without problems. What do you mean by not debug properly?
Best Regards,
Alexis Andalon