Stm32cube - how to drop default "stm32YYxx_hal_conf_template.h"

On build, ststm32 platform copies stm32YYxx_hal_conf_template.h to stm32YYxx_hal_conf.h.

That works, but only until you need to use custom stm32YYxx_hal_conf.h, generated by stm32cubeMX. For example, if you wish to use HAL callbacks instead of global weak functions.

How can i ignore/drop default stm32YYxx_hal_conf.h? (extra python script would be ok too)

As written in the builder script

just use

board_build.stm32cube.custom_config_header = yes

in the platformio.ini to ignore PlatformIO’s built-in config file.

Documenting this option is an open issue per No docs on STM32Cube builder options · Issue #213 · platformio/platformio-docs · GitHub.

1 Like