2022-05-10 04:09 PM
I was able to resolve by adding to SPI2_Init
/* USER CODE BEGIN SPI2_Init 1 */
hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;
But STM32CubeIDE 1.8.0 with same version FW_L1 V1.10.3 does have the options as below
This is concerning, as upgrading to 1.9.0 then regenerating the project would change the auto generated SPI2_Init back to the default CPOL and CPHA
Alec Davis
Solved! Go to Solution.
2022-05-11 03:13 AM
Hello @Community member ,
Thanks for sharing your finding, It is indeed a CubeMX issue, CPOL and CPHA are missing from SPI configuration.
Your way to resolve this issue is correct and that is the only workaround available at the moment. CPOL and CPHA config should be added manually within the user section in SPIx_init function.
/* USER CODE BEGIN SPI2_Init 1 */
hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;
/* USER CODE END SPI2_Init 1 */
With this being said, I raised a ticket to the dev team to solve this issue. I will keep you posted.
Internal ticket number: 127964 (This is an internal tracking number and is not accessible or usable by customers).
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-05-11 03:13 AM
Hello @Community member ,
Thanks for sharing your finding, It is indeed a CubeMX issue, CPOL and CPHA are missing from SPI configuration.
Your way to resolve this issue is correct and that is the only workaround available at the moment. CPOL and CPHA config should be added manually within the user section in SPIx_init function.
/* USER CODE BEGIN SPI2_Init 1 */
hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;
/* USER CODE END SPI2_Init 1 */
With this being said, I raised a ticket to the dev team to solve this issue. I will keep you posted.
Internal ticket number: 127964 (This is an internal tracking number and is not accessible or usable by customers).
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-06-29 02:59 AM
Hello @Community member 2021,
This issue is fixed in STM32CubeMX latest release.
V6.6.0 is now available under this Link.
Thanks for your contribution.
Sara.