cancel
Showing results for 
Search instead for 
Did you mean: 

Error in CubeMX code generation for Quad SPI with MDMA on STM32H723ZG

JBand.2
Associate II

Hi,

When generating code for the STM32H723ZG OCTO SPI2 peripheral it does not generate the __HAL_LINKDMA(ospiHandle, hmdma, hmdma_octospi2_fifo_th); macro for linking the MDMA.

This happens for me when using MDMA channel 2 with the octo spi 2 peripheral configured as quad spi. For now I can fix this issue by adding the __HAL_LINKDMA(ospiHandle, hmdma, hmdma_octospi2_fifo_th) macro manually to the code but it disappears on code generation.

The neccessary macro however is generated on the octo spi 1 peripheral. I have added the CubeMX file with my current configuration.

Also a little code snipped where the macro should be placed.

   hmdma_octospi2_fifo_th.Init.SourceBurst              = MDMA_SOURCE_BURST_SINGLE;
    hmdma_octospi2_fifo_th.Init.DestBurst                = MDMA_DEST_BURST_SINGLE;
    hmdma_octospi2_fifo_th.Init.SourceBlockAddressOffset = 0;
    hmdma_octospi2_fifo_th.Init.DestBlockAddressOffset   = 0;
    if (HAL_MDMA_Init(&hmdma_octospi2_fifo_th) != HAL_OK) {
      Error_Handler();
    }
 
    if (HAL_MDMA_ConfigPostRequestMask(&hmdma_octospi2_fifo_th, 0, 0) != HAL_OK) {
      Error_Handler();
    }
   // OFFENDING CODE: The macro below is not added when generating the project.
    __HAL_LINKDMA(ospiHandle, hmdma, hmdma_octospi2_fifo_th);
    /* OCTOSPI2 interrupt Init */
    HAL_NVIC_SetPriority(OCTOSPI2_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(OCTOSPI2_IRQn);
    /* USER CODE BEGIN OCTOSPI2_MspInit 1 */
 
    /* USER CODE END OCTOSPI2_MspInit 1 */

3 REPLIES 3
Amel NASRI
ST Employee

Hi @JBand.2​ ,

Thanks for reporting this issue and sharing the ioc file that helps to reproduce it.

I added relevant topics (Mainly STM32CubeMX) to help our experts (@Khouloud OTHMAN​  & @Khouloud ZEMMELI​ ) review it and take the required corrective actions.

-Amel

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.

Khouloud ZEMMELI
ST Employee

Hello @JBand.2​ ,

I have checked from my side and you're right, I confirm the problem.

Thanks for raising this issue to our attention, it will be fixed.

Thanks for your contribution :)

Khouloud

Thank you for the swift response! I am looking forward to the fix.

Thanks!