Hi Toradex-Team,
We want to use a SPI TFT display with either a ST7789V2 or a ILI9341 controller together with Torizon core on a colibri-imx6ull-emmc
.
We found the “fbtft” kernel driver module (staging) and hoped it would do the job without re-building the kernel.
Bringing the kernel module into Torizon core 5.7.0 seemed to work out well. But we have trouble with the corresponding device tree overlay (find our attempt for ILI9341 below).
Torizon core builder prints this:
=> Handling device-tree subsection
=> Selecting custom device-tree 'device-trees/dts-arm32/imx6ull-colibri-emmc-eval-v3.dts'
'imx6ull-colibri-emmc-eval-v3.dts' compiles successfully.
warning: removing currently applied device tree overlays
Device tree imx6ull-colibri-emmc-eval-v3.dtb successfully applied.
=> Adding device-tree overlay 'dt-overlays/display-ili9341_overlay.dts'
'display-ili9341_overlay.dts' compiles successfully.
Failed to apply '/tmp/tmph0qqrrcl': FDT_ERR_NOTFOUND
error: cannot apply device tree overlays ['/tmp/tmph0qqrrcl'] against device tree /storage/dt/usr/lib/modules/5.4.193-5.7.0+git.f5d73fd6e9f8/dtb/imx6ull-colibri-emmc-eval-v3.dtb.
error: overlay 'dt-overlays/display-ili9341_overlay.dts' is not applicable.
Could you please help with that?
Thank you,
Christian
DT overlay file:
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,colibri-imx6ull-emmc";
// Enable the SPI controller
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
};
};
// Enabling the SPI controller also enables spidev on cs0, so we have disable it
fragment@1 {
target = <&spidev0>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
display: display@0{
// MIPI DBI compatible driver
// This driver is used because it can ignore an illegal rotate value
// and doesn't have a set_gamma() function.
compatible = "samsung,s6d02a1";
reg = <0>; // Chip Select 0
spi-max-frequency = <32000000>; // 32MHz
reset-gpios = <&gpio 23 1>; // reset is active low hence the 1
dc-gpios = <&gpio 24 0>;
led-gpios = <&gpio 18 0>;
width = <320>;
height = <240>;
buswidth = <8>; // Most controllers use this value
// This is a hack to prevent fb_s6d02a1.c:set_var() from issuing
// command 0x36 after the init sequence has been applied and thus
// changing the config.
rotate = <1>;
// see drivers/staging/fbtft/fb_ili9341.c:init_display() for how this looks in the driver
// Command 0x36 is taken from the fb_ili9341.c:set_var() function.
init = <0x1000001
0x2000005
0x1000028
0x10000cf 0x00 0x83 0x30
0x10000ed 0x64 0x03 0x12 0x81
0x10000e8 0x85 0x01 0x79
0x10000cb 0x39 0x2c 0x00 0x34 0x02
0x10000f7 0x20
0x10000ea 0x00 0x00
0x10000c0 0x26
0x10000c1 0x11
0x10000c5 0x35 0x3e
0x10000c7 0xbe
0x100003a 0x55
0x1000036 0x28
0x10000b1 0x00 0x1b
0x1000026 0x01
0x10000f2 0x08
0x1000026 0x01
0x10000e0 0x1f 0x1a 0x18 0x0a 0x0f 0x06 0x45 0x87 0x32 0x0a 0x07 0x02 0x07 0x05 0x00
0x10000e1 0x00 0x25 0x27 0x05 0x10 0x09 0x3a 0x78 0x4d 0x05 0x18 0x0d 0x38 0x3a 0x1f
0x10000b7 0x07
0x10000b6 0x0a 0x82 0x27 0x00
0x1000011
0x2000064
0x1000029
0x2000064>;
debug = <0x4000000>; // print init commands to the kernel log
};
};
};
};