Sign inSign up

zfields/particle-dbg

By zfields

Updated over 7 years ago

A container supporting Particle firmware debugging.

Image
0

1.1K

zfields/particle-dbg repository overview

Docker debug container

The Docker debug container will execute arm-none-eabi-gdb, and any parameters you pass behind it will be passed directly to arm-none-eabi-gdb. Before a device can be debugged, it will need to be in DFU mode (blinking yellow).

NOTE: The configuration shown below will allow you to debug Particle firmware using the Particle Debugger or Programmer Shield.

Debugging Particle firmware
docker run --interactive --mount type=bind,source=<local firmware repository>,target=/particle-iot/device-os --mount type=bind,source=<user application folder>,target=/particle-iot/app --privileged --rm --tty zfields/particle-dbg --directory /usr/local/lib/gcc-arm-none-eabi-5_3-2016q1/arm-none-eabi/include/c++/5.3.1/bits --directory /particle-iot/device-os/third_party/freertos --directory /particle-iot/device-os/third_party/nrf5_sdk --directory /particle-iot/device-os/communication --directory /particle-iot/device-os/hal --directory /particle-iot/device-os/system --directory /particle-iot/device-os/wiring -ex 'target remote | openocd -f interface/<debugging hardware>.cfg -f target/<target hardware>.cfg -c "<mcu family>.cpu configure -rtos FreeRTOS; gdb_port pipe; log_output openocd.log;"' <user application>.elf

NOTE: This process runs inside a container, where the file locations are no longer relative to where they were originally compiled. To compensate for this, we must supply the --directoryparameter to gdb.

Option breakdown
Filepath Configuration
  • <local firmware repository> - This is the path to the firmware folder on your local machine.
  • <user application folder> - This is the path to the user application folder on your local machine.
  • <user application> - This will be the name of the resulting binary (i.e. my_app.elf).
OpenOCD Configuration

gdb pipes into openocd, and you can configure OpenOCD using the following parameters...

Engage the target device

Once you have launched the container, you will be prompted with a GDB shell. Use the follow commands to engage the target device and start debugging.

(gdb) monitor reset halt
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08003700 msp: 0x20020000
(gdb) break setup
Breakpoint 1 at 0x80373e0: file /particle-iot/app//src/blinky.cpp, line 12.
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
...

Tag summary

Content type

Image

Digest

Size

122.2 MB

Last updated

over 7 years ago

docker pull zfields/particle-dbg