2026-02-07 9:08 AM
Hi everyone,
I am working on a project using the STM32F103CB MCU and implementing Standby (low-power) mode in the firmware. Development is done using Arduino IDE v2.3.2. I want the standby mode to be implemented to reduce the current consumption since my device is battery-operated.
The firmware flow is as follows:
On power-up, setup() runs.
In loop(), if the reset reason is a power-on reset, the device enters Standby mode.
The MCU wakes up from Standby via an interrupt on PA0 (Wakeup Pin).
Execution flow and timing are monitored using the Serial Monitor.
With the same firmware and library versions, I am observing different behaviour on two PCBs that:
Have identical schematics
Are manufactured by the same vendor
Without Standby mode implemented, both PCBs behave correctly.
With Standby mode enabled:
Serial prints before entering Standby appear correctly.
After waking from Standby:
One PCB works as expected.
The other PCB shows:
Garbage characters in the Serial Monitor
Significantly extended timing
Example: a programmed delay(30 seconds) takes approximately 1 minute 10 seconds
All timing sources (delay(), millis(), etc.) appear slowed down
No external crystal or clock source is used.
The project relies only on the internal clock (HSI).
Clock information (SystemCoreClock, RCC registers) is printed after reset.
From the serial output:
Clocks appear correct after a power-cycle reset
Clocks appear to be incorrect or degraded after waking from Standby on the problematic PCB
I am attaching the test code used to reproduce the issue (shown below for reference):
Case 1 – Problematic PCB
Serial output contains garbage after Standby wake-up
All timing functions run slower than expected
Case 2 – Proper PCB
Serial output and timing behave correctly
I have also included schematic diagrams for the power and controller circuits
Why would two PCBs with the same schematic and firmware exhibit different clock behavior after exiting Standby mode, leading to timing issues on one board?
What could cause the system clock to collapse or run slower after Standby on only one PCB, and how can this be fixed?
Please let me know if additional information, measurements, or logs are required from my side.
Thanks in advance for your help.