简体   繁体   English

为 ARM cortex-m4 创建多个应用程序的共享库

[英]Create a shared library for multiple applications for ARM cortex-m4

I'm trying to create project which contains a drivers library and two separate application (Booltloader + app), now I want to share the drives library between the two apps in order to save space on the flash...我正在尝试创建包含一个驱动程序库和两个独立应用程序(Booltloader + 应用程序)的项目,现在我想在两个应用程序之间共享驱动程序库,以节省 flash 上的空间...

I saw this tutorial for IAR, but I must use Keil uvision5 and I didnt find anything helpful online.我看到了这个 IAR 教程,但我必须使用 Keil uvision5,我没有在网上找到任何有用的东西。

Anyone can guide me through this?任何人都可以指导我完成这个吗?

thanks!谢谢!

Splitting the code into three parts (bootloader, library, application) most likely is too much.将代码分成三部分(引导加载程序、库、应用程序)很可能太多了。 I think it is better to combine the bootloader and the drivers in a single binary.我认为最好将引导加载程序和驱动程序组合在一个二进制文件中。 While calling the application, the bootloader can provide information necessary to use the drivers.调用应用程序时,引导加载程序可以提供使用驱动程序所需的信息。

A word of caution, though: a solution like this is way more tricky than just compiling the drivers in the application.不过请注意:这样的解决方案比仅在应用程序中编译驱动程序要复杂得多。 Depending on the driver functions, there may be no true benefit on flash usage.根据驱动程序的功能,flash 的使用可能没有真正的好处。 In particular, if many drivers are not necessary, they will just occupy the flash instead of getting optimized-out.特别是,如果不需要很多驱动程序,它们将只占用 flash 而不是优化输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM