Recovering a bricked Wismesh Repeater with a Black Magic probe
I got my hands on a Wishmesh Repeater that got bricked during an update. But after opening it I saw that there actually was an SWD header and after some googling around I found out that I could use a BMP to reflash the bootloader to unbrick the Repeater.
So I got myself a BlackPill F411CE.
So I opened up the Repeater to solder on a pin header, but had to lift the supercap shown in the picture below. It was glued to the board so I had to carefully cut it free to I could tilt it up and solder on the header.

And now the header is soldered on

Now I need to make my own Black Magic Probe. I downloaded the repo:
git clone https://codeberg.org/blackmagic-debug/blackmagic.git
there are some submodule issues since it was recently moved to codeberg so I manually cloned it:
cd blackmagic/deps
rm -rf libopencm3
git clone https://codeberg.org/blackmagic-debug/libopencm3.git
Now lets build the code: meson setup build —cross-file=cross-file/blackpill-f411ce.ini -Dbmd_bootloader=true meson compile -C build`
Now we've built the bootloader and the BMP firmware, time to flash my BlackPill F411CE.
Connect a usb cable to the PC to power it.
I actually used an ST-link and STM32CubeProgrammer and flashed the bootloader to 0x08000000 and the BMP firmware to 0x08004000 after a full chip erase.
Confirm that the BMP is now working, on linux run:
lsusb
And look for something like this:
Bus 001 Device 034: ID 1d50:6018 OpenMoko, Inc. Black Magic Debug Probe (Application)
Now connect your new BMP to the repeater SWD port:
| Wismesh Repeater | Blackpill BMP |
|---|---|
| 3V3 | Any 3V3 |
| GND | Any GND |
| SWDIO | PB9(B9) |
| SWCLK | PB8(B8) |
| NRST | PA5(A5) |

And now it's time to flash the bootloader. Download the Wismesh bootloader .hex file from https://github.com/oltaco/WisCore_RAK4631_Bootloader/releases
Now it's time to load up gdb:
arm-none-eabi-gdb
target extended-remote /dev/ttyACM0
monitor swd_scan
You should get something like: nrf52840 M4 and mrf52840 Access Port You would go for the first.

attach 1
monitor erase_mass
load /path/to/WisCore_bootloader.hex
monitor reset
detach
quit
Now unplug the power to the repeater by pulling out the 3v3 and wait ~10 seconds. Connect a usb cable and double press the button and it should now enter DFU mode. Now you can flash the meshtastic firmware.
Congrats! You've unbricked your repeater with a cheap diy debug probe!