cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Cube project works on one STM32L062 but not another

Eqqman
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions

Pull BOOT0 LOW

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

Pull BOOT0 LOW

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Eqqman
Associate III

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.

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.