1
\$\begingroup\$

I've created a board using the STM32F405R6T6.

I am experiencing some problems: after I program the firmware onto the microcontroller, withdraw the power and reinsert, the firmware only starts to run when I press the reset button.

In the debug configuration it works: I program the chip and the code starts running. But when I program the release-configuration code I need to press the reset button.

I think it might be something related to the bootloader circuit, or even the proximity of reset capacitor. I've attached the circuits below, if someone has already gone through it or has a hint how could solve the problem, I'll be extremely grateful.

Sometimes during programming it also gives the following error "error erasing flash with vflasherase packet". Sometimes the error disappeared when activating boot, but not always.

enter image description here

enter image description here

enter image description here

SOLUTION:I found the problem. I currently have a switched source (L7981A) that converts the input voltage. The time for the voltage to go from 0V to 3.3V was 35ms (I looked at the oscilloscope). Removing this switched source and externally feeding system works perfectly. I'll have to rethink the source with the L7981 and see why it takes so long to get to the output voltage.

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ Sounds like a powerup issue, maybe MCU supply turns on too slowly? Also your reset circuit is not according to suggested circuit and might release the MCU from reset too soon. Also check that BOOT0 jumper j1 is removed and nothing drives the SET_BOOT node high as the cap charges faster than it is discharged with those resistor values. \$\endgroup\$ – Justme Mar 22 at 15:06
  • \$\begingroup\$ A high capacitance at the power line could lead to a long startup time \$\endgroup\$ – Sim Son Mar 25 at 16:56
  • \$\begingroup\$ I remember that I had a similar problem once. I solved it by adding a delay of some ms right before initialization. Maybe this helps... \$\endgroup\$ – Sim Son Mar 25 at 16:58
2
\$\begingroup\$

As you have discovered, this is a power-up issue. The 3.3V rail is taking too long to come up to full voltage.

There are two main problems causing this delay:

  1. Your power is being converted three times: Vin -> 7V -> 5V -> 3.3V. Each converter takes some time to initialize, and these times add up.

  2. There is a lot of capacitance on your power rails: 200uF on Vin, over 400uF on the 7V rail, and more than 1100uF on 5V. These take a long time to charge.

Ideally, you would derive each voltage directly from Vin. Not only will it improve the power timing, it will also be much more efficient. If we assume that each conversion is 90% efficient, then your existing method gives (0.9 * 0.9 * 0.9) = 72.9% efficiency on the 3.3V rail.

Without changing your PCB, the only real solution is to minimize these capacitances. You'll probably have to change L2 at the same time. This may not work for your circuit; only you know your design constraints.

Good luck!

\$\endgroup\$
1
\$\begingroup\$

Another solution to this sort of problem is a power supervisor chip. I added one of these to one of my projects as a security measure. The part I used is the MIC803-31D2VM3. It is a SOT23-3 with one pin connect each to the supply rail, ground and !RESET. It's an open-collector part and holds it's output (!RESET) low until the supply rail rises above a threshold voltage, and then holds it just a bit longer just to be sure.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.