Skip to content

Debugging Tools

The tools/ directory includes a suite of diagnostic scripts developed during the reverse engineering of the SkyWalker-1. These tools were instrumental in isolating the I2C STOP corruption bug in the FX2 controller and verifying correct BCM4500 initialization.

All debugging tools require pyusb, root access, and the kernel dvb_usb_gp8psk module to be unloaded.

Terminal window
pip install pyusb
sudo modprobe -r dvb_usb_gp8psk gp8psk_fe

Two scripts test the BCM4500 boot sequence using debug modes in the custom v3.01.0 firmware.

Runs a complete BOOT_8PSK sequence and reports success or failure with detailed register readback.

Terminal window
sudo python3 tools/test_boot.py

What it does:

  1. Reads firmware version via GET_FW_VERS (0x92)
  2. Reads config status via GET_8PSK_CONFIG (0x80)
  3. Sends BOOT_8PSK (0x89, wValue=1) with a 10-second timeout
  4. Decodes the 3-byte response: config status, boot stage, probe byte
  5. On success: reads BCM4500 direct registers (0xA2—0xA8), indirect registers (pages 0x00—0x0F), I2C diagnostic data, signal strength, and lock status
  6. On failure: runs I2C bus scan (0xB4), attempts raw I2C reads to BCM4500

Boot stage codes:

StageCodeMeaning
NOT_STARTED0x00Boot not attempted
GPIO_SETUP0x01GPIO pins configured
PWR_SETTLED0x02Power-on delay complete
I2C_PROBE0x03Probing BCM4500 on I2C
INIT_BLK00x04Writing init block 0
INIT_BLK10x05Writing init block 1
INIT_BLK20x06Writing init block 2
COMPLETE0xFFBoot finished

Config status flags after successful boot:

FlagBitExpected
bm8pskStarted0x01ON
bm8pskFW_Loaded0x02ON

test_boot_debug.py — Incremental Stage Testing

Section titled “test_boot_debug.py — Incremental Stage Testing”

Sends debug boot modes (wValue=0x80 through 0x83) one at a time to isolate which stage of the boot sequence fails. Can test a single stage or run all sequentially.

Run all debug stages
sudo python3 tools/test_boot_debug.py
Test only stage 0x82
sudo python3 tools/test_boot_debug.py 0x82

Debug modes:

wValueActionTests
0x80No-op: return current stateFirmware responsive?
0x81GPIO setup + power + delays (no I2C)Power rails working?
0x82GPIO + I2C bus reset + BCM4500 probeI2C communication working?
0x83GPIO + I2C probe + write init block 0Register writes accepted?

Each mode returns a 3-byte response: config status, boot stage, and probe byte. The tool reports timing (ms) for each stage and checks if the device is still responsive after failures.

The custom v3.01.0 firmware adds these diagnostic vendor commands used by the test scripts:

CommandCodeDirectionPurpose
I2C_BUS_SCAN0xB4INProbe all 128 I2C addresses, return 16-byte bitmap
I2C_RAW_READ0xB5INRead from any I2C device (wValue=addr, wIndex=reg)
I2C_DIAG0xB6INStep-by-step indirect register read with intermediate values
RAW_DEMOD_READ0xB1INRead any BCM4500 indirect register
RAW_DEMOD_WRITE0xB2OUTWrite any BCM4500 indirect register

These commands are only available when running the custom firmware. Stock firmware will STALL on these command codes.