cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G070 software reset issue

aravindpv
Associate III

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    2

also 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.

10 REPLIES 10

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