Skip to main content
Visitor II
February 23, 2021
Solved

HAL_SPI_Transmit_DMA. If I transmit a big amount of data (30000 bytes), it fail

  • February 23, 2021
  • 2 replies
  • 1153 views

Hi!

I'm using STM32H7 for a new project, and I need to send data through HAL_SPI_Transmit_DMA to an external MRAM.

I have a block of 34000 bytes. If i send this: HAL_SPI_Transmit_DMA(&MRAM_SPI_H, buf, 34000); there is some write problem (when I read the data, some bit is changed so the CRC error takes place).

However, If i send the same block of data but divided in few parts (for example, parts of 5000 bytes): HAL_SPI_Transmit_DMA(&MRAM_SPI_H, buf, 5000) then the data reading is completely correct.

The maximum size of the SPI transaction is uint16_t so, what could be the problem?

Thank you so much in advance

Josep

    This topic has been closed for replies.
    Best answer by JosepM Ribera

    Solved.

    The problem was the timeout value of the reading function. The reading is using regular SPI HAL_SPI_Receive and the timeout value wasn't enough for the 34KB.

    Thank you

    2 replies

    Graduate II
    February 23, 2021

    >>what could be the problem?

    Cache coherency? MPU memory region setting?

    Does the memory device have a transactional limit or timeout?

    JosepM RiberaAuthorAnswer
    Visitor II
    February 24, 2021

    Solved.

    The problem was the timeout value of the reading function. The reading is using regular SPI HAL_SPI_Receive and the timeout value wasn't enough for the 34KB.

    Thank you