cancel
Showing results for 
Search instead for 
Did you mean: 

Why does code generated from CubeMX not adhere to the C standard?

fsch
Associate III

The C standard says in 7.1.3 Reserved identifiers:

"All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use."

Yet the code CubeMX generates is full of __HAL... identifiers. Is there a reason for that?

Also, the code does not include needed headers. E.g. stm32f4xx_hal.h uses uint32_t without including stdint.h.

Are there efforts to improve on this kind of issues?

10 REPLIES 10
fsch
Associate III

Thanks for all the answers.

I read some things about ST HAL and looked at its code and it becomes more likely we will drop it rather sooner than later either for Chibi HAL or for a plain old hand-written layer. Sure, ST is a great hardware company with really good documentation. Thumbs up for that.

When it comes to certification, we are currently talking to ST directly and we will see what comes out of that.

Cheers