Debuggoid’s embeded software is a port of Black Magic Probe to the esp8266, which allows wireless debugging of blackmagic-supported ARM targets through SWD, such as Yahu or Nomi.
This tutorial details the steps to prepare and flash Debuggoid’s embeded software.
Prepare and flash the Debuggoid
- Project : https://lab.iut-blagnac.fr/testbed/utils/debuggoid/software/
- Debuggoid specific code: https://lab.iut-blagnac.fr/testbed/utils/debuggoid/software/tree/master/src/platforms/debuggoid
Serial connection
To flash and interact with the Debuggoid, you need a 3.3V-TTL serial port, like a 3.3V USB-UART data cable with a FTDI converter.
Be careful and use a 3.3V USB-UART data cable. 5V will destroy the debuggoid.
Check the voltage of the USB-UART data cable before connecting the cable to the Debuggoid. Some USB-UART data cable have both 3.3V and 5V power pins. You MUST make sure both the data and Vcc (power) pins are 3.3V.
Check the voltage of the USB-UART data cable before connecting the cable to the Debuggoid. Some USB-UART data cable have both 3.3V and 5V power pins. You MUST make sure both the data and Vcc (power) pins are 3.3V.
During this operation, no target must be present on the SWD port.
- Connect a 3.3V USB-UART data cable connected to the pins GND/TX/RX. Power can also be provided by connecting the 3.3V pin. For more details on the pinout, see the Debuggoid page.
- Identify the correponding port: typically
/dev/ttyUSB0or/dev/ttyACM0on GNU/Linux,COM5on Windows systems - Power-up or Reset the Debuggoid while pressing the boot button to enable the flashing mode of the bootloader.
Getting the firmware
By download
- Download the latest release of the Debuggoid Firmware here
- Upload firmware using one of the tools available like Esptool or Tasmotizer. Using Esptool:
- Install Esptool the first time, eg. under Linux
sudo pip3 install esptool - Identify the serial port of the 3.3V USB-UART data cable, eg. under Linux
/dev/ttyUSB0 - Send the firmware on the serial port, eg.
esptool.py --port /dev/ttyUSB0 write_flash 0x2000 debuggoid-firmware.bin - Once the upload done, reset the Debuggoid by pressing the RESET button.
- Install Esptool the first time, eg. under Linux
- Enjoy and start debugging!
By compilation
Using this docker image avoids the cross-compilation of the toolchain and the installation of all the tools:
- Install DockerCE the first time (example on Debian). On Linux, you may add the current user in the
dockergroup - Pull the docker image
docker pull beetix/esp-open-rtos - Clone the Debbugoid software repository using git
git clone git@lab.iut-blagnac.fr:testbed/utils/debuggoid/software.gitand go to this directory in the terminal - Enter the docker virtual machine:
docker run --rm -it --device=/dev/ttyUSB0 -v $PWD:/esp-open-rtos/examples/project beetix/esp-open-rtos /bin/bash - In the virtual machine:
- Modify
/esp-open-rtos/examples/project/src/platforms/debuggoid/private_ssid_config.haccording to the WiFi configuration (SSID/WPA key) - Apply the patch
open_rtos_hostname.patchcd /esp-open-rtosgit apply --stat examples/project/src/platforms/debuggoid/open_rtos_hostname.patchgit apply --check examples/project/src/platforms/debuggoid/open_rtos_hostname.patch- If no error:
git apply examples/project/src/platforms/debuggoid/open_rtos_hostname.patch
- From the
/esp-open-rtos/examples/project/srcdirectory, runmake PROBE_HOST=debuggoid flash VARIANT=minimalto build and flash the Debuggoid with the firmware
- Modify
- Enjoy and start debugging!
Note that the patch should be applied every time the docker vm is restarted.