The programming reset options include soft reset, hard reset, factory reset, and system restore, each serving different purposes for troubleshooting and recovery.
Resetting systems, devices, or software is a common troubleshooting step in programming. Understanding different reset options helps developers solve issues efficiently. This guide covers all major reset types with practical examples.
Types of Programming Resets
1. Factory Reset
A factory reset restores a device to its original state. This erases all user data and custom settings.
- Common in IoT devices like smart thermostats
- Implemented through physical buttons or software commands
- Example: `system.restoreFactoryDefaults()` in embedded systems
2. Soft Reset
A soft reset restarts the system without power cycling. It maintains some state information.
- Used in microcontrollers like STM32
- Preserves RAM contents if configured
- Example: `NVIC_SystemReset()` in ARM Cortex
3. Hard Reset
A hard reset completely powers down the system before restarting.
- Required for water heater controllers after firmware updates
- Ensures clean state for critical systems
- Example: Power cycling industrial PLCs
Reset Implementation Examples
Web Browser Resets
Internet Explorer reset can be automated through command line:
RunDll32.exe InetCpl.cpl,ResetIEtoDefaults
For PowerShell automation, see Microsoft’s script examples.
Microcontroller Resets
STM32 option byte programming requires special handling:
- Check RDP level status
- Program option bytes
- Call HAL_FLASH_OB_Launch()
- Power cycle for JTAG-protected devices
Advanced Reset Techniques
Watchdog Timers
Watchdog timers automatically reset systems that stop responding:
Type | Timeout Range | Use Case |
---|---|---|
Hardware WDT | 100ms-10s | Critical systems |
Software WDT | 1s-60s | Application monitoring |
Reset Vector Handling
Proper reset vector setup ensures clean startup:
void Reset_Handler(void) {
// Initialize data sections
// Clear BSS
// Call SystemInit()
// Jump to main()
}
Troubleshooting Reset Issues
Common Problems
- JTAG lockup after RDP programming (requires power cycle)
- Incomplete peripheral reset (check RCC registers)
- Watchdog false triggers (adjust timeout values)
Debugging Tips
For STM32 devices, use:
- Debugger connection before RDP enable
- Serial console output
- LED indicators for reset state
For more on hardware resets, see pool heater control systems that implement robust reset mechanisms.