Legacy Firmware

Hi All,

I have a large amount of legacy firmware that I’d like to bring into my Legato application. What is the appropriate method to accomplish this? My current understanding is that I would just compile that code as a static library, and pull it into the required components using something like this:

cxxflags:
{
    -I ${MY_SYSTEM_DIR}/submodule/include
}

lddflags:
{
    -Wl,--whole-archive -lmylib -Wl,--no-whole-archive
}

But I would also like to have the project recompile the library if I make any changes to it. Also, as a side note, it’s currently set up as a git submodule, so it needs to be in it’s own directory.

Thanks,
Chris

Hi @chrisc,

I’d recommend creating a Legato Component and using externalBuild to cross-compile the static library.

Some examples of this can be seen in the Legato GitHub repo here.

Your library will be recompiled when you (re)build an App utilising the Component.

Cheers,
Raf

Hi @raf,

Thanks for the info. That definitely put me in the right direction. Still need more work on my part, but it definitely seems like the way to go.

Chris