Debug - portapack-mayhem/mayhem-firmware GitHub Wiki
The Debug menu provides hardware diagnostics, memory inspection tools, and developer utilities. Some items are built-in; others are external apps (.ppma) that load dynamically from the SD card and appear in the Debug menu automatically when the SD card is present.
Audio Test
[!NOTE] This is an external app. It requires the
audio_test.ppmafile to be present on the SD card.
Generates a sine wave tone of a configurable frequency and duration to test the audio output chain. Duration of 0 plays the tone continuously. The sample rate and frequency step can also be adjusted. A speaker toggle controls whether the built-in speaker (if present) is used.
Battery
[!NOTE] Only shown when a MAX17055 battery management IC is detected (H4M hardware only).
Displays the raw register contents of the MAX17055 fuel gauge IC, including voltage, current, capacity, state of charge, and other battery parameters. Values are shown in decoded form with units. Use the encoder dial to scroll through pages of registers.
Buttons Test
Shows real-time input from all hardware controls: directional buttons, encoder dial, and touchscreen. Useful for verifying that buttons register correctly and that the encoder steps cleanly without skipping or double-stepping. The test screen also includes a long-press test for the directional keys and the DFU switch.
Debug Dump
[!NOTE] This is an external app. It requires the
debug_pmem.ppmafile to be present on the SD card.
Writes a file containing debug information (persistent memory contents, firmware version, hardware info) to the DEBUG/ folder on the SD card. Useful for reporting bugs or diagnosing configuration issues.
Ext Module
Displays information about a connected PortaPack expansion module (PPMod) communicating over I2C. Shows the module name, firmware version, and a list of apps provided by the module. If no module is connected, the screen shows "No module connected". The display updates once per second.
ExtSensor
[!NOTE] This is an external app. It requires the
extsensors.ppmafile to be present on the SD card.
Scans for I2C-connected external sensors and displays their readings. Supports environmental sensors that report temperature, humidity, and pressure (e.g. BME280). Found I2C device addresses are listed on startup.
Font Viewer
[!NOTE] This is an external app. It requires the
font_viewer.ppmafile to be present on the SD card.
Displays the built-in 5×8 and 8×16 font character sets used by the Mayhem UI.
M0 Stack Dump
Writes a file containing the M0 core stack contents to the DEBUG/ folder on the SD card. Used for diagnosing crashes or stack overflows in the M0 processor.
Memory Dump
Allows a region of memory to be saved to a file in the DEBUG/ folder in hexadecimal ASCII format. Also allows direct read and write access to specific memory addresses for debugging purposes.
[!WARNING] Memory addresses must be multiples of 4 to avoid causing a fault. Writing to some addresses may cause hardware damage. Use with care.
Peripherals
Displays the raw register contents of the HackRF radio hardware ICs, which vary by hardware revision:
| Hardware | ICs shown |
|---|---|
| R1–R8 (OG) | RFFC5072, MAX2837, Si5351C, audio codec, SGPIO |
| R9 / R10C | RFFC5072, MAX2839, Si5351A, audio codec, SGPIO |
| HackRF Pro | RFFC5072, MAX2831, Si5351A, iCE40 FPGA, audio codec, SGPIO |
If a MAX17055 battery IC is detected (H4M), it also appears here.
Individual registers can be read or written. If more registers exist than fit on the screen, turn the encoder dial when the Update button is highlighted to scroll through them.
[!WARNING] Writing to some registers may cause hardware damage. Use with care.
Starting with HackRF One r6, hardware revisions are detected by firmware and reported by hackrf_info. The R9 board can be identified without disassembly via the Peripherals view:
Pers. Memory
Displays the 256-byte persistent memory (p.mem) area as a hex dump, split across pages. Use the encoder dial to scroll between pages. The current byte offset from the start of p.mem is shown in the left column.
At the bottom, the current size of the data_t struct and the stored checksum are displayed. The checksum is calculated from the first 252 bytes and stored in the last 4 bytes. The config version is visible as the first 4 bytes of the dump.
Reboot
Immediately reboots the device.
SD Card
Displays information about the inserted SD card and allows it to be tested for read/write integrity.
Temperature
[!NOTE] This is an external app. It requires the
mcu_temperature.ppmafile to be present on the SD card.
Displays the current temperature as reported by the on-chip digital temperature sensor of the MAX2837 (R1–R8) or MAX2839 (R9/R10C). Accuracy is approximately ±4.33 °C per step.
Touch Test
Allows drawing on the screen with a stylus to test touchscreen calibration and accuracy.
Controls:
- Select — return to the Debug menu
- Left — change the pen to a random color (hold to cycle faster)
- Down — clear the screen to a random color
- Encoder dial — change the pen size
The screenshot icon remains functional but is hidden; press the exact spot on the title bar to activate it. For improving touchscreen calibration, see Settings → Calibration.