2008-09-14 10:13 PM
Doing a reset
2011-05-17 03:44 AM
Hello everyone!
I'm using IAR EWARM 5.11 a j-link and a STM32F103VBT6 processor. I've been trying to do a reset. I've tried iwdg, the sysresetreq bit and the hw way by nrst. And they all have a common behaviour, I end up at the HardFault vector. The vector table checks out, the boot0 pin is 0, so, what am I missing?2011-05-17 03:44 AM
A good way to reset from software is like so (from the ST firmware library).
Code:
/******************************************************************************* * Function Name : NVIC_GenerateSystemReset * Description : Generates a system reset. * Input : None * Output : None * Return : None *******************************************************************************/ void NVIC_GenerateSystemReset(void) { SCB->AIRCR = AIRCR_VECTKEY_MASK | (u32)0x04; }2011-05-17 03:44 AM
Sorry everyone.
Of course it was programmer error in low_level_init(). :-?2011-05-17 03:44 AM
Thanks. But that was what I meant by ''the sysresetreq bit''.
Still having problems with the reset though, still might be programmer error but I can't find it. It happens when the MCU is switched over from HSI to PLL systemclock. Starting it up once by JTAG works but when doing a reset or running standalone I end up at the HardFault vector when doing the switch from HSI to PLL for system clock. The PLL clock is generated from a HSE clock input (HSEBYP bit set to 1). The RCC_CR and RCC_CFGR both look the same for the first startup and the reset. So what might be different that I'm not noticing?