cancel
Showing results for 
Search instead for 
Did you mean: 

Please add a preprocessor define to disable compilation of weak functions in the HAL

riwe
Visitor

The STM32 HAL is good and simple. It's highly appreciated that I am not forced to use a certain build system. But there is one thing that drives me crazy: The STM32 HAL has lots of weakly defined symbols. That forces me to put any strong symbol overrides into objects linked with the executable. It is impossible to put the HAL and the strong symbol overrides into a or different static libraries. It's a nightmare. Consider projects where all hardware-related code is hidden in static libraries and the executable code is platform-independent.

A pragmatic solution could be to enclose all weak function definitions in the ST32 SDK inside ifdef guards to be able to switch those off. I will now copy the related HAL files out of the SDK and patch them on my own. That's not optimal because I will have to repeat that on every SDK update.

Please consider to fix this problem.

0 REPLIES 0