Bug in the latest STM32CubeIDE relating to the compilation of release code using the Ofast optimisation
Looks like we've come across a bug in the latest STM32CubeIDE relating to the compilation of release code using the Ofast optimisation.
Recompiling using anything else, including O3 "Most optimized" does not cause this failure.
I've copied below the code details; 32F407VG on Discovery board.
BR
Rob
**** O3fast optimisation: sampleRateDecim passed in == 12000
a_buffer passed in is in CCM RAM, this is it´s structure definition:-
typedef float32_t audio_block_t[AUDIO_BLOCK_SIZE];
typedef struct
{
// Stereo buffers
iq_buffer_t iq_buf;
float32_t agc_valbuf[IQ_BLOCK_SIZE];
audio_block_t a_buffer[2];
demod_sam_param_t sam;
iq_correction_data_t iq_corr;
} AudioDriverBuffer;
AudioDriverBuffer section (".ccm") adb;
static void DemodPostprocessing(float32_t (*a_buffer)[AUDIO_BLOCK_SIZE], const size_t blockSize, const size_t blockSizeDecim, const uint32_t sampleRateDecim)
{
const uint8_t dspActive = ts.dsp.active;
const uint8_t dmodMode = ts.dmodMode;
if (!dsp.inhibit) // dsp.inhibit == 0
{
if ((dspActive & DNOTCH_ENABLE) && (dmodMode != DEMOD_CW) && !((dmodMode == DEMOD_SAM) && (sampleRateDecim == 24000)))
{
*** Note: not called as sampleRateDecim == 24000 is false
NotchFilter(blockSizeDecim, a_buffer[0]); // Do notch filter
}
}
*** FAIL: sampleRateDecim, marked const, is no longer == 12000, changes to something like1958 !!!
