Skip to main content
Yoichi Shinoda
Senior
March 26, 2019
Solved

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

  • March 26, 2019
  • 1 reply
  • 788 views

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?

This topic has been closed for replies.
Best answer by Imen.D

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

1 reply

Imen.DBest answer
ST Technical Moderator
March 26, 2019

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks