Forums › Devices › OSD32MP15x › SPI interface using STM32CubeMX
hello Neeraj,
I am trying to define SPI1 and SPI2.
When I define both on A7NS (Linux), it does not allow to define them as SPI slaves, only masters.
And as masters, I am unable to define the SPI1_NSS and SPI2_NSS pins in the Pinout tab. “Hardware NSS Signal – Disable” is grayed out.
The SPI_NSS functionality does not appear in the proper port pins, PA4 and PB12 in my case (although these ports do support that).
Only, when moving the SPI functionality to the Cortex-M4, I get full control on the interface (spi slave, NSS definition, etc.).
Is A7 limited in handling the SPI interfaces? When I define the SPI as master, SPI_NSS is not there, slave interface is not there (under A7). Why?
How do I define a SPI interface on the A7 without the SPI_NSS signal?
thanks
Gil
Gil,
CubeMX probably does not have that feature available. Please see https://wiki.st.com/stm32mpu/wiki/SPI_device_tree_configuration for example configuration of the SPI interface with a chip select pin. You can use any GPIO as a chip select.
Best,
Neeraj
hello Neeraj,
Can a SPI interface be used with the A7 also as a Slave?
You wrote “You can use any GPIO as a chip select”: Do you mean not only those that are designated to be SPI1_NSS (PA4, PA15, PZ3)?
I can configure any GPIO as SPI1_NSS? How do I do that?
Thanks
Gil
Gil,
While the kernel now supports operating SPI interfaces as slave ports, this does not seem to be implemented in the spi driver: https://github.com/STMicroelectronics/linux/blob/v5.15-stm32mp/drivers/spi/spi-stm32.c. You can assign the SPI to the M4 core and use the slave configuration.
Yes, any GPIO can be used for chip select if you are running Linux. Please see section 3.3 of https://wiki.st.com/stm32mpu/wiki/SPI_device_tree_configuration for a specific example.
Best,
Neeraj
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields