cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: STM32CubeF1 V1.2.0 HAL_SPI_Receive_DMA()

Posted on August 21, 2015 at 15:42

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
4 REPLIES 4
Nesrine M_O
Lead II
Posted on August 21, 2015 at 17:26

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-

Nesrine M_O
Lead II
Posted on August 24, 2015 at 11:58

Hi brunner.alexander,

The reported issue is confirmed. It will be fixed in one of coming releases.

-Syrine-

Posted on August 24, 2015 at 12:28

Hello,

thank you for the quick response, that's good news.

Regards,

Alex

Posted on February 22, 2017 at 22:10

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

https://assets2.jiveon.com/core/4.0.efc1903/images/tiny_mce3/themes/advanced/skins/default/img/progress.gif