226.My board does not work, what now?
Bringing up a new board with STM32 may sometimes be frustrating. However, following certain good practices may increase the sucess rate in doing so:
- follow basic good practices in desigining circuits and PCBs. Don't forget, that STM32 are high speed digital circuits and their supply voltage require adequate decoupling. Don't neglect the grounding arrangement, using 4-layer (or more) PCB with dedicated ground layers usually leads to more successful design.
- every STM32 family has a Getting started with STM32xxxx MCU hardware development application note, you will find it in your STM32's web folder. Follow recommendations therein.
- if a crystal is used, design its circuit according to AN2867 (including the layout recommendations)
- make sure the proper chip you've designed for is used indeed, note that sometimes it's only the suffix which distinguishes variants of chips (with substantial differences in pinouts).
- make sure the chip is populated with proper orientation.
- check, if the power supplies have the proper voltages and are rock stable and ripple/noise-free
- make sure all basic pins are properly connected; measure directly on the pins (to exclude bad solder joints and/or shorts).
- check proper working of your programming/debugging arrangement on a "known good" board such as Nucleo or Disco.
- have a "blinky" prepared on a "known good" board such as Nucleo or Disco, to have the first program known running properly (and check if the given pin is connected properly to expected output/LED, again by measuring directly on the pin).
- don't forget that some STM32 require a power cycle after first programming.
- if some hardware functionality does not work, try again if its pin is properly connected and there are no bad solder joints and shorts to neighbouring pins and signals. Again, measure directly on the pin. A good test for this - if the surrounding circuit allows it - is to set given pin as GPIO Output and toggling it as in the "blinky".
- if some hardware functionality does not work, read out and check its (and related GPIO's) registers content (e.g. using debugger). Don't forget, that the chip does not work out of sources nor "libraries"; it works out of its registers.