cancel
Showing results for 
Search instead for 
Did you mean: 

General info on CubeMX generated projects.

Kristof Mulier
Associate III

I'm using the latest STM32CubeMX Version 5.3.0 (July 2019). I'm trying to wrap my head around the general project structure. Let's take for example a NUCLEO-F767ZI project generated by CubeMX.

I'll go through a few conclusions I've drawn so far.

1. The Drivers/CMSIS folder

The folder Drivers/CMSIS seems to be full of Templates and Examples. They are not part of the build.

Take the folder Drivers/CMSIS/Core/Include : all its files are duplicated into Drivers/CMSIS/Include. Only Drivers/CMSIS/Include is included in the build (see Makefile), folder Drivers/CMSIS/Core/Include doesn't participate. From this, I conclude that Drivers/CMSIS/Core and Drivers/CMSIS/Core_A are merely Templates/Examples. Is that correct?

Let's now observe the folders Drivers/CMSIS/RTOS and Drivers/CMSIS/RTOS2. It looks like these folders contain wrapper code for realtime operating systems, to make them compatible with the CMSIS standard. From my understanding, there are two versions of that standard for realtime operating systems: CMSIS-V1 and CMSIS-V2. Hence the two folders Drivers/CMSIS/RTOS and Drivers/CMSIS/RTOS2.

I just created a brand-new NUCLEO-F767ZI project in CubeMX with FreeRTOS wrapped in CMSIS-V1. The file Drivers/CMSIS/RTOS/Template/cmsis_os.h is not used in the build. But this file looks a lot like the one at Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h. They are not entirely the same, but there are enough similarities to suspect the latter is based on the former.

I've just created another NUCLEO-F767ZI project in CubeMX with FreeRTOS, but this time wrapped in CMSIS-V2. Also this time, the folder Drivers/CMSIS/RTOS2 seems to be merely a template for Middlewares/FreeRTOS/Source/CMSIS_RTOS_V2.

I suppose the folders Drivers/CMSIS/NN (Neural Networks) and Drivers/CMSIS/DSP (Digital Signal Processing) are merely templates?

CONCLUSION:

From the Drivers/CMSIS folder, only the subfolders Device and Include seem to be in use. All other subfolders are merely templates/examples.

2. The Drivers/CMSIS/Lib folder

This folder is a total mystery to me. Well, of course I can see that it contains .a library files - which are actually just (relocatable) object files that can be linked to the other object files at the end of the build procedure. In the subfolder GCC I can see three files:

  1. libarm_cortexM7l_math.a : I think this is a mathematical library for Cortex-M7 chips without floating point unit.
  2. libarm_cortexM7lfsp_math.a : I think this is a mathematical library for Cortex-M7 chips with single-precision floating point unit.
  3. libarm_cortexM7lfdp_math.a : The same, but for chips with dual-precision floating point unit.

So...

Is any of these library files used somewhere? I don't think they are, because they don't appear in the Makefile.

Imagine I want to use one of them - let's say the libarm_cortexM7lfdp_math.a , because the STM32F767ZI chip has a double-precision FPU. How do I practically do that?

3. My questions

My first question: Are the conclusions I've written down in §1 and §2 correct? If not, please enlighten me.

My second question: Where can I find more information about the general project structure? I mean, I know where to find info about the chips themselves (Datasheet, Reference Manual, ...) and also on how to use CubeMX. But I'm actually looking for documentation on the project code generated by CubeMX. Where can I find that?

Thank you so much =)

0 REPLIES 0