cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect a 128x64 LCD to STM32MP157D-DK1 and access it from the A7 core?

Ma.2
Associate II

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.

2 REPLIES 2
Ma.2
Associate II

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

Erwan SZYMANSKI
ST Employee

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 = <&ltdc_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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.