Add catnip restore command for CC1352 recovery via JTAG #52
Open
Add catnip restore command for CC1352 recovery via JTAG #52
Conversation
Recovers a CC1352 when the serial bootloader is broken by using the RP2040 as a CMSIS-DAP JTAG programmer via OpenOCD. Usage: catnip restore # default CatSniffer firmware catnip restore firmware.hex # custom firmware catnip restore firmware.hex -d 1 # specific device Flow: 1. Auto-detects shell port and sends 'reboot' for BOOTSEL 2. Loads free_dap CMSIS-DAP firmware onto RP2040 3. Flashes CC1352 via OpenOCD JTAG (auto-patches TAPID for CC1352P7) 4. Prompts user for BOOTSEL to restore bridge firmware Features: - Auto-downloads free_dap_catsniffer.uf2 from GitHub release - Uses catnip's cached bridge UF2 (catsniffer-v3.1.0.0.uf2) - Default firmware: sniffer_fw_Catsniffer_v3.x.hex - Supports CC1352P7 (0x1BB7702F) and CC1352P1 (0x0BB4102F) via --tapid - Cross-platform: requires OpenOCD (apt/brew/choco) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changed restore flow from direct JTAG programming to erase-only via JTAG (preserving bootloader in sector 0/CCFG), then flash via serial bootloader using the existing Flasher class. Added cmsis_dap_backend hid for reliable CMSIS-DAP communication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
When flashing a firmware that doesn't configure the CCFG bootloader backdoor (e.g., TI
SDK examples built for LaunchPad), the CC1352 becomes unresponsive to the serial
bootloader. The only recovery is via JTAG, which previously required manual OpenOCD
commands and knowledge of the CC1352P7 TAPID.
Usage
catnip restore # restore with default CatSniffer firmware
catnip restore firmware.hex # restore with custom firmware
catnip restore firmware.hex -d 1 # target specific device
catnip restore --tapid 0x0BB4102F # CC1352P1 variant
How it works
manual BOOT button)
~/.catnip/restore_cache/)
Requirements
Files changed
Test plan