Short description: when stm32hal been built from CumeMX sources, with the same options as PIO use,
.data.impure_data appears in output and eats 1K RAM.
I use CubeMX to generate chip init configs. For consistency reasons, i’l like to build HAL from CubeMX sources, instead of PIO built-ins. So, carefully inspected
_bare.py and created post-script to patch
_bare.py output envs - make it look like after
In general, that works, but memory consumption increased for 1K due injected
impure_data variable. CLI params of compiler/linker looks the same. HAL version is the same (F0 1.9.0). I did not edited HAL files and application files. Only added the same version, generated by CubeMX and builded project. Intrusion is zero.
Can anybody help to get rid of
For compare - use
dev branch and see memory report after build.
To see missed size, in directory with elf file run:
objdump -x ./pio/build/hardware_usb/firmware.elf | grep impure` # or nm --print-size --size-sort --demangle --radix=d .pio/build/hardware_usb/firmware.elf | grep "\s[bB]\s"