cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32 SPI Slave Incorrect Data Receive or SPI going out of Sync from Master

AGond.2
Associate III

Hello Community,

I have Several Query Related to STM32F439 Microcontroller SPI 6 Slave DMA Mode,

Let me Explain the Scenario , we have Custom Board Build Around STm32F439 micro-Controller and using HAL Stm32V27 Library Version.

so we are Communicating with Different Module Via SPI6 Slave Mode using DMA, So as Power on we are Sending Around 9000 bytes of Data from Master to SPI6 Slave  Micro Controller in 6 bytes of Frame, so we Observed that whenever MISO line is Coming in Between or Going in Between our Receive Data Lost and SPI went out of Sync as we are using SPI Transmit Receive DMA API for our Communication, Referencing of this Statement i have Attached my Observation and Saelee Logic Analyzer, Capture 1 Fully Working Condition , as you can see Capture 1 Grey Clock , Below one Chip Select, Pink one MOSI Data and Below there is no Moment of MISO Signal and It's working fine but sometime am Getting Capture like this in Capture 2,  Grey Clock, Below one Chip Select, Pink one MOSI and Yellow one is MISO and in this type of Micro Controller Behavior we are getting data Lost after change in state of MISO  Signal and Facing out of Sync Problem, i have Attached Capture 3 Similar to Capture 2. so Whenever This Scenario is Happening am Getting Garbage Data and Facing out of Sync issue, and Whenever am Seeing Capture 1 and One more Scenario like MISO Always there as long as long MOSI is Present that time am not Seeing any Data and Sync issue.

So Overcome this Problem i Change API From Transmit Receive DMA API  to Receive DMA API only as Power on we Don't need to Transmit Back anything to Master From Slave but whenever Master Initiate Read Command am Calling Transmit Receive DMA API , so with this Approach Problem Reduced  by 90% but still we are facing Data lost and  Out of Sync Issue, because of this Master not able to Read Back Acknowledgement Register from Slave Module.

So can Anybody tell why this Happening? 

what Approach and Methodology we can use to Over Come this Problem?

Why this Happening Once in While or 1 out of 20-30 times Power on Condition ?

is this Software Problem or Issue we Micro Controller ?? 

Capture 1.jpeg

Capture 1

Capture 2.jpeg

Capture 2

 

Capture 3.jpeg

 Capture 3

0 REPLIES 0