cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L083RBTx unexpected periodic reset

JJRR
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

13 REPLIES 13
TDK
Guru

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
Senior

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?

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

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

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?

Current status:

0) I erased the periodically reseting mcu from cubeProgrammer.

1) I flashed it by a simple app - just init clocks and the empty while loop.

2) The mcu still keeps resetting with same period (about 500 ms)

3) Added clearing RESETS flag in RCC->CSR reg.

4) The resets flag after reset are IWDG RST and PIN RST

5) The mcu still keeps resetting with same period (about 500 ms)

Any idea what should I try next?

Thank you.

TDK
Guru

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

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

JJRR
Senior

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