Using STM32CubeMX and PlatformIO

Could you try lib_archive = false?