cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 : SPI using DMA and Polling Mode missing/skipping data

Posted on February 11, 2018 at 03:38

Hi,

I'm trying a simple SPI communication link between RPi3 and STM32F7 (STM32F722ZE Nucleo Board).

The code is very simple, RPi3 code just transfers 40 bytes data and expects to see 0-39 as byte values in return after the transfer.

The code in STM32 is basically to setup SPI DMA transfers of 40 bytes with a preset tx buffer containing 0-39 as byte values.

I see that the code runs for a while (some times upto 5 seconds), and later my RPi3 program detects a missing sequence.

Instead of seeing [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]

I see [36, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38]

I also checked on an oscilloscope and verified that STM32 was infact sending wrong byte sequence.

I'm running SPI at 1MHz (but I see it go wrong at 100KHz also), and in between transfers I keep a 1ms delay.

Please let me know what could be wrong ?

Thanks,

Sharankumar

#missing-byte #stm32f7-dma #stm32f7-spi
1 REPLY 1
andre239955_st
Associate II
Posted on March 28, 2018 at 16:06

Hi Sharankumar,

I am working with SPI on a Nucleo F746 board. Can you please post your init code and loop? Without it it is hard to give some help.

Thanks,

Andre