STM32 Cube project works on one STM32L062 but not another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 12:20 PM
Hello-
We are working with two different boards for the STM32L062, schematics of which I have attached. The first is a bare-bones development board for general testing and the second is our product. I have a Cube32MX project that enables the features we need the product to use and toggles a GPIO pin every 2 seconds so there is something to measure indicating the code is running. The issue we're having is that the code runs correctly on the development board, but on our product the code not only doesn't run but most or all of the GPIO pins appear to output logic HIGH. I've tried commenting out the peripheral init() functions from the Cube project so that only the GPIO code should be running, but to no effect. I can't see any non-standard wiring on our product's schematic that would raise any kind of issues. Note that although our schematic shows an oscillator Y1 attached to the chip, this and the two capacitors have been removed. Clearly something on our product design is causing this issue, but then what is it?
Solved! Go to Solution.
- Labels:
-
GPIO-EXTI
-
STM32CubeMX
-
STM32L0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 1:07 PM
Pull BOOT0 LOW
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 1:07 PM
Pull BOOT0 LOW
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 2:30 PM
We've done that too, thanks for mentioning it I forgot to discuss that part. On our product board we pulled R32 and populated R28. On the other dev board I have a wired connection to tie BOOT0 to ground.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 2:38 PM
Have you tried the debugger, turning off "run to main()" and stepping the code inward.
Make sure to have Hard Fault Handler and Error Handler output actionable data rather than die silently in while(1) loops.
Make sure clocks and PLL's start properly.
Check auto/local variables/structures initialize properly to prevent erratic behaviour.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-13 11:47 AM
After some additional checking it did turn out to be a BOOT0 issue. We had a solder bridge across R28 to tie that pin LOW. When running our code the USB would enumerate but the outputs on the other GPIO pins would be incorrect (showing 3V3 even on pins set to be input) so this didn't seem like a BOOT0 issue, but after doing a reflow and adding more solder to the R28 solder bridge things started working correctly.
