This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Create a shared library for multiple applications for ARM cortex-m4

Hello everyone!

I'm trying to create project which contains a drivers library and two separate application (Booltloader + app), now I want to share the drivers library between the two apps in order to save space on the flash...

I saw this tutorial for IAR(https://www.iar.com/support/resources/articles/checksum-protected-library-using-iar-embedded-workbench-for-arm/) but I must use Keil uvision5 and I didnt find anything helpful online.

Anyone can guide me through this?

thanks!

Parents
  • I think you can get a long way toward what you want just following the IAR notes, translating where needed. Meaning: look at the Keil documentation for the functionality in each step of the IAR app note.

    In Keil, I created a shareable library as a library build (IAR made it an executable). I didn't use global or static variables (per the IAR recommendation), to avoid having to initialize them. So that could yet be a showstopper. 

    I added __atrribute__((used))  to each library function declaration so that the linker keeps them, and used a custom scatter file to position the application and library in known locations. The IAR app note added a checksum. I didn't look at that yet.

    The simple app works in the simulator -- haven't tried on a real device.

    The Keil IDE doesn't seem to handle dependencies as well as say, Visual Studio. Meaning that specifying the library location is more manual than you might like and build ordering isn't automagically handled.

Reply
  • I think you can get a long way toward what you want just following the IAR notes, translating where needed. Meaning: look at the Keil documentation for the functionality in each step of the IAR app note.

    In Keil, I created a shareable library as a library build (IAR made it an executable). I didn't use global or static variables (per the IAR recommendation), to avoid having to initialize them. So that could yet be a showstopper. 

    I added __atrribute__((used))  to each library function declaration so that the linker keeps them, and used a custom scatter file to position the application and library in known locations. The IAR app note added a checksum. I didn't look at that yet.

    The simple app works in the simulator -- haven't tried on a real device.

    The Keil IDE doesn't seem to handle dependencies as well as say, Visual Studio. Meaning that specifying the library location is more manual than you might like and build ordering isn't automagically handled.

Children