Now, I’ll try to compile lmicdiusb, and install arm-none-eabi-gdb for on-board debugging...

In cloned repository (from previous post) there is lmicdiusb folder, so go to that folder...

cd /opt/local/src/lm4tools/lmicdiusb

Now, just compile it!

make

But, since I’m using ports, few lines in Makefile were wrong for my system, so I get errors

In file included from In file included from lmicdi.c:40:
socket.c:41./lmicdi.h:39:10: fatal error: 'libusb.h' file not found:
./lmicdi.h:39:10: fatal error: 'libusb.h' file not found
#include ^
#include ^
1 error generated.
1 error generated.

and I needed to change Makefile to use pkg-config for cflags, library folders and libraries... Here is what I did...

Original:

    ifeq ($(shell uname),Darwin)
    LIBUSB_CFLAGS := -I/usr/local/include/libusb-1.0
    LIBUSB_LIBDIR := /usr/local/lib
    LIBUSB_LIBS := -lusb-1.0
    LDFLAGS += -framework AppKit -framework Carbon -framework IOKit
    endif

Modify to (LDFLAGS line stays same):

    ifeq ($(shell uname),Darwin)
    LIBUSB_CFLAGS := $(shell pkg-config --cflags libusb-1.0)
    LIBUSB_LIBDIR := $(shell pkg-config --variable=libdir libusb-1.0)
    LIBUSB_LIBS := $(shell pkg-config --libs-only-l libusb-1.0)
    LDFLAGS += -framework AppKit -framework Carbon -framework IOKit
    endif

And then try to build it...

And that’s it! Now, when you connect board and run lmicdi, it will start server on port 7777, to which you can connect with gdb, and do some basic stuff. All supported commands are in commands.txt file in lmicdiusb folder...