Skip to main content
kyrreaa
Associate III
January 13, 2021
Question

Why is there no way to export a CMSIS/HAL set from CubeMX?

  • January 13, 2021
  • 3 replies
  • 1359 views

The packs we can download contain entire STM32Fx series with include files for everything.

When we select a specific MCU in CubeMX we should be able to use this to export a "clean" set of HAL and CMSIS files as well as potential low level boot/init files without generating the init code etc with placeholders for usercode. Many users just need the updated libraries as the flexibility of the init with CubeMX is very limited and static.

This topic has been closed for replies.

3 replies

KnarfB
Super User
January 13, 2021

how about using the github repos like https://github.com/STMicroelectronics/STM32CubeG4/ etc.?

kyrreaa
kyrreaaAuthor
Associate III
January 13, 2021

The repos are just like the cube bundles except some files are placeholders so you would have to download packs. It still does not solve the issue of having 100+ files that would be sifted out by CubeMX during the normal export.

Basically, if you activated all peripherals and exported but deleted all init code you would have something... Also, earlier CubeMX versions allowed you to select if you wanted low level access of hal access being used. Seems gone now.

TDK
January 13, 2021

I also wish this was a feature. I copy files over manually and never regenerate code in-place.

> Also, earlier CubeMX versions allowed you to select if you wanted low level access of hal access being used. Seems gone now.

You can choose HAL or LL in Project Manager -> Advanced Settings.

"If you feel a post has answered your question, please click ""Accept as Solution""."
kyrreaa
kyrreaaAuthor
Associate III
January 13, 2021

Aha! So it is still there, but now you can select it for every driver.

Problem is, you can't get CubeMX to export the drivers unless you assign a pin to use the peripheral and then you start generating all the silly init code again.

The "Copy all libraries" option is now "all used libraries".

You can copy only necessary but what is difference between used and necessary?

kyrreaa
kyrreaaAuthor
Associate III
January 13, 2021

I did a test and "copy all used libraries..." is wrong. It copies all pertinent libraries for the selected chip, which is close to what I wanted!

"Copy only necessary library files" does as it says and skips any peripheral files if you have not used them in the setup.