Electronic – STM32F4 doesn’t boot after reset and enables read out protection

resetstm32stm32f4

Sometimes my STM32F4 board doesn't boot after a power-off, power-on reset. All voltages are fine, but the code does not execute. What is interesting, when I connect to the board with ST-link utility, it shows me that there is read out protection enabled (although I didn't enable it). BOOT0 pin is connected to the ground via 10k resistor, decoupling seems OK.

What can be causing this issue? From what I have read in reference manual page 92, to change option bytes, first one should write two specific key values to two different registers. That seems to be very unlikely to happen by accident even once, and my issue appears once every several dozens of resets.

Best Answer

Here are a few thoughts on what you can try or improve:

  1. Stability of the power supply: when the STM powers up, it needs more power compared to normal operation. Can your power supply these ~100mA? Under and over voltage causes resets or strange behavior.
  2. Reset should be connected to 3.3V via a 10kOhm resistor
  3. Boot0 should be connected to GND via a 10kOhm resistor
  4. Crystal should work correct: we use 22pF capacitors for a 8MHz crystal. If it's mismatched there can be temperature dependency, perhaps the explanation for your problem. Also soldering issues within the crystal circuit are likely to fail sometimes.