Error activating SPI5 using Buildroot external configuration
I'm using the STM32MP157F-DK2-ND evaluation board and getting an error when I try to enable SPI5.
I have researched previous posts with this error
https://community.st.com/s/question/0D53W00000GZlRVSA1/enabling-devspidevxx-on-openstlinux
https://community.st.com/s/question/0D53W00000RS3ynSAD/how-can-i-enable-spi5-on-stm32mp157dk1
And reviewed relevant documentation
https://wiki.st.com/stm32mpu/wiki/How_to_use_SPI_from_Linux_userland_with_spidev
https://wiki.st.com/stm32mpu/wiki/SPI_overview
https://wiki.st.com/stm32mpu/wiki/SPI_device_tree_configuration
I've also ensured these options are checked in make linux-menuconfig
https://wiki.st.com/stm32mpu/wiki/SPI_overview#Kernel_configuration
Still, I cannot figure out why the clock isn't running.
[ 1.533147] spi_stm32 44009000.spi: clk rate = 0
[ 1.536942] spi_stm32: probe of 44009000.spi failed with error -22
I 'm using the buildroot config: st_stm32mp157f_dk2_demo_defconfig provided by github buildroot-external-st repository (new member so can't add link)
After generating from CubeMX I added the following user code in my linux-dts and uboot-dts files:
&spi5{
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi5_pins_mx>;
pinctrl-1 = <&spi5_sleep_pins_mx>;
cs-gpios= <&gpiof 6 0>;
status = "okay";
/* USER CODE BEGIN spi5 */
spidev@0{
compatible = "linux,spidev";
reg = <0>;
spi-max-frequency = <4000000>;
};
/* USER CODE END spi5 */
};
I also ensured:
CLK_SPI2S23_PLL3Q
CLK_SPI45_PCLK2
are set in my tfa-dts file
I ensured these settings are getting built correctly by downloading the output from:
output/build/linux-custom/
I would appreciate help to troubleshoot this and any debug tools I can use to figure out this issue. Thanks!
