2023-02-16 06:55 AM
I want to connect a 128x64 LCD to my STM32MP157D-DK1 board and implement a program on the A7 core Linux to display some parameters. What should I do? Thanks in advance.
2023-02-18 01:58 PM
In the past, I have successfully implemented an LCD display by defining the necessary GPIO pins in my Linux user space program. I used the link below as a guide to define the pins. Is this a proper way to implement it? If not what is a better way to do it? Thanks.
https://wiki.st.com/stm32mpu/wiki/How_to_control_a_GPIO_in_userspace
2023-02-21 05:28 AM
Hello @Ma.2 ,
Your LCD panel is considered as a part of the HW of the board.
And by chance, something in the Linux kernel is here to describe the HW, this is the device tree :) .
Let me show you the example taken from stm32mp157c-dk2:
&dsi {
status = "okay";
ports {
port@0 {
reg = <0>;
dsi_in: endpoint {
remote-endpoint = <<dc_ep1_out>;
};
};
port@1 {
reg = <1>;
dsi_out: endpoint {
remote-endpoint = <&panel_in>;
};
};
};
panel_otm8009a: panel-otm8009a@0 {
compatible = "orisetech,otm8009a";
reg = <0>;
reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
power-supply = <&v3v3>;
status = "okay";
port {
panel_in: endpoint {
remote-endpoint = <&dsi_out>;
};
};
};
};
Do you see ? Here we tell that the Display Serial Interface node (DSI) is linked to the LTDC (LCD-TFT Display Controler) but also to the panel !
Here the panel has its own driver in the kernel (panel-orisetech-otm8009a.c) but this is not the case for all the panel, and maybe not yours.
In this case you can use the panel-simple.c driver and you will have different property to give in the device tree, such as the famous panel-timings (the documentation of your panel will be mandatory here)! The documentation concerning the property to give for a panel-simple case is given in the kernel here: <kernel_folder>/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
It makes a lot of information to get, but following the wiki will help you a lot. Moreover, I advice you to read the very well done presentation of graphics in Linux made by Bootlin: Understanding the Linux Graphics Stack training.
I hope that it will help you to go forward !
Kind regards,
Erwan.