building mbed-src as a library

11 Jul 2015

I’m trying to build a mbed-src as ar / .a library for working offline with Em::Blocks. I do have a working setup. It’s rather ugly and clumsy; hence I would like to know if anybody could offer me any advice on how to improve my setup.

I exported a blinky w. mbed-src for the ST Nucleo F103 board. It compiles OK offline, it’s running and single stepping under GDB is OK.

I used arm-none-eabi-ar to create a libmbed.a library adding all object from mbed.src. Sadly my programs linked with this library crashes before entering main ().

Looking at an export of a blinky build using mbed-official suggests, that all objects from the mbed-src/target/cmsis subtree should be added separately to the linker. If I do so my programs will boot and they can be debugged. I can’t help thinking: Is this REALLY necessary? Or is it just a quick fix?

Has anyone found a smaller working set of object files to be added separately to the linker? Is multi pass reading of libmbed a solution? Any other suggestions? I can’t be the only one scratching my head about this.

Sincerely Tim