MCU Cold Start vs. Warm Start

When doing embedded development, we often say ‘restart’.But this ‘reboot’ may be a complete power outage before powering it back on. It could also be just a watchdog pulling the MCU back to the reset port. On the surface, in both cases, the startup code will eventually be executed. The actual hardware status left behind is different. Many problems that only occur sporadically on site and disappear upon returning to the laboratory are hidden within this difference.

What is MCU cold start?

MCU cold start usually refers to the chip being powered on from a state of no power supply or a power supply below the effective operating range. After the power supply voltage climbs, the power-on reset circuit keeps the chip in a reset state; When the voltage and clock meet the conditions, the processor starts executing from the reset vector. Cold start does not mean ‘all content is absolutely reset’.Ordinary SRAM generally cannot guarantee retention, but backup domain RTC, external flash, and devices with independent power sources may still store data. Specific actions must refer to the chip reference manual. We cannot draw conclusions based solely on experience.

What is MCU hot start?

A hot start is a restart that occurs while the power supply is still active. Common trigger sources include software reset, watchdog timeout, external reset pin, and partial abnormal reset. The CPU will restart the startup process, but the power domain has not completely lost power. Therefore, some RAM contents, peripheral registers, or external device states may still be present.

This is also the easiest place to step on a hot start: The program ran from scratch. The system may not truly ‘return to factory state’.For example, after an MCU reset, the serial port is reinitialized, and the external communication module is still stuck in the previous session. The state machines of both parties may not match.

MCU Cold Start and Hot Start Flow Chart

MCU Cold Start and Hot Start Flow Chart

The main difference between cold start and hot start

Comparison Cold Start Warm Start
Typical Trigger Power cycle Watchdog, software reset, or NRST pin
Power Domains Powered down and re-established Usually remain powered blindly
RAM State Generally not reliable May persist. but must not be trusted
External Devices Often restart with the MCU May remain in their previous state
Startup Time Usually longer Usually shorter
Main Risks Voltage ramp, oscillator startup, and undervoltage Stale state, incomplete reset, and communication desynchronization

How should startup code be designed?

The first thing is to save the reset reason as soon as possible. Most MCUs provide power-on, undervoltage, watchdog, and software reset flags. If the program clears these flags from the beginning, the subsequent logs will only have one sentence left: ‘The device has been restarted. The real reason has been lost.

The second thing is to make initialization repeatable.GPIO should first enter a safe level; enable power output again; Communication peripherals need to clear their status and cache; DMA. The interrupt and timer activation sequence should be fixed. For loads such as motors, relays, and heaters, the default voltage level during the reset period is particularly important. We cannot wait until the main loop starts running before processing.

The third thing is to manage external devices. If the communication module, sensor, or driver chip does not reset along with the MCU, the software should provide state detection, re-handshake, and timeout recovery. If necessary, add independent reset pins or controllable power supplies. Enable the controller to bring external components back to a known state.

Why does the device only malfunction after a hot start

When encountering such a problem, I usually check three items first: Is the reset reason register correctly recorded? Does the initialization of the peripheral depend on the previous state, and have the external components truly reset? Then compare the cold start and hot start logs, including clock configuration, key registers, communication handshake, and state machine entry.

There is also a common misjudgment: The power supply experienced a brief drop, the MCU has been reset, but the peripheral did not power down. It looks like a cold start; the actual behavior is closer to a hot start. To solve such problems, in addition to software recovery, also check the undervoltage reset threshold, power hold time, and reset timing of each device.

Update cookies preferences
WhatsApp

Get a Quick Quote!

x

    Get a Quick Quote!

    x