0

I am using Rowley CrossWorks as my IDE.

I have several STM32 projects created with STM32CubeMX which have several files that are shared as of now, by copying the source folder into each projects "src" folder.

This is obviously not an ideal solution.

How do I best merge the projects together, so that I can build the individual projects, with the same common files referenced? Preferably where the “drivers” folder and “inc” folder is also share from a common location.

  • Symbolic links could help on Linux, but I guess they could cause version control problems. Maybe git submodules can help. I had a somewhat related question here: https://stackoverflow.com/questions/60010580/should-cmsis-libraries-be-included-in-version-control – Tagli Jan 25 '21 at 12:12
  • It is good to keep shared (foreign) libraries in separate folders with version number (usually they include such version in folder name). By this way one of your projects may use `libX_ver_1.1` and other `libX_ver_2.2`. – i486 Jan 25 '21 at 13:57

2 Answers2

1

It is time to learn version control - the most popular and free is git

Git user manual

Your common libraries - GIT submodules.

0___________
  • 60,014
  • 4
  • 34
  • 74
  • Thanks for the input. I can not use GIT or other revision system solutions either, as it is not possible due to company politics. I have to use a solution that is local – Henrik Rune Jakobsen Jan 25 '21 at 13:40
  • 1
    @HenrikRuneJakobsen GIT is **LOCAL**. You can have uplink somewhere else but it is not needed for it. GIT is not github.com or gitlab.com. Git data reside on your local computer :) – 0___________ Jan 25 '21 at 13:41
  • @HenrikRuneJakobsen GIT is not equal to GitHub. GitHub is like a public hosting - you can use git for local project storage. – i486 Jan 25 '21 at 14:01
0

I have found a solution

i put the app specific code in a folder in the src folder. e.g \src\ and \src\appX \src\appY

Each solution is put into the MDK-ARM folder and then i edit the project file

<folder Name="Application/User">
  <file file_name="../Src/AppX/main.c" />

  <file file_name="../Src/AppX/settingsHandler.c" />
  <file file_name="../Src/AppX/settingsHandler.h" />
  <file file_name="../Src/AppX/cryptography.c" />
  <file file_name="../Src/AppX/cryptography.h" />

...

<folder Name="Application/User">
  <file file_name="../Src/AppY/main.c" />

  <file file_name="../Src/AppY/blah.c" />
  <file file_name="../Src/AppY/blah.h" />
  <file file_name="../Src/AppY/foo.c" />
  <file file_name="../Src/AppY/foo.h" />