STM32H7 QSPI/OSPI critical code-gen bugs (CubeIDE 1.6.1)
Codegeneration for QSPI/OCTOSPI currently fails to enable a required clock and also passes an invalid value in the initialization struct.
This is important to fix because especially the clock-issue was very hard to identify (and avoiding such init-pitfalls is IMO the core reason for the whole Cube-stuff to EXIST).
The generated function HAL_OSPI_MspInit should call:
__HAL_RCC_OCTOSPIM_CLK_ENABLE()
but it never does.
In MX_OCTOSPI2_Init, there should be a line like:
sOspiManagerCfg.Req2AckTime = 1;
because this value is asserted to be non-zero in HAL_OSPIM_Config.
Current workaround:
Manually fix both in the user-section of MX_OCTOSPI2_Init:
/* USER CODE BEGIN OCTOSPI2_Init 1 */
__HAL_RCC_OCTOSPIM_CLK_ENABLE();
sOspiManagerCfg.Req2AckTime = 1;
/* USER CODE END OCTOSPI2_Init 1 */
How to reproduce:
Attempt to use OCTOSPI2 peripheral (USE_FULL_ASSERT required for the invalid-Req2AckTime-check).
I can provide a fairly minimal *.ioc file if needed.
Versions:
CubeIDE 1.6.1, using STMCube_FW_H7 v1.9.0
I would gladly submit a pull-request or somesuch for issues like these to expedite the process but not sure if this is possible/helpful/where this should happen (any info on this would be appreciated).