This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Debug another MCU over BLE

Currently, debug probes - STLink, JLink, OpenOCD, Black Magic Probe, DAPLinkda, etc. connect to a host PC over a USB, serial or network port and then connect to a target (STM32, etc) over SWD or JTAG.

An amazing achievement has been that Nordic's BLE chips have become tiny. So much so that Taiyo Yuden has a nRF52832 based module: EYSHSNZWZ that is 8.55mm X 3.25mm - it is smaller than an ARM debug header!

So, instead of using a debugger that I have to plug into a PC and a connector on my target, I would like to use the EYSHSNZWZ and debug over BLE. The topology would be:

Debugger <----> PC's internal Bluetooth LE <---- BLE ----> EYSHSNZWZ <---- SWD ----> Target

Almost all debuggers connect to the debug probe over USB. An exception is gdb - which, to my knowledge is the only one that connects to debug probes over USB, serial or network socket. Since I want to use the host PC's internal Bluetooth LE device, I would either have to write a USB device driver that emulates one of the debug probes supported by the debuggers and pipe those commands through the host PC's internal Bluetooth LE device, over to the EYSHSNZWZ. The USB device driver is too complicated. I think a serial driver is of similar complexity.

Fortunately, Black Magic Probe [0] and pyOCD [1] provide a gdbserver which presents a network socket connection. I'm thinking of taking the network socket portion and piping the commands to the host PC internal Bluetooth LE device.

Then, using an existing Nordic transport or write my own, transport information back and forth to the EYSHSNZWZ.

On the EYSHSNZWZ, use code from Black Magic Probe or pyOCD or DAPLink [2] to talk to the target over SWD.

This entire solution will be open source on GitHub.

Advice I'm looking for:

  1. Has anyone done anything similar?
  2. What am I missing?
  3. Where can I look for info. on how to talk to the host PC's internal Bluetooth LE device - initial host will be Windows 10.
  4. Any suggestions for the protocol between the host PC's internal Bluetooth LE device and EYSHSNZWZ?
    For example, should I look at the nRF UART protocol? Roll my own? Some existing GATT profile?
  5. I would like to use the SPIM or SPI port on the nRF5. There are two problems:
    1. The SWD protocol is really a three wire protocol i.e. the data line is bidirectional
      One idea here is to connect the SPI port's MISO to the SWDIO and MOSI to MISO/SWDIO through a resistor - so that the target can overdrive whatever the SPI port is outputing on MOSI.
      Is there a way to configure the SPIM or SPI port to be bidirectional i.e. three wire?
    2. The data elements aren't on eight bit boundaries
      Is there a way to send less than eight bits?
  6. The EYSHSNZWZ has s132_nrf52_5.0.0_softdevice.hex installed.
    1. Does this have OTA updates built in?
    2. What tool do I need on the PC to talk to this?
    3. I'm trying to decide if I should expose the nRF52832's SWD port or just rely on OTA updates. Thoughts?

The amount of nRF / Nordic info. is staggering. I've been spelunking for a few hours but am a little uncertain where to start. I have GCC for ARM Cortex processors installed for other projects. Quite familiar with embedded development. So, would be grateful for specific suggestions.

Thank you in advance for your thoughts!
Harjit

[0] https://github.com/blacksphere/blackmagic/wiki

[1] https://github.com/mbedmicro/pyOCD

[2] https://github.com/ARMmbed/DAPLink

Parents Reply Children
No Data
Related