STM32L051K8U won't run without 3V when it should run at 1.65V - Page 1
Forum section: electronics / general

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 03:01:18 pm
content: I've just switched the MCU from a STM32L021K4T to STM32L051K8U and have a problem I can't figure out.My circuit is powered by a CR2032 into a 2V LDO regulator and the original MCU (STM32L021K4T) ran perfectly with no problems. But the new MCU (STM32L051K8U) won't run without 3V, even though it say it runs down to 1.65V.I've tried going through the datasheet to see if there some thing I need to set, but I'm at a loss.Any ideas?Thanks.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 30, 2019, 03:12:59 pm
content: What's your CPU clock frequency?I suggest looking at the "dynamic voltage scaling" parameter and its implications.

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 03:16:26 pm
content: Quote from: SiliconWizard on October 30, 2019, 03:12:59 pmI'm running it at 4.194MHzWould I find the dynamic voltage scaling in the datasheet or reference manual?Thanks

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 30, 2019, 03:27:58 pm
content: Look up "dynamic voltage scaling" in the datasheet. It's note very detailed, so you may also want to look that up in the reference manual. The lowest power "range 3" should be OK with the CPU running at up to 4.2MHz though (p.14 of the datasheet), so whatever the range setting, it should be fine.Have you looked at your power rails with a scope?

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 03:36:46 pm
content: Quote from: SiliconWizard on October 30, 2019, 03:27:58 pmThanks, I'll give that a read.And, no I haven't looked at the rails with my scope yet. I just moved and still haven't set it up. But the curious thing is, it's the exact same board as with the original chip which ran fine.

author: AndyC_772
author_rank: Super Contributor
timestamp: October 30, 2019, 03:40:07 pm
content: Does that particular device have a brown-out detector? What's it set to? (Check the option bytes with the ST-Link utility).I've managed to brick an STM32 based product by taking code designed to run on a 3.3V powered platform, and porting it to a newer variant which runs the chip at 2.5V. If the brown-out detect voltage is set too near (or above) the value of VCC, it'll hold the CPU in reset - and it looks as though the CPU is fried.

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 03:53:40 pm
content: Quote from: AndyC_772 on October 30, 2019, 03:40:07 pmIt's set at 0 "BOR Level OFF, reset level threshold the 1.45V,-1.55V" and I just tried it a 8 "BOR Level 1, reset level threshold for 1.69V-1.8V"

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 30, 2019, 03:53:53 pm
content: The BOR would be something to check here indeed.You can set it with the option bytes. The default BOR config (enabled/disabled and threshold) may be different in those two chips, either because they have different factory values, or because the chips were not completely blank when you bought them.You can read this with the programming tool you're using. Then you can first disable BOR entirely to check that it was indeed the culprit. You can then furter re-enable it and set a sensible threshold (I would set it as the "threshold 0" value, which is the only one that would work reliably for 2V IMO.

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 04:18:01 pm
content: Quote from: SiliconWizard on October 30, 2019, 03:53:53 pmI just tried it at level 2, still no go.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 30, 2019, 04:21:50 pm
content: You certainly shouldn't increase the threshold, it will make things worse. Have you tried completely disabling BOR?

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 04:43:10 pm
content: Quote from: SiliconWizard on October 30, 2019, 04:21:50 pmYeah, it was (and is back to) 0 "BOR level OFF, reset level threshold tha 1.45V-1.55V"

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 07:27:43 pm
content: I just hooked up my scope and the voltage rail after the regulator is 2V with a ripple of +/- 1mV.

author: AndyC_772
author_rank: Super Contributor
timestamp: October 30, 2019, 07:50:28 pm
content: When you say it "won't run", does that mean it won't start executing code at all, or that it stops somewhere?Are you able to hook it up to a debugger and single step it from the reset vector onwards?Could it be that it does actually start OK, but that there's something it does during start-up which fails and causes the CPU to freeze?

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 08:20:47 pm
content: Quote from: AndyC_772 on October 30, 2019, 07:50:28 pmTo the best of my ability to tell, it never starts executing code. With the CR2032 in and the voltage being regulated to 2V, I can't connect to the chip with my debugger (I think it's because the debugger needs to see the chips voltage at ~3V). Sorry, if I didn't answer your question. I'm still pretty new to these. I appreciate the help though!But, with the previous chip, what I'd do was program it with the 3V from my programmer. After it's programmed, I could disconnect and put int the CR2032 and it starts running.With the new chip, I can program it the same way. But when I disconnect the programmer and put int the battery, nothing happens. I've bypassed the regulator and supplied the chip directly with the CR2032 and it works. Just not with the 2V from the regulator, when the previous chip worked (exact same board layout and parts).So, it seems like to me that there is some option bit or clock configuration or something like that, that I have misconfigured. But I can't find anything wrong and anything seems related, when changed doesn't fix the problem.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: October 30, 2019, 10:30:23 pm
content: Quote from: evglabs on October 30, 2019, 08:20:47 pmHave you tried running it from a power supply with the LDO bypassed, beginning at 3 V so the chip starts and then lowering the voltage? That may identify the threshold voltage, and also if the problem is startup-only or occurs during normal operation.

author: evglabs
author_rank: Contributor
timestamp: October 30, 2019, 10:35:17 pm
content: Quote from: I wanted a rude username on October 30, 2019, 10:30:23 pmNo, I haven't. That'd be a good idea, but I don't have an adjustable power supply (but I could whip one up with a 317).

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: October 30, 2019, 10:41:43 pm
content: Quote from: evglabs on October 30, 2019, 10:35:17 pmOr even one or more diodes (preferably Schottky) in series, each shorted with an alligator clip, so you can remove the clips one at a time.

author: jackthomson41
author_rank: Regular Contributor
timestamp: October 31, 2019, 01:24:24 am
content: Instead ofSchottky diode, you should go withZener diode, works better and yeahLM317is an excellent voltage regulator, use heat sink with it.