Unable to get FP-SNS-ALLMEMS1 firmware working correctly when compiled for BlueCoin
I need to make some modifications to the FP-SNS-ALLMEMS1 firmware for BlueCoin, but when compiling the project using STM32CubeIDE 1.9.0, the resulting firmware only works partially for getting streaming audio over BLE (BlueVoice in mobile app). I only get audio data when Beamforming is enabled in the app. With beamforming disabled the firmware just sends a flat line (all zeros). The binary file provided in the package does work correctly with or without beamforming, but when compiling the code under STM32CubeIDE, it only gets audio out with beamforming on.
I'm also unable to produce a bin file that works at all (I can only get semi-working firmware by download/debug within the IDE). There is an included batch file and shell script, but these require a .bin file to already exist, but the .bin file output is not enabled in the project settings. Enabling the .bin file generation in the project settings for the Release build, and then running the CleanALLMEMS1_STM32CubeIDE_BC.sh script, the script runs successfully and generates the stm32f446me-bluecoin_allmems1_bl.bin file which is the combined bootloader+firmware file, however when programming this into the BlueCoin it does not result in any working firmware, LEDs don't come on, and the BlueCoin is not doing BLE advertising either. I also noticed that the binary files are significantly larger than the supplied binary files:
Binary files built using STM32CubeIDE 1.9.0:
STM32F446ME-BlueCoin_ALLMEMS1.bin - 238,392 bytes
STM32F446ME-BlueCoin_ALLMEMS1_BL.bin - 254,776 bytes
Pre-built binary files supplied in "Binary" folder:
STM32F446ME-BlueCoin_ALLMEMS1_v4.2.0.bin - 228,908 bytes
STM32F446ME-BlueCoin_ALLMEMS1_BL_v4.2.0.bin - 245,292 bytes
The fact that the supplied binary files are so much smaller and the project already uses -Os (optimize for size) suggests that the supplied binaries were produced using a different compiler.
In general it seems like it's not possible to produce a fully working ALLMEMS1 firmware for the BlueCoin using STM32CubeIDE 1.9.0.
This issue is very easy to reproduce, simply import the STM32F446ME-BlueCoin project into STM32CubeIDE 1.9.0, build the project (without any modifications) and then download it into the BlueCoin via a Nucleo/STLink. Maybe it's an issue specific to STM32CubeIDE, and works with a different compiler?
