0
mirror of https://github.com/loopj/wavephoenix.git synced 2026-03-15 13:06:54 +00:00

WavePhoenix Bootloader

Dependencies

Configuration

You'll need to tell SLC-CLI where your Simplicity SDK and ARM toolchain are located:

slc configuration --sdk path/to/simplicity_sdk
slc configuration --gcc-toolchain path/to/gcc-arm-none-eabi
slc signature trust --sdk path/to/simplicity_sdk

Building

To build the WavePhoenix bootloader, run the following script, replacing rf-bm-bg22c3 with your target board:

BOARD=rf-bm-bg22c3 ./build.sh

This will generate target/rf-bm-bg22c3/build/release/bootloader.hex.

Flashing

Using Simplicity Commander

If you are using a dev board with a built-in J-Link debugger, you can use Simplicity Commander to flash the bootloader:

commander flash bootloader.hex

Using OpenOCD

If you are using a generic SWD debug probe, you can use OpenOCD to flash the bootloader:

  1. Download and install Arduino's fork of OpenOCD (Windows, macOS, Linux)

  2. Connect GND, SWDIO, SWCLK, and 3V3 between the debug probe and the SoC.

  3. If this is your first time flashing this chip, you'll need to do a full device erase to unlock the debug interface:

    openocd -f "interface/cmsis-dap.cfg" \
            -f "target/efm32s2.cfg" \
            -c "init; efm32s2_dci_device_erase; shutdown"
    
  4. Disconnect then reconnect the debug probe.

  5. Then, flash the bootloader, replacing bootloader.hex with the path to your bootloader file:

    openocd -f interface/cmsis-dap.cfg \
          -c "transport select swd" \
          -f target/efm32s2.cfg \
          -c "init; halt; flash write_image erase bootloader.hex; exit"