I have a i.MX7S board (WARP7) which has extension (Mikrobus standard) and an OLED C Click display (Mikrobus standard). I try many ways but still failed to enable & display something on OLED screen. Here are steps that I did:
Modify fbtft_device.c to add definition for my device
.name = "oledc",
.spi = &(struct spi_board_info) {
.modalias = "fb_ssd1351",
.max_speed_hz = 20000000,
.mode = SPI_MODE_0,
.platform_data = &(struct fbtft_platform_data) {
.display = {
.buswidth = 8,
.width = 96,
.height = 96,
},
.bgr = true,
.gpios = (const struct fbtft_gpio []) {
{ "reset", 198 },
{ "dc", 200 },
{ "led", 199 },
},
.gamma = "0 2 2 2 2 2 2 2 " \
"2 2 2 2 2 2 2 2 " \
"2 2 2 2 2 2 2 2 " \
"2 2 2 2 2 2 2 3 " \
"3 3 3 3 3 3 3 3 " \
"3 3 3 3 3 3 3 3 " \
"3 3 3 4 4 4 4 4 " \
"4 4 4 4 4 4 4"
}
}
}
Update Device Tree (imx7s-warp.dts) to add SPI support
&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
spidev@0 {
compatible = "spidev";
reg = <0>;
spi-max-frequency = <20000000>;
spi-cs-high;
};
};
&iomuxc {
pinctrl-names = "default";
imx7s-warp {
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX7D_PAD_ECSPI2_MISO__GPIO4_IO22 0x00000014 /* MISO */
MX7D_PAD_ECSPI2_MOSI__GPIO4_IO21 0x00000014 /* MOSI */
MX7D_PAD_ECSPI2_SCLK__GPIO4_IO20 0x00000014 /* SCLK */
MX7D_PAD_ECSPI2_SS0__GPIO4_IO23 0x00000014 /* CS1 */
>;
};
};
imx7d-sdb {
pinctrl_brcm_reg: brcmgrp {
fsl,pins = <
MX7D_PAD_SD2_WP__GPIO5_IO10 0x14 /* WL_REG_ON */
>;
};
pinctrl_gpio: gpiogrp {
fsl,pins = <
/*MX7D_PAD_ENET1_RGMII_RD1__GPIO7_IO1 0x14*/
MX7D_PAD_ENET1_RGMII_RD0__GPIO7_IO0 0x00000005 /* RST */
MX7D_PAD_ENET1_RGMII_RD1__GPIO7_IO1 0x00000005 /* INT */
MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2 0x00000005 /* PWM2 */
>;
};
Rebuild zImage, imx7s-warp.dtb, imx7s-warp.dts & copy to Boot partition (ums 0 mmc 0 mode)
login and run command
modprobe fbtft
modprobe fb_ssd1351
modprobe fbtft_device name=oledc debug=3 busnum=1
modprobe dmesg -c
cp /dev/urandom > /dev/fb0
===> In result: my display still black :( but only power led of display is ON Output of command
root@imx7s-warp:~# modprobe fbtft_device name=oledc debug=3 busnum=1
fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
fbtft_device: SPI devices registered:
fbtft_device: spidev spi1.0 20000kHz 8 bits mode=0x04
fbtft_device: 'fb' Platform devices registered:
fbtft_device: Deleting spi1.0
fb_ssd1351 spi1.0: fbtft_gamma_parse_str() str=
fb_ssd1351 spi1.0: 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4
fb_ssd1351 spi1.0: fbtft_request_gpios: 'reset' = GPIO198
fb_ssd1351 spi1.0: fbtft_request_gpios: 'dc' = GPIO200
fb_ssd1351 spi1.0: fbtft_request_gpios: 'led' = GPIO199
fb_ssd1351 spi1.0: fbtft_verify_gpios()
fb_ssd1351 spi1.0: init_display()
fb_ssd1351 spi1.0: fbtft_reset()
fb_ssd1351 spi1.0: set_var()
fb_ssd1351 spi1.0: Display update: 978 kB/s (18.394 ms), fps=0 (0.000 ms)
fb_ssd1351 spi1.0: set_gamma()
Console: switching to colour frame buffer device 12x12
graphics fb0: fb_ssd1351 frame buffer, 96x96, 18 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi1.0 at 20 MHz
fbtft_device: GPIOS used by 'oledc':
fbtft_device: 'reset' = GPIO198
fbtft_device: 'dc' = GPIO200
fbtft_device: 'led' = GPIO199
fbtft_device: SPI devices registered:
fbtft_device: fb_ssd1351 spi1.0 20000kHz 8 bits mode=0x00
I suppose my display will enable and display something after these step, but it do not.
Did I make something wrong ? Since I've never worked on embedded & Linux before, then i'm losing my way here. It will be thankful very much with any help or direction
Thank you a lot.
User contributions licensed under CC BY-SA 3.0