Recovering a Duet 3 6HC Stuck in BOSSA Mode Using CMSIS-DAP or ST-Link V2

If your Duet 3 6HC is stuck in BOSSA mode and won’t boot after flashing firmware, you may need to reflash the bootloader using an SWD debugger. This guide will show you how to do it using an ST-Link V2 clone or a CMSIS-DAP/DAPLink Emulator.


đź›  What You Need

Option 1: Using ST-Link V2 Clone

  • ST-Link V2 Clone (Cheap but less reliable for ATSAME51J20A)
  • OpenOCD or ST-Link Utility (Windows/Linux)

Option 2: Using CMSIS-DAP/DAPLink Emulator

  • CMSIS-DAP/DAPLink Debugger (More reliable than ST-Link for Duet 3 6HC)
  • OpenOCD or pyOCD for flashing

🔌 Connecting the Debugger to Duet 3 6HC (SWD Header)

To flash the bootloader, connect the debugger to the Duet 3 6HC via SWD (Serial Wire Debug).

Pinout for SWD Connection:

Debugger PinDuet 3 6HC SWD Pin
SWCLK (Clock)SWCLK
SWDIO (Data)SWDIO
GNDGND
3.3V (VCC)3.3V (VCC)
RST (Optional)RESET (if needed)

⚠️ Important:

  • Make sure the Duet 3 6HC is NOT powered by USB or VIN while connected to the ST-Link or CMSIS-DAP.

📥 Installing Required Software

For Windows Users

  1. Install ST-Link Utility (for ST-Link users) from STMicroelectronics.
  2. Install OpenOCD from GNU Toolchains.
  3. If using CMSIS-DAP, install pyOCD.

For Linux/macOS Users

sudo apt update
sudo apt install openocd

🔥 Flashing the Bootloader

Using OpenOCD (For ST-Link or CMSIS-DAP Users)

  1. Open a terminal and run: openocd -f interface/cmsis-dap.cfg -f target/atsame5x.cfg
  2. Open another terminal and enter: telnet localhost 4444 reset halt at91samd chip-erase flash write_image erase Duet3Bootloader-SAME5x.bin 0x00000000 verify_image Duet3Bootloader-SAME5x.bin 0x00000000 reset run
  3. Disconnect the debugger and power-cycle the Duet 3 6HC.

Using ST-Link Utility (For Windows ST-Link Users)

  1. Open ST-Link Utility.
  2. Click “Connect” to detect the board.
  3. Load Duet3Bootloader-SAME5x.bin.
  4. Click “Program & Verify”, then start flashing.
  5. Once complete, disconnect ST-Link and reboot the board.

📌 Flashing the Main Firmware

After flashing the bootloader, you need to flash the Duet 3 Firmware.

Run this command to upload firmware using BOSSA:

bossac --port=usb -e -w -v -b Duet3Firmware_MB6HC.bin -R

Once this completes, your Duet 3 6HC should be fully functional again!


âś… Conclusion

  • ST-Link V2 clones may work, but they’re not ideal due to potential instability with ATSAME51 chips.
  • CMSIS-DAP is a better, low-cost alternative to J-Link or Atmel-ICE for flashing the bootloader.
  • Once the bootloader is restored, use BOSSA to flash the main firmware.

Need Help?

If you run into issues, feel free to ask in the Duet3D forums or in the community!

🚀 Happy printing!

Similar Posts