cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 HAL library: HAL_SPI_Transmit_DMA is referencing RX side DMA handle for packing mode check

There is a packing mode check in Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi.c, function HAL_SPI_Transmit_DMA

around line 1464, that is referencing RX side DMA handle:

1464   /* Packing mode management is enabled by the DMA settings */
1465   if (((hspi->Init.DataSize > SPI_DATASIZE_16BIT) && (hspi->hdmarx->Init.MemDataAlignment !=      DMA_MDATAALIGN_WORD))    || \
1466       ((hspi->Init.DataSize > SPI_DATASIZE_8BIT) && ((hspi->hdmarx->Init.MemDataAlignment !=      DMA_MDATAALIGN_HALFWORD) && \
1467                                                          (hspi->hdmarx->Init.MemDataAlignmen     t != DMA_MDATAALIGN_WORD))))
1468   {
1469     /* Restriction the DMA data received is not allowed in this mode */
1470     errorcode = HAL_ERROR;
1471     __HAL_UNLOCK(hspi);
1472     return errorcode;
1473   }

I believe all references to hdmarx should be hdmatx in this context. The hdmarx may not even be initialized properly.

Thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Yoichi Shinoda​ ,

We have already passed this issue along to our development team for fix in the coming release of STM32CubeH7.

Thanks for your contribution.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

1 REPLY 1
Imen.D
ST Employee

Hello @Yoichi Shinoda​ ,

We have already passed this issue along to our development team for fix in the coming release of STM32CubeH7.

Thanks for your contribution.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen