cancel
Showing results for 
Search instead for 
Did you mean: 

Why examples are not in the way CubeIDE (CubeMX) generate the code?

JSzem.1
Associate II

I like the way CubeIDE generate the code. Especially with "Generate peripheral initialization as a pair of '.c/.h' files per peripheral".

This is very helpful tools not only for start the project but also for checking particular functionality.

Why examples delivered by STM are not in exactly this shape?

It will be very comfortable to compare our code with STM's examples code.

It will be also welcome to see the examples code with "Generate peripheral initialization as a pair of '.c/.h' files per peripheral" option. The code is more clean.

Please consider use this option at least for Low Layer examples.

1 ACCEPTED SOLUTION

Accepted Solutions

I don't use Cube/CubeMX/CubeIDE, but this is a recurring question here and ST's answer is "they will come in this format, and the newer families' examples already are".

So maybe check out CubeG4 or something like that.

JW

View solution in original post

3 REPLIES 3
berendi
Principal

It is much faster to port the code from one board to another than to recreate them for every single development board.

Most examples were created before CubeMX even existed.

CubeMX code generation does not always work, and even when it works, it covers only a small fraction of the capabilities of the hardware. There are examples that are impossible to create in the CubeMX code structure.

I don't use Cube/CubeMX/CubeIDE, but this is a recurring question here and ST's answer is "they will come in this format, and the newer families' examples already are".

So maybe check out CubeG4 or something like that.

JW

JSzem.1
Associate II

Thank you waclawek.jan.

I found the CubeL5 the best in terms of Low Layer Examples.

This is probably the newes one.