cancel
Showing results for 
Search instead for 
Did you mean: 

How to conduct a STM32 self-schematic review PT. 2

Stefanie LAU
ST Employee

What are the recommended steps to take when reviewing my custom STM32 schematic design?  

In this two-part article we will cover several main areas of focus when conducting a self-review of a custom STM32 schematic and share some hardware debugging tips.
If you haven’t yet reviewed the first part of this article, we highly encourage you to begin there. You can find part one
here.
In total, there are seven key areas to consider when conducting your STM32 schematic review:
  1. Pinout / Alternate Functions
  2. Power
  3. Clocks
  4. Debug
  5. Boot
  6. Reset
  7. 5V-Tolerant Pins
In part two we’ll wrap up this STM32 self-review series by covering sections V through VII and conclude with sharing some debugging tips and tricks.


5. Boot

During your review, it’s important to check that the proper boot configuration is selected. We will take the STM32F746 as an example, the boot modes table for this specific device can be found in the reference manual. Using this table, we see that the configuration of the BOOT0 pin and the boot base address programmed in BOOT_ADD0 or BOOT_ADD1 will determine whether the device boots from internal flash or the system bootloader. If choosing to boot from the system bootloader, we would then need to reference AN2606 to review the list of supported peripherals that can be used to update the internal flash when booting from the system bootloader.
995.png
Each STM32 series is unique and may have different mappings for system memory, therefore it's always a good idea to double check that you are using the proper IOs for system memory. another point to consider, is that some STM32 devices may have a BOOT1 pin and fixed boot addresses. For example, the STM32F103 has both a BOOT0 and BOOT1 pin. These two pins' states combination will determine whether the STM32 boots from main flash memory, system memory or embedded SRAM. As a rule of thumb, always refer to your respective STM32 device's reference manual and corresponding AN2606 section for further details. 
996.png
998.png

6. Reset

This is a simplified diagram of the reset circuit inside the STM32, however newer parts may have revised this internal circuit so always make sure to double check your STM32’s datasheet.
The NRST pin is a bidirectional pin; this means that you have the option of resetting the STM32 from an external source or this pin can also generate a result pulse output whenever there is an internal reset. With that in mind, here are some points to consider:
1000.png
  • Typically, there is no need for an external pull-up resistor because there is already an internal pull-up resistor embedded. For resistor values, refer to the NRST pin characteristics table in your STM32’s datasheet.
1001.png
  • If there is any reset pin drive, make sure that it is done in an open drain manner rather than push-pull due to internal reset sources. A somewhat common issue seen is that an external device or reset controller is configured as push-pull which leads to preventing the NRST from being asserted by the debugger or the STM32
  • The capacitance on the NRST pin should typically not exceed 0.1 uF. Too much capacitance will prevent the STM32 internally generated resets from pulling the line low enough to reset the part.
1002.png

7. 5V-Tolerant Pins 

The STM32s have the capability to support pins that are 5V-tolerant. As each device is unique, we always recommend to double check 5V-tolerant capability on the pin(s) you plan to interface with any external 5V logic.
Start by locating the abbreviation used to indicate a pin’s 5V tolerance. This information may be present in the datasheet in the pin definition table as a footnote or separately in the legend and abbreviation table. Here, we see that FT stands for 5V tolerance. Looking at the pin definition table, there is an I/O level column that helps us in identifying if the pin is 5V tolerant.
1003.png

Please remember to consider the following points when interfacing your STM32 with external components and 5V logic.
  • Make note of the absolute maximum rating tables available in the STM32’s datasheet, particularly the maximum voltage and current limits of each pin and overall microcontroller.
1004.png
  • Configure the GPIO on the STM32 as open-drain and disable the internal pull-up/pull-down resistor present when interfacing with external 5V logic.

Hardware Debugging Tips and Tricks

  • Microcontroller Clock Output (MCO)
    • Bringing the microcontroller's clock output signal to a header pin can be helpful in determining your selected clock frequencies when debugging. 
    • This can also be helpful in determining when a low power mode is actually entered (clock gets shut down) and when the low power mode is exited (clock will restart). This can help provide some additional timing related information in relation to an oscillator starting. Note that using this method may be slightly more reliable in terms of timing as this oscillator bring up happens a little sooner compared to having code run to toggle a pin, however you may consider implementing both methods. 
  • NRST 
    • Bringing the signal out to a header pin can be helpful to tell if the device was reset externally or internally (note that this depends on devices that bring the internally generated reset signal out to the pin) 
  • UART TX/RX 
    • Bringing out signals for a UART are helpful to provide debug or status messages 
  • Unused GPIOs
    • Having a couple of unused GPIO signals on easily accessible header pins can help when debugging certain issues including, but not limited to timing, place in code, and low power modes.
  • Current Measurements
    • Being able to only measure the microcontroller’s current takes some of the guess work out of determining if it is the STM32 of some other device on the board consuming current. Having a place to solely measure the STM32’s current can be of great assistance when adding or debugging low power modes.
    • Some of the recommended current measurement tools are:
      • Ammeter
  • SWV (Serial Wire Viewer) 
    • Most devices support the SWV feature, enabling this feature within the debugger can provide additional debug information when required. 
    • This topic is further discussed and demonstrated in our six part STM32CubeIDE Advanced Debug Features series 
  • ETM (Embedded Trace Macrocell) 
    • Bringing the ETM signals out to pads for a connector can be useful if a tricky functional issue appears. This connector can be populated, allowing an ETM trace device to be used which will significantly help reduce the time spent debugging. 

    Relevant Links and Documentation: 

     
    Comments
    BarryWhit
    Lead II

    Since this article was posted in 2021, ST has released the STLINK-V3PWR which specializes in power consumption measurement, with sufficient accuracy even in low-power modes.

    Version history
    Last update:
    ‎2021-12-20 03:04 AM
    Updated by: