2025-02-10 04:12 PM
My controller uses the STM32U575 chip. I followed the recommended design for the SMPS using the same inductor and XR7 capacitors as recommended in the reference design. I built up 4 boards, the first three boards worked properly without issue. After reset, I switch from the LDO to the SMPS using the same code as is used in the various examples. No issues with 3 of the boards. On the 4th board, the wait loop for regulator ready after enabling the SMPS times out. I added code to switch back to the LDO if this happens and display a message that the SMPS has a problem (via the serial port to my computer). The processor and code runs properly from the LDO, but uses more power which is an issue as this is a battery operated device.
The power to the chip is a regulated 3.3v. I tried replacing the inductor, problem still exists. Not much to the circuit. I have the two 2.2uF caps placed next to the pins 49 and 98 (using the 100 pin LQFP package). After reset, to save power, I program the CPU clock to run at 24mhz, which switches to higher speeds when needed. The voltage is 1 volt when running at 24mhz, 1.2v when running at 160mhz, which is correct according to the data sheet. The following is the loop that times out. So the SMPS seems to be working, but the check for the regulator being ready is not occurring only on this one board.
Any suggestions what to check or modify? or does this indicate that something is defective in the CPU chip?
/* Switch to SMPS regulator instead of LDO */
BadSMPSFlag = 0; /* assume good */
MODIFY_REG(PWR->CR3, PWR_CR3_REGSEL, LL_PWR_SMPS_SUPPLY);
i = 250000; /* at 4mhz should timeout at 3 seconds */
while (LL_PWR_IsActiveFlag_REGULATOR() != 1)
{
if (--i == 0)
{
BadSMPSFlag = 1;
MODIFY_REG(PWR->CR3, PWR_CR3_REGSEL, LL_PWR_LDO_SUPPLY); /* switch back to LDO */
break;
}
}
2025-02-10 04:22 PM - edited 2025-02-10 04:24 PM
A clarification to my previous post. My timeout will wait 3 seconds before aborting and switching back to the LDO. During that 3 second window, where the CPU is running at its default 4mhz after reset, the voltage is 0.9v, then switches to 1 volt or 1.2volt depending whether the program is in the 24mhz mode or the 160mhz mode. If it times out then obviously this is from the LDO not the SMPS, I measured the same voltage characteristics on the working boards which are using the SMPS.