2024-08-21 03:41 AM - edited 2024-08-21 03:42 AM
Hi,
For the SPI transfer APIs with suffix '_DMA'. In the transmit and receive alone ones, they checked 'hspi->hdmatx' and 'hspi->hdmarx' respectively. But in 'HAL_SPI_TransmitReceive_DMA()', it only check the 'hspi->hdmarx'. Funny :), and why?
/* Packing mode management is enabled by the DMA settings */
if (((hspi->Init.DataSize > SPI_DATASIZE_16BIT) && (hspi->hdmarx->Init.DestDataWidth != DMA_DEST_DATAWIDTH_WORD) && \
(IS_SPI_FULL_INSTANCE(hspi->Instance))) || \
((hspi->Init.DataSize > SPI_DATASIZE_8BIT) && (hspi->hdmarx->Init.DestDataWidth == DMA_DEST_DATAWIDTH_BYTE)))
{
/* Restriction the DMA data received is not allowed in this mode */
/* Unlock the process */
__HAL_UNLOCK(hspi);
return HAL_ERROR;
}
Thanks.
2024-08-21 04:59 AM - edited 2024-08-21 05:08 AM
Hello @diverger,
I have passed this issue along to our development team for fix via an internal ticket number 189085 (this ticket number is only for reference and not available outside of ST).
Thank you for your contribution.