Connecting the debugger

A project log for Hacking cheap mini-quadrocopter

Trying to use board from a under $30, off the shelf quadrocopter as a ARM devboard

lb5trlb5tr 01/05/2017 at 03:180 Comments

Few days back I started working on serial debugging. Having access to BusBlaster v3, I used OpenOCD to tinker with the mcu. First things first -- I had to solder few wires to the pads.

In reality, I ended up using only two wires (except ground) - SWDIO/SWCLK - that I connected to TMS and TCK signals on the BusBlaster respectively. Manufacturer also exposed pads for RX and RST signals, they might come handy later.

First step is to configure the CLPD on the BusBlaster board with kt-link device. I used ready-to-use svf file from project.

$ openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf system.svf; shutdown"

After that, I started OpenOCD with configuration for stm32f0x boards (available in the project repository on github):

$ openocd -f openocd-swd.cfg
OpenOCD exposes two TCP ports:
  1. 4444 - for interactive console
  2. 3333 - for gdb

Connecting to 4444 with telnet and issuing simple command proved the setup is working as expected.

$ telnet localhost 4444
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> flash info 0
#0 : stm32f1x at 0x08000000, size 0x00004000, buswidth 0, chipwidth 0
        #  0: 0x00000000 (0x400 1kB) not protected
        #  1: 0x00000400 (0x400 1kB) not protected
        #  2: 0x00000800 (0x400 1kB) not protected
        #  3: 0x00000c00 (0x400 1kB) not protected
        #  4: 0x00001000 (0x400 1kB) not protected
        #  5: 0x00001400 (0x400 1kB) not protected
        #  6: 0x00001800 (0x400 1kB) not protected
        #  7: 0x00001c00 (0x400 1kB) not protected
        #  8: 0x00002000 (0x400 1kB) not protected
        #  9: 0x00002400 (0x400 1kB) not protected
        # 10: 0x00002800 (0x400 1kB) not protected
        # 11: 0x00002c00 (0x400 1kB) not protected
        # 12: 0x00003000 (0x400 1kB) not protected
        # 13: 0x00003400 (0x400 1kB) not protected
        # 14: 0x00003800 (0x400 1kB) not protected
        # 15: 0x00003c00 (0x400 1kB) not protected
STM32F03x - Rev: 1.0
In the next episode, I'll try to build simple blinkenlights firmware and flash it onto the board.

Catch you later.