Hi
Sorry if my question trouble you so much
I have an OLED connect with my WARP7 via mikrobus extension.
I'm using fbtft driver to drive oled.
After loading fbtft driver & play some code with framebufferm ,my OLED display still do not displaying anything.
Since I do not have any professional on embedded Linux then I can not verify my stuff totally right or not.
Based on outputs below, did I do something wrong ?
Here are some outputs
- loading fbtft driver (my device is "oledc")
imx7s-warp login: root
root@imx7s-warp:~# modprobe spidev
root@imx7s-warp:~# modprobe fbcon
root@imx7s-warp:~# modprobe fbtft
fbtft: module is from the staging directory, the quality is unknown, you have been warned.
root@imx7s-warp:~# modprobe fbtft_device name=oledc random: nonblocking pool is initialized
c
root@imx7s-warp:~# cd /sys/class/gpio/
root@imx7s-warp:/sys/class/gpio# echo 199 > export
root@imx7s-warp:/sys/class/gpio# echo 1 > gpio199/value
sh: write error: Operation not permitted
root@imx7s-warp:/sys/class/gpio# echo out > gpio199/direction
root@imx7s-warp:/sys/class/gpio# echo 1 > gpio199/value
root@imx7s-warp:/sys/class/gpio# modprobe fbtft_device name=oledc busnum=1 debug
=3
fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
fbtft_device: SPI devices registered:
fbtft_device: 'fb' Platform devices registered:
fbtft_device: GPIOS used by 'oledc':
fb_ssd1351: module is from the staging directory, the quality is unknown, you have been warned.
fbtft_device: 'reset' = GPIO198
fbtft_device: 'dc' = GPIO200
fbtft_device: SPI devices registered:
fbtft_device: fb_ssd1351 spi1.0 20000kHz 8 bits mode=0x00
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
root@imx7s-warp:/sys/class/gpio# fb_ssd1351 spi1.0: fbtft_request_gpios: 'reset' = GPIO198
fb_ssd1351 spi1.0: fbtft_request_gpios: 'dc' = GPIO200
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: 1065 kB/s (16.889 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
But it still do not display anything on screen.
I'd already use some command to play with framebuffer but result is no hope.
root@imx7s-warp:~# fbset -fb /dev/fb0
mode "96x96-0"
# D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
geometry 96 96 96 96 16
timings 0 0 0 0 0 0 0
accel false
rgba 5/11,6/5,5/0,0/0
endmoderoot@imx7s-warp:~# cp /dev/urandom /dev/fb0
cp: write error: No space left on device
root@imx7s-warp:~# fbset -fb /dev/fb0
fbset: FBIOGET_VSCREENINFO: Inappropriate ioctl for device
This is what I defined in fbtft_device.c
.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 },
{},
},
.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"
}
}
This is what I changed in imx7s-warp.dts file
&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__ECSPI2_MISO 0x14 /* MISO */
MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI 0x14 /* MOSI */
MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK 0x14 /* SCLK */
MX7D_PAD_ECSPI2_SS0__ECSPI2_SS0 0x14 /* CS1 */
>;
};
};
Thank you for your valuable time.
For sure it will work. But for now oled diode need more attention. The main oled definition have to be more understable couse now oled it's not efficient and it is lack of white colour.
Sorry :smileysad: I dont understand what are you saying......Since I'm very short of embedded knowledge.
Hi
general approach would be to debug it, attach oscilloscope and check signals,
printfs frame buffer pointers and check if framebuffer data are sent to lcd.
One can use AN4553 Using Open Source Debugging Tools for Linux on i.MX Processors
http://www.nxp.com/assets/documents/data/en/application-notes/AN4553.pdf
and linux documentation on
i.MX 6 / i.MX 7 Series Software and Development Tool|NXP
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor
Thank you. I will give it a shot