cancel
Showing results for 
Search instead for 
Did you mean: 

Enable SPI5 on STM32MP157C-DK2 board

LewisN
Associate

Hi everyone,

I want to make a LoRa gateway using the STM32MP157C-DK2 and ICC880A-SPI boards. For that, I have to implement SPI communication between the two boards. I already did the hardware connections, but I am not able to enable SPI on the STM32MP157C-DK2.

I want to set up SPI5 on the STM32 board (M4 context) and I use CubeMX to get the device tree (DT) files that I need. Then I modify the stm32mp157c-dk2.dts file that is already present in the Distribution package with the files given by CubeMX, before cross-compiling the Linux kernel and updating the kernel image on the board.

I have attached the stm32mp157c-dk2.dts file to this post, with all the modifications I made.

I also added the line DECPROT(STM32MP1_ETZPC_SPI5_ID, DECPROT_NS_RW, DECPROT_UNLOCK) in &etzpc section within TFA.

When I reboot the STM32MP157C-DK2 board, I cannot see anything showing that SPI was correctly implemented (I2C is working and the red LED is on, so the DT is well updated). More, the folder /sys/class/spidev is empty, no device is present.

My guess is that I am doing something wrong (it is my first time working on a device tree), but I cannot figure out what the problem is. If you have any hints or ideas that could help me, they will be very appreciated.

Have a nice day!

1 REPLY 1
Christophe Guibout
ST Employee

Hi @LewisN​ ,

I'am not sure to understand if you want to use SPI5 from M4 firmware, or from Linux running on A7 ?

Your DT looks good if you want that the M4 controls SPI5 :

  • SPI5 is declared to be useable in M4 context, so it's normal that you can't see it anymore from linux side.
  • red led and I²C are declared to be used by A7, so you can see them on linux.

BR,

Christophe

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.