2 years, 1 month ago.
mbed-os .a .lib
Hi Im working with the mbed online compiler. To debug, id like to export to system workbench ide, although this is never working since mbed-os has always messed up include paths and other things i cannot fix.
My idea would be to use a pre compiled library file of mbed-os, since im not going to debug mbed os itself but my app code only..
When i export my project, then delete mbed-os folder but keep the libmbed-os.lib file, include this correctly to eclipses (ac6) settings, why do i get the error mbed.h not found?
Isnt the .lib file the entire lib? I thought header files + lib.a generates the .lib?
Appendix: I managed to build the mbed-os repository with mbed cli as library with -t gcc_arm -m Nucleo_f103rb. But also here. Missing mbed.h when i include the .lib file to eclipse
2 years, 1 month ago.
Exporting to system workbench is very frustrating and has been broken since I started playing with mbed. The good news is that it does actually work when you get everything sorted out. My strategy at this point is to export from mbed-cli, open in Eclipse and adjust some linker flags and compiler options, make sure fpu is right. In the eclipse project tree, you need to spend some time excluding items from the build that are not required for the particular target. Right click->Resource Configuration->Exclude from Build.
Here, I made you a clean system workbench project for the f103rb. Using system workbench 1.14.0. It compiles, should run. I set mbed-os as a submodule, so use recursive when you clone the repo to pull mbed-os files in as well.
git clone --recursive https://gitlab.com/gs-open-source/F103RB
In linker options I compiled with full Newlib which supports multithreading. If you only need 1 thread you can reduce code size a lot by using newlib-nano by adding this linker flag.
I had to add MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600 to the Symbol list for all languages. This value is in mbed_config.h, but RawSerial.h can't see it.
In System Workbench: File->Import->General->Existing Project Into Workspace
And then just select the directory. There is a spammy popop "Auto ignore derived resources" when you first compile it, but I think it can be ignored.
To post an answer, please log in.