cancel
Showing results for 
Search instead for 
Did you mean: 

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

JosepM Ribera
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
JosepM Ribera
Associate III

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

View solution in original post

2 REPLIES 2

>>what could be the problem?

Cache coherency? MPU memory region setting?

Does the memory device have a transactional limit or timeout?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JosepM Ribera
Associate III

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