baitnswitch is a Cardputer-Adv firmware for ESP-IDF 5.4.2 that re-implements the Fusée Gelée exploit. It browses payloads from the SD Card, watches for a Switch in RCM mode over USB host, runs preflight safety checks, and injects the selected payload.
- Single-firmware ESP-IDF project targeting
esp32s3 - SD card mount, directory browsing, file inspection, and streamed SHA-256 hashing
- USB host lifecycle management with descriptor capture and RCM device detection
- Switch RCM backend with descriptor-based interface claim and endpoint discovery
- Payload shaping, chunked upload, trigger flow, retry handling, and cancel support
- Two-step confirmation flow plus preflight gates for SD, file size, battery, heap, build policy, and USB target state
- ST7789 LCD rendering, external UART text output, keyboard input, logging, and diagnostics screens
- Runtime overrides loaded from
/sdcard/baitnswitch.cfg - Log export to
/sdcard/baitnswitch-logs.txtby default
- Battery divider and offset defaults are configurable, but hardware calibration is not fully validated
Use an ESP-IDF shell.
- Install
ESP-IDF 5.4.2 - Open an ESP-IDF shell
- Run
idf.py set-target esp32s3 - Run
idf.py build
Useful defaults already checked into sdkconfig.defaults:
esp32s3target- custom
partitions.csv - 8 MB flash
- ESP console disabled
- FATFS long filename support on heap
- Browse payloads from
/sdcard - Select a file and wait for hashing/preflight checks
- Put the Switch into RCM mode and connect it
- Confirm the target lock-in
- Confirm the injection
- Watch transfer progress or cancel with
Esc
- Arrow keys: navigate
Enter: select / confirmEsc: back / cancelP: open payload browserL: open logsD: open diagnostics
On the logs screen, Enter exports the in-memory log buffer to log_export_path if the SD card is mounted.
Defaults are compiled in from main/Kconfig.projbuild and sdkconfig.defaults. Runtime overrides come from /sdcard/baitnswitch.cfg.
Supported keys:
min_battery_mvmin_free_heap_bytesmin_largest_block_bytesmax_session_file_bytesbattery_sample_countbattery_divider_numeratorbattery_divider_denominatorbattery_offset_mvallow_unknown_batteryallow_sessions_in_this_buildlcd_enabledlcd_swap_xylcd_mirror_xlcd_mirror_ylcd_invert_colorslcd_gap_xlcd_gap_ylog_export_path
Example:
# Preflight policy
min_battery_mv=3800
min_free_heap_bytes=163840
min_largest_block_bytes=32768
max_session_file_bytes=130392
allow_unknown_battery=false
allow_sessions_in_this_build=true
# Battery calibration
battery_sample_count=8
battery_divider_numerator=2
battery_divider_denominator=1
battery_offset_mv=0
# LCD tuning for Cardputer-Adv
lcd_enabled=true
lcd_swap_xy=true
lcd_mirror_x=true
lcd_mirror_y=false
lcd_invert_colors=true
lcd_gap_x=40
lcd_gap_y=53
# Log export
log_export_path=/sdcard/baitnswitch-logs.txtBoolean values accept 1/0, true/false, yes/no, and on/off.
DavidBuchanan314/fusee-nanoby David Buchanan, licensed underMIT.
Please retain these upstream attributions and review the upstream licenses before redistributing or relicensing derived portions of the RCM backend.