Offline build with eclipse and git-clone of mbed-os repo

03 Jul 2018

Hi I'm trying to build my project using eclipse. I've got it working by choosing "Export"->"GNU ARM Eclipse" from the cloud IDE. This builds OK. However, this leaves me with an un-versioned export of the mbed-os source code.

What I'd like to do is replace this library with a git-clone of the mbed-os repository, so I can remain in sync with bug-fixes etc.. However, when I try replacing the mbed-os library folder in the project with a clone of the git repo, it won't build any more (billions of errors). I guess I need to do something to configure the repo clone but I've no idea what.

What do I need to do to replace the Cloud IDE exported mbed-os with a clone of the mainline repo?

I'm using the vanilla gcc-arm toolchain, eclipse-4.7.3 with gnu-mcu-eclipse plugins on fedora-28 linux 64-bit. I'm building for a LPC1768 module.

Can anyone explain a bit more clearly how to build the github repo? Thanks, BC

04 Jul 2018

OK, I've got this working now. In case anyone else cares, I had to browse the whole mbed-os folder tree and exclude-from-build all folders for other TOOLCHAINS and TARGETs except the ones I want. Seems the export-from-cloude IDE already does this as the exported project only contains the folders for the target/toolchain it was configured for.

I.e. I'm building for GNU_ARM, so I exclude all folders matching TOOLCHAIN_* except TOOLCHAIN_GNU_ARM. Similarly, I exclude all TARGET_* folders except those which match my target device (LPC1768).

I wonder if there's a more efficient way to do this except by manual browsing the tree (maybe mbed-cli can help?). Now the excludes are set, I guess it should be easy to maintain.

BC

09 Jul 2018

Seemed that you can select the MCU you are using, then only the folder of the MCU you selected is remaining, like this /media/uploads/oliverOu/1.png