AnsweredAssumed Answered

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

Question asked by Sharankumar Narayan Huggi on Feb 11, 2018
Latest reply on Mar 28, 2018 by ramakers.andre

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

Outcomes