2016-02-13 01:31 PM
Hello,
in the new CubeMx STM32F4 1.11 library there is a new bug introduced. There is this new feature:Add new define USE_SPI_CRC for code cleanup when the CRC calculation is disabled.
The codegenerator generates (if CRC is disabled) in file stm32f4_hal_conf.h &sharpdefine USE_SPI_CRC 0U And the library checks against: &sharpifdef USE_SPI_CRC The problem is that even the USE_SPI_CRC is defined to ZERO, it IS DEFINED. So that the preprocessor ALWAYS handle&sharpifdef USE_SPI_CRC
as defined. I see here two solutions: 1) do not define USE_SPI_CRC at all in this case CRC is not used, i.e. comment out the line 2) for testing if the feature should be used rewrite the test to: &sharpif USE_SPI_CRC I think the 2) is the more robust. (You should not &sharpundef ) 1) AND 2) is I thing more optimal. For now I undef the generated code always after every generation :( regards, Adib. #!stm32-!cubemx-!spi-!bug #-2016-02-14 08:30 AM
2016-02-29 07:57 AM
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2016-03-02 04:33 AM
Undef after every generation is error-prone. You can find more bugs and fixing all of them every regeneration is really wrong.
I'm fixing bugs right inside code 'repository' on my PC. For example SPI CRC problem:1. Open file ''C:\Users\%USERNAME%\STM32Cube\Repository\STM32Cube_FW_F4_V1.11.0\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c''2. Find line #include ''stm32f4xx_hal.h''3. After that line add code: #undef USE_SPI_CRC4. Now regenerate code and forget about bug2016-04-12 05:29 AM