PH-DOC / 03.1

The FireBeetle board.

PocketHunter does not design its own PCB in this repository. The firmware targets the DFRobot FireBeetle 2 ESP32-P4, part DFR1172, and quotes that board's schematic V1.0 dated 2025-04-10.

Silicon

The documented toolchain is ESP-IDF v5.5.6 (Docker image espressif/idf:v5.5.6), GCC 14.2.0, mbedTLS 3.6.7 and esptool 4.12.0. The default sdkconfig targets ESP32-P4 v3.x. The ECDSA peripheral path used for an eFuse key works only on revision v3.0 or later. On v1.x the firmware can only run with a development key, and it needs sdkconfig.defaults.p4rev1 or it will not boot. DFRobot does not state the revision fitted; the firmware README notes that a forum user reported v1.0 on early boards.

GPIOs the firmware README marks unavailable on this board: 14–19, 54 and 6 (ESP32-C6 co-processor SDIO), 9 and 12 (PDM microphone), 37 and 38 (UART0). PocketHunter does not use that co-processor, the microphone or UART0. Logs go out over USB-Serial/JTAG.

The key that signs a case

Device key sources
keysrcWhere the private key livesAccepted for casework
efuseAn eFuse key block with purpose ECDSA_KEY (P-256). Read-protected. Software holds only a reference; the peripheral signs and can export the public key.Yes. This is what release analyzers expect.
devGenerated on first boot from the RNG (SAR-ADC entropy is enabled) and stored in NVS. Nothing is burned. Erasing flash creates a new identity.No. Analyzers reject it. Licences accept it only with -allow-dev-keys, which the guide says not to use for field kits.

At boot the firmware signs a test message and checks it with the exported public key. The device ID is the first 8 bytes of SHA-256 of the 65-byte uncompressed public key, printed as 16 upper-case hex characters. The protocol doc's example is 3F9A0C11D2E4B758.

The counter is a 32-bit value in NVS. It increments and is committed before each SEAL signature and before UNLOCK opens the protected sectors. It does not wrap. On an eFuse-key device the firmware burns the marker PHC1 into the first 4 bytes of eFuse BLOCK3 if that block is blank. If the counter later vanishes while the marker is present, the device refuses to count or sign. The README is clear about the remaining hole: someone who desolders the external SPI flash can restore old encrypted NVS sectors. The P4 has no internal flash and no hardware monotonic counter large enough for 32 bits. Analyzers should flag a repeated or decreasing counter.

16 MB flash map

The chip named on the schematic is a W25Q128JV, 16 MB. The partition table offset is 0x10000, leaving room for a secure-boot and flash-encryption bootloader. Two OTA slots exist because the table cannot change once flash encryption is on. The PH1 protocol has no update command yet.

Custom partition table
NameTypeSizeNotes
nvsdata / nvs0x6000Counter, and the dev key if there is no eFuse key
otadatadata / ota0x2000Selects the app slot
nvs_keysdata / nvs_keys0x1000Encrypted. NVS encryption keys
ota_0app0x3000003 MB. The documented build used 474,176 bytes of this slot
ota_1app0x300000Reserved for a future signed update

Release lock-down

sdkconfig.defaults.release turns on Secure Boot v2 (RSA-3072), flash encryption in release mode (XTS-AES-128, key generated on the chip), Secure Download Mode and NVS encryption. The build does not sign binaries. JTAG is not allowed. First boot of that image burns fuses. See the build guide before anyone runs it. Factory mode, which leaves the system partition writable without a token, must never be shipped.