STM32L083RBTx unexpected periodic reset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 8:42 AM
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.
Solved! Go to Solution.
- Labels:
-
STM32L0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-21 2:28 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 9:28 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 1:12 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 1:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-15 3:05 AM
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 :(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-15 7:11 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-15 7:53 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-15 8:53 AM
> 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-15 9:19 AM
What IDE you use? Create new workspace and project with MX wizard. Build it maybe on other PC or IDE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-17 1:44 PM
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?!?
