flipper-debug
Debug Flipper Zero applications and firmware issues
When & Why to Use This Skill
The flipper-debug skill is a specialized technical resource designed to streamline the troubleshooting and debugging process for Flipper Zero applications and firmware. It provides developers with actionable insights into the STM32WB55 and FreeRTOS environment, offering guidance on using Serial CLI tools, interpreting system logs, managing memory, and resolving complex hardware-software integration issues to ensure stable and efficient device performance.
Use Cases
- Case 1: Troubleshooting application crashes and stack overflows by analyzing memory usage and null pointer dereferences within the Flipper Zero environment.
- Case 2: Utilizing the Serial CLI and Furi log system to monitor real-time system state and identify intermittent logic errors during development.
- Case 3: Resolving GUI-related bugs, such as improper view dispatcher configurations or scene transition failures, to improve user interface stability.
- Case 4: Setting up advanced hardware debugging workflows using SWD, OpenOCD, and GDB for deep firmware-level analysis and signal verification.
| name | flipper-debug |
|---|---|
| description | Debug Flipper Zero applications and firmware issues |
| short-description | Troubleshoot and debug Flipper Zero development issues |
Flipper Debug
Debug Flipper Zero applications and firmware issues using available tools and techniques.
Context
- Flipper Zero runs on STM32WB55 microcontroller
- Uses FreeRTOS operating system
- Limited debugging capabilities compared to desktop development
- Serial console available via CLI
Debugging Tools
Serial CLI:
- Connect via
scripts/serial_cli.py - Use
logcommand to view system logs freecommand shows memory usagepsshows running processes
- Connect via
Log System:
FURI_LOG_E(TAG, "Error message"); FURI_LOG_W(TAG, "Warning message"); FURI_LOG_I(TAG, "Info message"); FURI_LOG_D(TAG, "Debug message");Memory Debugging:
- Use
memmgr_heap_printf_free_blocks()to check heap - Monitor stack usage with
furi_thread_get_stack_space() - Check for memory leaks with allocation tracking
- Use
Common Issues and Solutions
App Crashes:
- Check for null pointer dereferences
- Verify proper memory allocation/deallocation
- Ensure GUI elements are properly cleaned up
- Check stack overflow (increase stack_size in application.fam)
GUI Issues:
- Verify view_dispatcher is properly configured
- Check scene transitions and cleanup
- Ensure proper event handling
- Validate input parameters
Hardware Issues:
- Check GPIO pin configurations
- Verify SPI/I2C initialization
- Test with known working hardware
- Use oscilloscope for signal analysis
Debugging Process
- Reproduce the issue consistently
- Add logging at key points
- Check memory usage and leaks
- Use CLI tools for system state
- Test with minimal code to isolate problem
- Review similar working code in codebase
Hardware Debugging
- Use SWD debugger with OpenOCD
- ST-Link or Black Magic Probe supported
- GDB debugging available with proper setup
- Check
scripts/debug/for configuration files