In the process of developing and debugging applications using STM32 microcontrollers, we often encounter various anomalies. A significant portion of these issues are related to the power supply. The power supply is critical and essential for any electronic product, yet during actual development and debugging, we sometimes inadvertently neglect it. Here, I share a few practical cases to enhance understanding and deepen the impression.
After all, there are numerous anomalies that may arise due to power supply issues. Sharing a few cases here serves as a starting point, hoping everyone will pay attention to the power supply during debugging. Personally, I believe that anomalies caused by power supply issues are often not easy to analyze; in most cases, they manifest in a more strange or chaotic manner. 【Note: The anomalies mentioned in the cases below are all related to the power supply, but this does not mean that similar anomalies are necessarily caused by the power supply.】
Below, I mainly share a few cases based on STM32 applications.
Case 1: ADC Function Anomaly.
A user discovered that the ADC data was completely incorrect when using the ADC function of the STM32 chip. After repeatedly checking the power supply, ADC hardware wiring, and verifying the ADC-related software configuration, the problem remained unresolved, leading to frustration. Eventually, upon checking the connections of the chip’s power pins one by one, it was found that VDDA was not connected to the power supply.
Case 2: The PLL of the STM32 chip cannot operate normally.
A user developing a product with the STM32F373 found that the PLL could not operate normally when activated. If the PLL was not running, there were no issues with basic HSI or HSE operation. Initially suspecting a software configuration issue, even testing with ST’s official standard library and CUBE library examples still encountered problems. After preliminary confirmation and checks, the power supply was stable, and there was a suspicion about the chip quality. After repeated comparisons and tests, it was later discovered that one of the VDDA pins of the MCU chip was floating; connecting it to the power supply resolved the issue, as the normal operation of the PLL also relies on the power supply from VDDA.
Case 3: GPIO connected to the VBUS pin of the USB host is prone to damage.
A customer reported that a certain pin of the STM32 chip exhibited abnormal voltage levels after being used for a while, which was later confirmed to be damaged. The general usage situation is shown in the schematic below:
The STM32 chip draws power from the external USB host’s VBUS. The external VBUS power supply is regulated by an LDO before powering the STM32 MCU, while another GPIO [PA9] of the MCU is directly connected to the external VBUS.
This circuit seems to have no issues at first glance. However, since the external VBUS 5V power supply must go through an LDO before supplying the MCU, there is a delay, while GPIO PA9 is directly connected to VBUS. This leads to a situation where, for a certain period after connecting the USB plug, VDD=0V, and GPIO PA9’s Vin=5V, resulting in VIN[5V] > (VDD + 4.0V), exceeding the maximum input voltage specified in the MCU chip’s datasheet for the corresponding GPIO.
Therefore, during development and debugging, it is crucial to adhere to the various power characteristics and parameters of the chip.
Case 4: Function anomalies when migrating from STM32F1 series chips to STM32F4.
An engineer once reported that the STM32F1 series chip worked fine, but after switching to STM32F2 or STM32F4 chips due to product requirements, the chip could not operate normally, even the simplest programs could not run smoothly. It was later discovered that some anomalies stemmed from the user’s failure to handle the VCAP pin. The STM32F1 series chips do not have external VCAP pins, while the F2/F4 series chips do; these pins require external capacitors to be connected to ground to ensure stable core power supply. 【Some STM8 chips also have VCAP pins】
Case 5: JLINK cannot connect to the STM32 target board.
A user was using J-LINK to debug a board with the STM32F071 chip and attempted to connect via SWD, with the target board already powered. However, regardless of whether using J-FLASH or MDK, JLINK could not connect to the target board.
After checking the four connection lines of SWD: VDD, SWDIO, SWCLK, GND, no problems were found. Concerned about potential issues with the J-LINK driver version, it was suggested to use STLINK for connection; however, even using ST’s official STLINK UTILITY software could not connect to the target board. The customer was advised to verify the power and pin connections of the MCU chip, and it was finally discovered that a power pin responsible for supplying power to the GPIO, VDDIO, was floating. Connecting it to the power supply resolved the connection issue.
Note: In the STM32 series, some chips have not only VDD, VDDA, VDD_USB but also a dedicated VDDIO power pin. In this case, the customer migrated from the STM32F1 series product, which does not have a VDDIO power pin, so during the design of the hardware when migrating to the STM32F0 chip, this VDDIO pin was overlooked.
By the way, overall, the compatibility of software and hardware between different STM32 series is quite high, especially in terms of hardware pin compatibility. The differences in pin arrangements with the same number of pins among different series mostly reflect in the pins related to power supply, which should be particularly noted. Additionally, some STM8 chips also have this VDDIO pin.
Case 6: STM32 chips occasionally burn out.
There have been reports of STM32 main chips failing occasionally during product development. After several tests, it was found that the quality of the power supply chip at the front end was poor, leading to abnormal output from a certain percentage of power supply output devices, which harmed the STM32 and affected the functionality of the entire product.
These cases are simply listed as reminders. While it seems easy to write these few sentences here, it is often not so easy to find the cause before it is identified, and sometimes it may take a long time to resolve the problem.
====================================
1. Download various localized materials for STM32
2. Implementation of QuadSPI external serial NOR Flash
3. A topic related to DMA anomalies concerning memory allocation
4. Analysis of RTC issues not working under low temperatures in certain products
5. Ways and means to obtain ST MCU technical materials and related support