cancel
Showing results for 
Search instead for 
Did you mean: 

2 problems of Nucleo-G031K8 using SPI to communicate between Master and Slave

JFung.1
Associate III

Background:

- Using SPI to communicate between 2 MCU (Master and Slave)

- Connection:

      G031K8 (Master) <=> G031K8 (Slave)

               MOSI <=>MISO

               MISO <=> MOSI

               SCK<=> SCK

               NSS <=>NSS

Problem 1: Slave MCU could not receive the data

Master:

- output the Data array by SPI in DMA mode

- output data are correct and checked by Logic analyser

JFung1_0-1744723480703.png

 

Slave:

- No matter how the SPI setting is, received data are always 0xFF

- SPI DMA have fired event but the data are always 0xFF

- Tried to set both side have CRC, the slave side have CRC error occur but the DMA content are 0xFF

- Tried to use polling method, but same result.

 

 

Could anyone advise me what should I check on next step?

 

Problem 2 – MOSI/MISO pin voltage cut half when using slave side using “Full-Duplex Slave”

- When Slave MCU selected the “Full-Duplex Slave”, The MOSI pin voltage cut half.

- When Slave MCU selected the “Receive Only Slave”, The MOSI pin voltage became normal

(but still have problem of received data by DMA at problem 1)

 

(Yellow is MOSI/MISO, Blue is NSS)

Full-Duplex Slave:JFung1_2-1744723480809.png

Receive Only Slave:JFung1_1-1744723480761.png

 

Why the Voltage become cut half?

I have tried the GPIO setting but nothing change.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mike_ST
ST Employee

Hello,

>> - Connection:

>> G031K8 (Master) <=> G031K8 (Slave)

>> MOSI <=>MISO

>> MISO <=> MOSI

You have to connect MOSI of the master to the MOSI of the slave, and  MISO of the master to the MISO of the slave.

View solution in original post

3 REPLIES 3
Mike_ST
ST Employee

Hello,

>> - Connection:

>> G031K8 (Master) <=> G031K8 (Slave)

>> MOSI <=>MISO

>> MISO <=> MOSI

You have to connect MOSI of the master to the MOSI of the slave, and  MISO of the master to the MISO of the slave.

connection issue, it's different with the UART communication.

Thank you very much.

It is working now.