cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Between two nucleo boards mcu

nesnes
Associate III

 

I am trying to establish communication between two Nucleo boards (STM32G431RB as master and Nucleo F446RE as slave). I used the example codes from the STM32 GitHub page (NUCLEO-G431RB/Examples/SPI/SPI_FullDuplex_ComPolling_Master and STM32F411RE-Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling). I made some changes to the slave code, including GPIO settings, but the communication still doesn't work. I chose NSS as [  hspi1.Init.NSS = SPI_NSS_SOFT; ]. The codes also include LED configurations as mentioned in the README files, which indicate an error based on the LED status.I know I have an error acording to led 2 but I don't know the problem. 

LED2 toggles slowly when there is a timeout or an error in transmission/reception process.

 

 

 
 
15 REPLIES 15
 

The code that I provided is for NUCLEO- G431RB as you mentioned on your first question and not for NUCLEO-G474RE.

 

You need to understand why you are getting a hardfault instead of changing from Full to half duplex. The code that I shared work fine.  

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

@Saket_Om  Yes I am using the NUCLEO- G431RB board not NUCLEO-G474RE ( realized  the wrong file name in error log when you mention it , I will retry it with the right file ). How can I found  why I’m getting a hardfoult error , do you have any suggestions for me look or any steps I should fallow to indicate the problem ? I’m new to stm32 boards and embedded systems. 

Hello @nesnes 

 

Any update concerning your issue. Is the code that I provided work finally? 

Are you still getting hardfault ?

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

@Saket_OmNo it did not work , I couldn't found the problem.

Hello @nesnes 

 

Could you please share your project so that I can reproduce the issue?

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar