I am trying to understand and implement a method of reusable code, starting with STM32 projects. Any ideas on the best method(s)?
Hi,
I am trying to implement a method of reusable code starting with STM32 projects. I have multiple micro controllers (F4, F7 etc) that will need to run the same application code. As STM generate the Drivers/HAL for me. Would I need to write API functions that will sit between the application code and the HAL functions?
In terms of version control, I would be looking at making the application code and API code submodules, and having the hardware project with the Drivers and HAL etc in its own repo too. The application and API sub modules won't be able to build individually, but when built with the main hardware project they will.
I was thinking of having it structured something like this:
Code/
API/
Inc/
Src/
Application/
Inc/
Src/
Core/
Inc/
Src/
Drivers/
Middlewares/
Test/
"Similar structure to Code/ but only for my own code"I've read some books and searched Google etc but there does not seem to be enough information for what I need. I've seen examples of making the HAL layer reusable, I'm guessing its normal for the HAL/API/Application code to not be built separately and only all together?
Any feedback or suggestions or help would be very much appreciated.
Thanks!
