cancel
Showing results for 
Search instead for 
Did you mean: 

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

kyrreaa
Associate III

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.

7 REPLIES 7
KnarfB
Principal III

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

kyrreaa
Associate III

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
Guru

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
Associate III

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?

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.

Hover over it, it will explain.
This is exactly the option you want, but it's disabled for STM32CubeIDE projects.
If you feel a post has answered your question, please click "Accept as Solution".

I think this is because CubeIDE compiles anything it finds in the folders by default.

This is odd behavior as you can easily go to properties on a file and select to not have it compiled.

It does however list any files in the folders while for example EmBitz and Vistual Studio does not. They have a list of files included in project for compile and only displays those in tree overview/listing.

I wish we could have EmBitz support in CubeMX. It is so much faster to use than these behemoths of code. Would be even nicer if it had a newer CMSIS built in. Then I could just ignore CubeMX.