Skip to main content
frackers
Senior
August 5, 2016
Question

Bug in HAL_SPI F3 V1.5 Library HAL_SPI_Receive_DMA

  • August 5, 2016
  • 4 replies
  • 969 views
Posted on August 05, 2016 at 05:17

The implementation of HAL_SPI_Receive_DMA() assumes that the Transmit is also DMA and uses HAL_SPI_TransmitReceive_DMA() internally which tries to write to a non-existent Tx DMA transfer complete callback (line 1622 of stm32f3xx_hal_spi.c) causing a hard fault.

I've run out of DMA channels so I don't have the option of using DMA transmit.

I would suggest that HAL_SPI_TransmitReceive_DMA() is modified to check the existence of the transmit (and/or receive) buffer and NOT try and write to non-existent variables.

    This topic has been closed for replies.

    4 replies

    frackers
    frackersAuthor
    Senior
    August 10, 2016
    Posted on August 11, 2016 at 01:27

    Further testing makes me wonder if any of the SPI code other than the basic operation has actually been used by anyone!! 

    Neither DMA or interrupt mode seem to do as advertised - the DAC, 4 UARTs are all working fine with a combination of DMA and interrupt I/O but the SPI totally defeats me :(

    slimen
    Visitor II
    September 1, 2016
    Posted on September 01, 2016 at 18:02

    Hi frackers,

    I think it's known issue as for F1 in this [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/Bug%20STM32CubeF1%20V1.2.0%20HAL_SPI_Receive_DMA%28%29&currentviews=9]thread. 

    Regards

    ST Technical Moderator
    January 25, 2017
    Posted on January 25, 2017 at 18:22

    Hello frackers, 

    Thank you for highlighting this issue. 

    I would inform you that this problem

    is fixed in the release of STM32CubeF3 V1.7.0.

    All your feedback and suggestions are welcome.

    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
    Code Wrangler
    Associate II
    November 5, 2018

    Thanks frackers. You just saved me hours of debugging time. Still broken in F4 Version 1.21.0 (CubeMX version 4.27.0).