Goodmorning,
I'm trying to divide my project into two parts: a library (which contains the code that I rarely change) and an application (that I often change and calls library methods).
Besides I need that some constants can be shared beetween the library and the application with a common header file and possibly, if I change the constant values contained in this header file, I'd like to avoid recompiling the library each time.
I know that something like that is possble with Microchip MPLABx: https://www.microchip.com/forums/m1092866.aspx
Is it possible to do the same with MCUExpresso?
Thank you.
Solved! Go to Solution.
Hello @ErichStyger ,
thank you for your article and answer. I've just realized that you are the person that write all those good articles on mcuoneclipse!! It's an honour and a pleasure. I've recently find out about MCUExpresso Working Set following you indications, and others.
Concerning the library, I finished yesterday and it works! It's been a bit demanding because I had to convert a lot of #defines into consts and extern consts, so that library constants can be configured in the application.
For the library I've followed this one: https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Creating-and-Linking-to-Library-Projects/m-p/469212. Did you know it?
I had to start a brand new project since, as far as I understood, it's the only way to have a static library.
Trying to change the Build Artifact for an existing project, the only possibilities are: Shared Library and executable.
However I'm going to read your article for checking how you would do it. Thank you again for your work, highly appreciate!
Hi @Davidino ,
the following article might be of interest for you too:
https://mcuoneclipse.com/2022/06/21/tutorial-creating-and-using-rom-libraries-with-gnu-build-tools/
It is yet another way how to share things between an application and a library.
Erich
Hello @ErichStyger ,
thank you for your article and answer. I've just realized that you are the person that write all those good articles on mcuoneclipse!! It's an honour and a pleasure. I've recently find out about MCUExpresso Working Set following you indications, and others.
Concerning the library, I finished yesterday and it works! It's been a bit demanding because I had to convert a lot of #defines into consts and extern consts, so that library constants can be configured in the application.
For the library I've followed this one: https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Creating-and-Linking-to-Library-Projects/m-p/469212. Did you know it?
I had to start a brand new project since, as far as I understood, it's the only way to have a static library.
Trying to change the Build Artifact for an existing project, the only possibilities are: Shared Library and executable.
However I'm going to read your article for checking how you would do it. Thank you again for your work, highly appreciate!
Did you know it?
Yes, see as well https://mcuoneclipse.com/tag/libraries/
Thank you for your article and answer. I've just realized that you are the person that write all those good articles on mcuoneclipse!! It's an honour and a pleasure. I've recently find out about MCUExpresso Working Set following you indications, and others.
Thank you :-).
Erich
Hi @Davidino,
Is it possible to do the same with MCUExpresso?
Short answer: yes.
Longer answer: yes, and that Microchip forum just describes a plain-vanilla approach with GNU tools and libraries. As said in that article: You just need to keep that .a file and .h file in sync: if you need to recompile the library or not, depends on your constant usage: if the constant change both for the library and the application, then of course you need to recompile it.
I hope this helps,
Erich