SPI DMA SLAVE (M0 Based Micro Controller) DATA SHIFT Problem
Hello to all,
am trying trying to interface micocontroller using SPI Protocal.
here , am having 4 slaves and a Master, SLAVES are M0 based Micro controllers where as Master is M3 based micro controller.
am sending and receving from slaves using DMA .
Both side Master and Slave side am using DMA for transmit and receive.
sending 133 bytes to every slaves interval of 3 milliseconds.
MASTER Clock tested at 1.875mhz and 3.75mhz.
Problem :
problem is in 4th SLAVE it receive shifted data
suppose i sended :
tx from MASTER: 133 bytes
aa cc 80 5d 5e 5f 60
61 62 63 64 65 66 67 68 69 6a
6b 6c 6d 6e 6f 70 71 72 73 74
75 76 77 78 79 7a 7b 7c 7d 7e
7f 84 85 86 87 88 89 8a 8b 8c
8d 8e 8f 90 91 92 93 94 95 96
97 98 99 9a 9b 9c 9d 9e 9f a0
a1 a2 a3 a4 a5 a6 a7 a8 a9 aa
ab ac ad ae af b0 b1 b2 b3 b4
b5 b6 b7 b8 b9 ba bb bc bd be
bf c0 c1 c2 c3 c4 c5 c6 c7 c8
c9 ca cb cc cd ce cf d0 d1 d2
d3 d4 d5 d6 d7 d8 d9 da db dc
dd de db dc a0 9d
RX SLAVE side
db dc a0 9d aa cc 80 5d 5e 5f 60
61 62 63 64 65 66 67 68 69 6a
6b 6c 6d 6e 6f 70 71 72 73 74
75 76 77 78 79 7a 7b 7c 7d 7e
7f 84 85 86 87 88 89 8a 8b 8c
8d 8e 8f 90 91 92 93 94 95 96
97 98 99 9a 9b 9c 9d 9e 9f a0
a1 a2 a3 a4 a5 a6 a7 a8 a9 aa
ab ac ad ae af b0 b1 b2 b3 b4
b5 b6 b7 b8 b9 ba bb bc bd be
bf c0 c1 c2 c3 c4 c5 c6 c7 c8
c9 ca cb cc cd ce cf d0 d1 d2
d3 d4 d5 d6 d7 d8 d9 da db dc
dd de
so as you seen how last 4 bytes came in front
am using 4 chip select lines for 4 salves
*** when i test with 3 slaves it work perfect ***
after adding 4 th slave this problem starts
Initially all slaves work correctly bt after some lakhs of tx and rx it SLAVE 4th get errors
so how to correct it.
in RIGHT LAST CORNER is SLAVE 4

M0 SLAVE SPI AND DMA CONFIG




**** MASTER SIDE SPI AND DMA CONFIG ****
below:
(Cortex M3) MASTER stm32F20x




Thanks in advance.