Cannot get SPI LCD working with STM32MP157D-DK1 (Yocto)
I have attached an Adafruit LCD (https://www.adafruit.com/product/1770) to my STM32MP157D-DK1 on SPI5 (on the RPi header). I am working with Yocto and the STM32MP1 BSP (but not OpenSTLinux). I am attempting to modify core-image-minimal to enable the SPI5 port and display a console (e.g. framebuffer) to the LCD. Thus far, I have been unsuccessful in getting anything to show up on the LCD (and the SPI lines remain silent when probed with a logic analyzer).
I added the following node to the device tree source (.dts):
&spi5 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi1_pins_a>;
pinctrl-1 = <&spi1_sleep_pins_a>;
cs-gpios = <&gpiof 6 GPIO_ACTIVE_HIGH>;
status = "okay";
display@0{
compatible = "adafruit,yx240qv29", "ilitek,ili9341";
reg = <0>;
spi-max-frequency = <32000000>;
dc-gpios = <&gpiof 4 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpiof 0 GPIO_ACTIVE_HIGH>;
rotation = <270>;
/* backlight = <&backlight>; */
};
};I enabled the following modules (`bitbake -c menuconfig virtual/kernel`). I am using the TinyDRM driver, as the fbtft driver seems to be outdated. The backlight driver does not seem to be needed, as the Adafruit board has the backlight tied to maximum brightness by default.
- Device drivers > Graphics support
- <M> DRM support for ILI9341 display panels
- Backlight & LCD device support --->
- {*} Lowlevel Backlight controls
- <*> Generic GPIO based Backlight Driver
- {*} Lowlevel Backlight controls
- Console display driver support --->
- [*] Framebuffer Console support
I made the following Yocto variable changes:
# Add kernel module for LCD driver
IMAGE_INSTALL += "kernel-module-ili9341"
# Autoload ILI9341 SPI driver on boot
KERNEL_MODULE_AUTOLOAD += "ili9341"When I boot my image, I notice that the module does not autoload (first problem). I can remedy that with `modprobe` (I have the rtl8188eu driver also enabled):
root@stm32mp1:~# modprobe ili9341
root@stm32mp1:~# lsmod
Tainted: G
ili9341 16384 0 - Live 0xbf0f5000
drm_mipi_dbi 20480 1 ili9341, Live 0xbf0eb000
r8188eu 331776 0 - Live 0xbf099000 (C)
cfg80211 602112 1 r8188eu, Live 0xbf005000
lib80211 16384 1 r8188eu, Live 0xbf000000There seems to be a "display@0" device attached to the SPI5 port (at least in the filesystem):
root@stm32mp1:~# ls /proc/device-tree/soc/spi@44009000/display@0/
compatible name reset-gpios spi-max-frequency
dc-gpios reg rotationHowever, I do not have a /dev/fb0 device that should let me write data to (second problem):
root@stm32mp1:~# ls /dev/fb*
ls: /dev/fb*: No such file or directoryI'm not sure where to go from here to get a console out (or anything displayed) on the SPI LCD. Any help would be appreciated!
