Skip to main content
JJRR
Associate III
March 14, 2022
Solved

STM32L083RBTx unexpected periodic reset

  • March 14, 2022
  • 13 replies
  • 2957 views

Hi,

I can see weird behaviour on my STM32L083RBT6. Do not know where to start - I will try:

  • When I run my app with Window WD - everything works fine
  • When I run my app with Window WD disabled - not every start of my app (power on by inserting battery) starts up corectly - it means the app remains stuck in unknown place (in time < 100 ms after power on)
  • When I continue to toogle battery connecting (power on -> power off), so about after 20 cycles the mcu always starts up correctly but after about 500 ms the mcu always resets -> then starts up -> resets and again and again with period about 500 ms - from this moment it looks like the mcu is corrupted - Nothing like reflashing app (with or without WD) can save the mcu. In this state I tried to debug why the mcu resets - by reading the RCC->CSR register - but there is always bunch of set bits (WWDGRSTF, IWDRSTF, PORRSTF, PINRSTF, SFTRSTF) - so this feature probably does not work!

No voltage spikes captured on power pins during connecting and unconnecting battery.

I will be very grateful for any help.

This topic has been closed for replies.
Best answer by JJRR

0693W00000KdMtkQAF.png0693W00000KdMrBQAV.png 

So now It is clear. I had unchecked WDG_SW - it means the IWDG was activated by harware and this is why the reset occured.

What I do not understand is why this bit was unchecked.

13 replies

TDK
March 14, 2022

Clear the RCC->CSR bits after you read them.

If it's indicating a watchdog reset, that's likely the source of the reset.

Loading into the system bootloader or connecting under reset in STM32CubeProgrammer and erasing the flash will allow you to recover the chip.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JJRR
JJRRAuthor
Associate III
March 15, 2022

I also set BOR level to Level1 from code. But now I commented this settings.

BTW by reseting mcu the BOR level is resets to default state or do I need to do full erase of chip?

JJRR
JJRRAuthor
Associate III
March 14, 2022

Hi and thanks,

when I clear it so PINRSTF and IWDGRSTF are set after reset, But I have disabled RTC, LSI, and IWDG -then how could IWDG cause a reset?

TDK
March 14, 2022
IWDG may be enabled in the option bytes. Check using stm32cubeprogrammer.
"If you feel a post has answered your question, please click ""Accept as Solution""."
JJRR
JJRRAuthor
Associate III
March 15, 2022

When check IWDG - so by stm32CubeProgrammer is disabled. I can say that I do not modify any options byte in my code and I flash it only from STM32Ide by Jlink programmer. I do not really understand this behaviour :(

TDK
March 15, 2022

> Any idea what should I try next?

Not really. Sure looks like an IWDG reset to me. Perhaps it is being enabled somewhere that you're missing. Search your full project for IWDG to find instances where it may be used.

There are not glaring issues in the hardware, especially in IWDG. The answer is almost certainly in software.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MM..1
Super User
March 15, 2022

What IDE you use? Create new workspace and project with MX wizard. Build it maybe on other PC or IDE.

JJRR
JJRRAuthor
Associate III
March 17, 2022

Current state:

  • Tried to change IDE from STM32CubeIde to Atollic True studio, also I generated a new project from CubeMX to a new workspace - without any progress (on the same computer)
  • Tried to add to my code init and start of IWDG with the biggest divider and reload value - when I do it - the priod of reset is increased to about 5 seconds. When I do not init and do not start IWDG - the period of resseting is back on value about 500 ms.
  • Finally: without initialized IWDG I just tried to refresh IWDG - and it works - app runs without resets.

It looks like the IWDG is activated despite the factI didn't allow it?!?

TDK
March 17, 2022
Show a screenshot showing the IWDG is disabled in option bytes in STM32CubeProgrammer.
"If you feel a post has answered your question, please click ""Accept as Solution""."
JJRR
JJRRAuthorBest answer
Associate III
March 21, 2022

0693W00000KdMtkQAF.png0693W00000KdMrBQAV.png 

So now It is clear. I had unchecked WDG_SW - it means the IWDG was activated by harware and this is why the reset occured.

What I do not understand is why this bit was unchecked.

TDK
March 21, 2022

If IWDG_SW is unchecked, IWDG is enabled automatically by hardware and is causing your reset, as suspected in the very first reply to your post.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JJRR
JJRRAuthor
Associate III
March 21, 2022

Yes, Thank you very much. Now I understand it. The question fro me is why this bit was unchecked...