cancel
Showing results for 
Search instead for 
Did you mean: 

Organising single software tree for many projects WITHOUT duplicating Drivers/Middlewares

alister
Lead

I'd like to organise a software tree that'll accommodate

  • bootloader for a custom board,
  • application for the board,
  • multiple ways of building the application,
  • bootloaders and applications of future "next gen" boards, and
  • a moderate body of application software I'd want to re-use in all the app projects.

I'd like this in a single repository, without duplicating any source files.

I'm using IAR Workbench and/or TrueSTUDIO for STM32.

Both IDEs support

  • multiple projects, i.e. one for each of bootloader for board X, app for board X,
  • multiple build ways, e.g. IAR uses "Configurations" and TrueSTUDIO (Eclipse) uses "Build Configurations", and
  • linking other directories of source files.

The only part I haven't completely solved yet is STM32CubeMX. UM2285 Rev 1 figure 3 shows an .ioc file in a project directory and the Drivers and Middlewares directories it generates located several directories higher at the root of the software tree. Can anyone share how to get STM32CubeMX to generate like this please?

Having Drivers/Middlewares directories duplicated in every project isn't a show-stopper. Just untidy and so I'm wanting to know.

Thanks

Alister

4 REPLIES 4

hi

In CubeMX, Project manager, Code generator tab check the third option, to add all theese libraries as reference and not copy them.

0690X000006DcH0QAK.jpg

I'd experimented with that and STM32CubeMX generated paths like these in the (IAR) project file:

<state>C:/Users/alister/STM32Cube/Repository/STM32Cube_FW_F7_V1.14.0/Drivers/STM32F7xx_HAL_Driver/Inc</state>
...

The problem here is that other developers cloning or pulling the repository would have different user names.

If you've been here, what was your fix to this?

Thanks

Alister

I've experimented just now changing STM32CubeMX's Firmware Location to point to the root of my software tree, where I already have the Drivers and Middlewares directories and want them to remain.

STM32CubeMX displays the path as absolute. But on generate, I see it's saved the path as relative, which is promising.

E.g. in the .ioc:

ProjectManager.CustomerFirmwarePackage=..\\..\\..\\..\\..

And in the .ewp (IAR project):

          <state>$PROJ_DIR$/../../../../../../Drivers/STM32F7xx_HAL_Driver/Inc</state>
...
    <group>
      <name>STM32F7xx_HAL_Driver</name>
      <file>
        <name>$PROJ_DIR$/../../../../../../Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_adc.c</name>
...

It's a step forward. FW update workflow is a bit impacted. To update version or change Middlewares I'd have to copy manually, and take care they're consistent (all the same version).

Vangelis or anyone have further/other ideas to share please?

alister
Lead

I've not experimented further with the idea (11 days ago) of changing STM32CubeMX's Firmware Location to point to the root of my software tree.

I'm concerned this may have impacts I'm unaware.

Does anyone have other experience or ideas to share please?

Thanks

Alister