[PROJECT][RIOT-OS][STM32-L152RE]

Hello,

We are 4 French students in engineering school. We are currently working on a robotic project of telepresence. We have set up RIOT-OS on a STM32 L152RE board and we are now attempting to add an external library in our project. We have a library libmded.a that contains every .o precompiled provided by mbed, and a folder with the corresponding headers. Then we added the .h path to the INCLUDES var in the makefile and the library to the USEMODULE var. But when we’re trying to compile it, it seems that the makefile isn’t able to find the functions include in this lib. That’s why we would be grateful for any advice that could guide us.

Kind regards.

Tara

Hi Tara, have you tried to include your external library as an external module [1]?

Kind regards, Martine

[1] https://github.com/RIOT-OS/RIOT/wiki/Creating-external-modules

Hi Tara,

how was the lib.a created? - maybe you can use " arm-none-linux-gnueabi-readelf" to get more info about the library. to understand your problem better - so you used the mbed export to gcc functionality and now you get errors like in this post fe. (different cpu etc) http://developer.mbed.org/questions/2524/gcc-arm-embedded-export-for-LPC4088/ ?

ps. for general testing you should maybe first test with a minimal .a that includes only a minimum of .o

regards

Jan

Hi Tara, [quotet from your digest reply]:

I tried to include my external library as an external module, but it doesn’t work ! I have still the same issue. When we’re trying to compile it, it seems that the makefile isn’t able to find the functions include in this libmbed.a. As you can see in my Makefile, I use this var:

AJOUT MODULE MBED

EXTERNAL_MODULE_DIRS += “YOUR_PATH”/RIOT-master/examples/test USEMODULE += libmbed INCLUDES += -I/”YOUR_PATH”/RIOT-master/MBED

2 things: Have you added the Makefile.base to the directory “YOUR_PATH”/RIOT-master/examples/test?

It has to contain the following

MODULE = libmbed include $(RIOTBASE)/Makefile.base

You can leave out the first line, if the directory it resides in is called libmbed (in your example you would need to rename “YOUR_PATH”/RIOT-master/examples/test to “YOUR_PATH”/RIOT-master/examples/libmbed).

I export all .o depending on my board and create the libmed.a with the command “ar -q libmed.a” . I use the mbed export to gcc, compile it with the “GCC ARM Embedded 4.7 update 4” Toolchain and it works ! But when I tried to compile with RIOT-OS, its like it isn’t able to find the functions include in this lib.

Mind that the external module approach only works if you have the source files (the .c(pp) or .s files) in this directory. If you only have the object files, try copying them into the directory “YOUR_PATH”/RIOT-master/examples/bin/YOUR_BOARD/".

Good luck, Martine

Hi again

Hi Tararaina,

for helping you with your problem, could share a link to your code with us? Or/and could you run `make` with command line option `QUIET=0` and paste the output to pastepin [1] or a gist [2]?

Best, Thomas

[1] pastebin.com [2] gist.github.com