cancel
Showing results for 
Search instead for 
Did you mean: 

Always getting SPI OVR Error instead of executing SPI RX callback functions while interfacing SPI1 + DMA + STM32H7

nirav soni
Associate II

For DMA, allocating the buffer to the right memory segment,

I am already allocating the buffer in to D2 (0x30000000), which I think should be right, and I haven't enabled the cache yet, for remaining all nonvolatile memory allocated in section D1 (0x240000000).

Figure-1 updated STM32H743ZITx_FLASH.ld

0690X0000087ZcfQAE.png

Figure-2 Used SPI configuration in cubeMX:

0690X0000087ZckQAE.png

Figure-3: Used DMA configuration in cubeMX:

0690X0000087ZczQAE.png

In program Switching SPI mode in to Receive only master mode,

Initiating DMA process by calling function (see Figure-4)

Figure-4

0690X0000087Zd4QAE.png

Observed DMA generates interrupts two times, one when half of the buffer is received and another one when the second half is received (whole).

Expecting following function to be called (see Figure-5)

0690X0000087ZdEQAU.png

But always getting SPI_ERROR_OVR (see Figure-6)

Figure-6

0690X0000087ZdTQAU.png

This will eventually calls HAL_SPI_ErrorCallback(hspi) and return instead of HAL_SPI_RxCpltCallback(hspi)

Figure-7

0690X0000087ZdYQAU.png

Same experiment works well with STM32F7 but always getting OVER RUN Error in STM32H7.

Means Configuring SPI peripheral to SPI1, using DMA1 and reading data in normal mode, eventually generates the both HT & CT interrupts for DMA, but in CT it always generates the SPI OVER RUN error instead of calling

HAL_SPI_RxCpltCallback(hspi)

How to resolve this issue, Guys please help.

1 REPLY 1

Please don't ping me privately about posts on the forum.

I can't help you with CubeMX/HAL defects.

Make sure the buffer is in fact at the address ranges expected. Check what status/errors the DMA unit is reporting.

Check the lengths or transfer units are consistent.

If the DMA is placed in circular mode does it cause errors then? If not points to inconsistent size expectations in transfer.

Check appropriateness of FIFO settings.

Check for off-by-one issues of TX vs RX

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