2018-06-30 02:23 PM
Hello,
I have a custom PCB with a STM32F042F4P6.
The STM32 keeps resetting at a rate of 2.5 Hz. I measured this with a scope on the NRST pin.
After a long search i found out that the IWDGRSTF flag is set after each reset. This is strange, because i never enabled the IWDG or WWDG in CubeMX v4.23. I also do not see anything about a set up of a watchdog in the generated code. Further, after i erase the chip in ST-Link utility, the STM32 is still resetting (at a constant rate of >600hz).
NRST pin is pulled up on the PCB with an 43k ohm resistor.
Attached a screenshot of the IWDG and the CSR register.
What I tried so far:
But still the STM32 keeps resetting..
Is there something i overlooked?
Many thanks,
Thomas
#clock #pll #stm32f042f4p6 #stm32f042f4 #iwdg #reset-reason #cubemx-4.23Solved! Go to Solution.
2018-07-08 09:54 AM
Its solved now.
The problem was probably that the VDDA pin did not get power one time when i powered up the uc, because i de-soldered to much of my PCB. I think the PLL broke because of that.. Voltage at all pins looked fine, when i measured last time.
In the end, when i could not think of anything else, i replaced the STM32 with a new one, and now it is working.
Thanks a lot guys! I really appreciated your help!
2018-06-30 02:52 PM
''Hardware watchdog'' enabled in options?
JW
2018-07-01 07:58 AM
Thanks, it was indeed not checked. Now the NRST pin is not triggered anymore while program is running.
But i get error message in System Workbench, if i try to program/debug: 'Error erasing flash with vFlashErase packet'
It is still possible to program with the ST-Link Utility. It then show that the MCU Core is Running.
My program toggles a LED in a while loop. This doesn't happen, so i think it is stuck again in the infinite loop.
2018-07-01 09:04 AM
But i get error message in System Workbench, if i try to program/debug: 'Error erasing flash with vFlashErase packet'
I don't use System Workbench.
Generally, you can't have simultaneously connected STLink-Utility and the IDE.
Also, check all other option bits. The WDG-SW in a fresh chip is not set to 'hardware' watchdog, so some of the tools you are using has set it - and I'd suspect the IDE first. Thus it might have set other unexpected option bits, too.
JW
2018-07-01 09:38 AM
2018-07-01 10:14 AM
>> it ends up in an infinite loop
It would end up in the Default Handler if you enable an interrupt and haven't supplied the IRQHandler that's supposed to service it.
Check the .MAP file for what IRQHandlers
Check stm32f0xx_it.c
2018-07-02 04:32 AM
STM32 still resets..
This happens after executing ''__HAL_RCC_PLL_ENABLE();''
Does not matter if HSE or HSI is selected as input source of PLL. Without using PLL, STM32 runs fine.
2018-07-02 06:24 AM
Thanks, it turned out that 'Generate IRQ handler'check boxes in NVIC settings were not set in CubeMX..
2018-07-02 06:43 AM
>>STM32 still resets..
I'm not super familiar with your design, I'd probably double check the board for shorts, or the supply otherwise browning-out, and try and correlate that with the NRST.
I've not seen F0 parts do this, but I'm also not using CubeMX to write my code. If it really is the IWDG the code is going to be in the project somewhere. Might selectively remove the supporting library code from the project and IWDG from the stm32f0xx_hal_conf.h file.
2018-07-02 07:36 AM
FLASH latency setting?
JW