28 Jan 2014 shimniok   » (Journeyer)

Debugging mbed, progress so far

I've been working on the code for Data Bus, my autonomous rover, in particular inserting FreeRTOS into the mix. Doing so made hardware debugging a necessity.

I've made a little progress with that and thought I'd share. Ideally I'd like to integrate debugging with Eclipse but have had to settle for command line for now.

You may recall I'm using the LPC1768 mbed. The mbed project recently implemented CMSIS-DAP which is a standardized interface to the ARM core's debugging hardware.

One can use a fork of OpenOCD that speaks CMSIS-DAP (until they merge those changes in). I used this fork. OpenOCD implements a gdb server to which your gdb command line client can connect.

I also found it immensely helpful to use pyOCD which takes care of launching the OpenOCD gdbserver for you. Follow the readme instructions on the pyOCD repo. You'll need python, of course, libusb (apt-get install python libusb for distros using APT), and pyUSB.

Apparently you can also write python scripts with pyOCD to interact with CMSIS-DAP (details here).

I haven't gotten Eclipse integration sorted out just yet...

Some of the question marks pertain to how Eclipse communicates with the gdb server, what commands it issues. I haven't dug in beyond "it doesn't work in Eclipse" to find out what is going wrong, let alone what the cause is. I'm sure I'll figure it out eventually. Probably someone else already has and I just need to find their blog post. :) (EDIT: Like this one submitted by Matthew)

Alternatively my plans to migrate to LPCXpresso means I could just use CodeRed and not worry about all this. :)  But that limits me to very few ARM MCUs. There's a lot of popularity growing around STM32 and Kinetis ARM MCUs lately. ARM is destined to become the primary hobbyist MCU of choice in the next few years and we need full, open source toolchains and IDE integration to get there.

Syndicated 2014-01-28 17:00:00 (Updated 2014-02-03 23:34:16) from Michael Shimniok

Latest blog entries     Older blog entries

X
Share this page