Question
STM32G070 software reset issue
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.
