cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042F4P6 keeps resetting, IWDG ?

thomas versmissen
Associate II
Posted on June 30, 2018 at 23:23

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:

  • I Striped down my PCB; I removed the external oscillator and other IC's.
  • I soldered a brand new STM32 on my PCB (couple of times)
  • In CubeMX i made the most basic configuration possible.
  • I swapped the pull up resistor for a 4.7k and 10k resistor.

But still the STM32 keeps resetting..

Is there something i overlooked?

Many thanks,

Thomas

#clock #pll #stm32f042f4p6 #stm32f042f4 #iwdg #reset-reason #cubemx-4.23
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on July 08, 2018 at 16:54

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!

View solution in original post

15 REPLIES 15
Posted on June 30, 2018 at 23:52

''Hardware watchdog'' enabled in options?

0690X0000060LYuQAM.png

JW

Posted on July 01, 2018 at 14:58

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.

Posted on July 01, 2018 at 16:04

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

204241CGIL4
Posted on July 01, 2018 at 17:14

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

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
thomas versmissen
Associate II
Posted on July 02, 2018 at 13:32

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.

0690X00000604Y4QAI.jpg0690X00000604ipQAA.jpg
Posted on July 02, 2018 at 13:24

Thanks, it turned out that 'Generate IRQ handler'check boxes in NVIC settings were not set in CubeMX..

Posted on July 02, 2018 at 13:43

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

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on July 02, 2018 at 14:36

FLASH latency setting?

JW