2015-08-21 06:42 AM
Hello all,
When using the STM32CUBEF1 V1.2.0 HAL-library with SPI and DMA transfer just for receiving data, I came across unusual behaviour. An investigation showed, that the functionHAL_SPI_Receive_DMA() sets the callback functions of the transmit DMA handle to 0. When not using a DMA for TX at all, the handle hdma is already 0, leading to dereferencing a nullpointer and causing a hard fault./* Reset content of SPI TxDMA descriptor */
hspi->hdmatx->XferHalfCpltCallback = 0;
hspi->hdmatx->XferCpltCallback = 0;
hspi->hdmatx->XferErrorCallback = 0;
The same applies to the functionHAL_SPI_Transmit_DMA().
/* Reset content of SPI RxDMA descriptor */
hspi->hdmarx->XferHalfCpltCallback = 0;
hspi->hdmarx->XferCpltCallback = 0;
hspi->hdmarx->XferErrorCallback = 0;
The file in question is\STM32Cube_FW_F1_V1.2.0\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c
Maybe this issue could be resolved for the next release of the software.
Regards,
Alex
#stm32cubef1 #spi #bug #cubef1
2015-08-21 08:26 AM
Hi brunner.alexander,
I will report the issue to our development team.Thank you for the information and sorry for the inconvenience that it may bring-Syrine-2015-08-24 02:58 AM
Hi brunner.alexander,
The reported issue is confirmed. It will be fixed in one of coming releases.-Syrine-2015-08-24 03:28 AM
Hello,
thank you for the quick response, that's good news.Regards,Alex2017-02-22 02:10 PM
Nesrine,
Well here it is almost a year and a half later and the issue still exists withSTM32Cube FW_F0 V1.7.0.
Is it ever going to be fixed?
Dave