2025-12-29 4:19 AM - last edited on 2025-12-29 5:00 AM by Andrew Neil
I was doing reset through SPI command and expected results are not happening.
this is the line i was expecting to reset the MCU
SCB->AIRCR = (NVIC_AIRCR_VECTKEY | (SCB->AIRCR & (0x700)) | (1 << NVIC_SYSRESETREQ));
where
#define NVIC_AIRCR_VECTKEY (0x05FA << 16)
#define NVIC_SYSRESETREQ 2also my watchdog is running and expected to reset the system.
code snippet
FLASH_Unlock();
FLASH_ErasePage(0x08013000);
FLASH_ProgramWord(0x08013000, (uint64_t)0x0000000000000000ULL);
FLASH_Lock();
FLASH_Unlock();
FLASH_ErasePage(0x08013008);
FLASH_Lock();
SCB->AIRCR = (NVIC_AIRCR_VECTKEY | (SCB->AIRCR & (0x700)) | (1 << NVIC_SYSRESETREQ));
__DSB();
while (1);
Edited to apply proper source code formatting - please see How to insert source code for future reference.
2025-12-29 6:05 AM - edited 2025-12-29 6:06 AM
Hi i have tried toggle a gpio as you mentioned and it didnt reset. As I mentioned some hung state or something which i couldnt trace. And i will let you know about the NRST pin since i am lacking the setup as of now