Skip to main content
Visitor II
April 15, 2025
Solved

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

  • April 15, 2025
  • 1 reply
  • 480 views

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.

 

 

    This topic has been closed for replies.
    Best answer by Mike_ST

    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.

    1 reply

    Mike_STAnswer
    Technical Moderator
    April 15, 2025

    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.

    ST Employee
    April 16, 2025

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