zlemonpie
Posts: 35
Joined: Tue Dec 08, 2020 3:05 am

How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 3:56 am

Hi all,
I'm just pondering how does the official RPi 7" touchscreen display work and have some general questions..

1. Looking at the module, there's an adapter board. Connected to this adapter board are two FPC jumper cables.. one is 50 pin and one is 5 pins.
Is it correct in saying that the 50 pin cable is for the display while the 5 pin one is for the touch driver communicating over I2C?

2. The adapter board communicates to the RPi using the 15pin cable. From the RPi schematics, the connector for this cable has signals for DSI and I2C. Is it correct to say that on the adapter board has a controller that accepts MIPI-DSI data from the RPi and translates that data to drive the LCD over the 50 pin cable? Is the controller also responsible for sending touch data from the screen to the RPi over I2C as well?

3. Where can i find the driver code on the Raspberry Pi side that drives the display?

W. H. Heydt
Posts: 15400
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 4:49 pm

zlemonpie wrote:
Tue Dec 08, 2020 3:56 am
3. Where can i find the driver code on the Raspberry Pi side that drives the display?
To the best of my knowledge, that is embedded in the "binary blob" and runs on the VC4/VC6. I believe the rest of your analysis is correct about how the RPF 7" display works.

As a point of curiosity, why does all of this matter?

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 4:57 pm

zlemonpie wrote:
Tue Dec 08, 2020 3:56 am
Hi all,
I'm just pondering how does the official RPi 7" touchscreen display work and have some general questions..

1. Looking at the module, there's an adapter board. Connected to this adapter board are two FPC jumper cables.. one is 50 pin and one is 5 pins.
Is it correct in saying that the 50 pin cable is for the display while the 5 pin one is for the touch driver communicating over I2C?

2. The adapter board communicates to the RPi using the 15pin cable. From the RPi schematics, the connector for this cable has signals for DSI and I2C. Is it correct to say that on the adapter board has a controller that accepts MIPI-DSI data from the RPi and translates that data to drive the LCD over the 50 pin cable? Is the controller also responsible for sending touch data from the screen to the RPi over I2C as well?

3. Where can i find the driver code on the Raspberry Pi side that drives the display?

https://www.raspberrypi.org/blog/the-ea ... i-display/
Take what I advise as advice not the utopian holy grail, and it is gratis !!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 12104
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 5:16 pm

The DSI display is now functional under the full KMS kernel driver (the one where the ARM does everything).

It currently uses the panel-raspberrypi-touchscreen driver to control the backlight and power (over I2C) and configure the TC358762 DSI to DPI bridge chip (via DSI commands).
The touchscreen uses the EDT FT5406 driver.

The pair don't play perfectly though as the TC358762 driver goes and turns the power off on the touchscreen driver. Mainline Linux developers have just reworked things to have separate TC358762, and regulator/backlight driver. The touchscreen driver should then be able to hook into the regulator and keep the power on, but it's not quite working at the moment.

If you update to the 5.10 kernel branch (now in BRANCH=next rpi-update) you can load it using

Code: Select all

ignore_lcd=1
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-7inch
in config.txt. (Not recommended on a Pi1 or other low memory devices).
Once loaded, run "sudo dtoverlay edt-ft5406" to load the touchscreen driver.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

zlemonpie
Posts: 35
Joined: Tue Dec 08, 2020 3:05 am

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 7:27 pm

W. H. Heydt wrote:
Tue Dec 08, 2020 4:49 pm
zlemonpie wrote:
Tue Dec 08, 2020 3:56 am
3. Where can i find the driver code on the Raspberry Pi side that drives the display?
To the best of my knowledge, that is embedded in the "binary blob" and runs on the VC4/VC6. I believe the rest of your analysis is correct about how the RPF 7" display works.

As a point of curiosity, why does all of this matter?
I am trying to integrate a different LCD screen with a Raspberry Pi

zlemonpie
Posts: 35
Joined: Tue Dec 08, 2020 3:05 am

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 7:39 pm

6by9 wrote:
Tue Dec 08, 2020 5:16 pm
The DSI display is now functional under the full KMS kernel driver (the one where the ARM does everything).

It currently uses the panel-raspberrypi-touchscreen driver to control the backlight and power (over I2C) and configure the TC358762 DSI to DPI bridge chip (via DSI commands).
The touchscreen uses the EDT FT5406 driver.

The pair don't play perfectly though as the TC358762 driver goes and turns the power off on the touchscreen driver. Mainline Linux developers have just reworked things to have separate TC358762, and regulator/backlight driver. The touchscreen driver should then be able to hook into the regulator and keep the power on, but it's not quite working at the moment.

If you update to the 5.10 kernel branch (now in BRANCH=next rpi-update) you can load it using

Code: Select all

ignore_lcd=1
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-7inch
in config.txt. (Not recommended on a Pi1 or other low memory devices).
Once loaded, run "sudo dtoverlay edt-ft5406" to load the touchscreen driver.
So the I2C is not for touch control? But is integrated into the LCD and that data is communicated over the DSI channels?

Edit: Nvm, looking at the controller datasheet, it has an I2C interface.

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 8:18 pm

zlemonpie wrote:
Tue Dec 08, 2020 7:27 pm
W. H. Heydt wrote:
Tue Dec 08, 2020 4:49 pm
zlemonpie wrote:
Tue Dec 08, 2020 3:56 am
3. Where can i find the driver code on the Raspberry Pi side that drives the display?
To the best of my knowledge, that is embedded in the "binary blob" and runs on the VC4/VC6. I believe the rest of your analysis is correct about how the RPF 7" display works.

As a point of curiosity, why does all of this matter?
I am trying to integrate a different LCD screen with a Raspberry Pi

As you are using some unknown Panel, see:

viewtopic.php?t=259077#p1579304

You will find similar post with a bit of searching..
Take what I advise as advice not the utopian holy grail, and it is gratis !!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 12104
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How does the official Raspberry Pi 7" Touch Screen work?

Tue Dec 08, 2020 9:21 pm

Any other panel has to use the vc4-kms-v3d driver where all graphics control is done by the Linux kernel.

There are several threads on here about getting other panels up and running with cm4. Ili9881, st7701, and a couple of other devices are being discussed. Personally I've had the tc358762 of the original pi panel and an Ili9881 panel working, and I'm working on others.

https://github.com/raspberrypi/linux/tr ... /drm/panel for panel drivers.
https://github.com/raspberrypi/linux/tr ... pu/drm/vc4 for vc4 (Pi) specific host hardware
https://github.com/raspberrypi/linux/tr ... drm/bridge for bridge chips (eg DSI to DPI)
https://github.com/raspberrypi/linux/pull/3985 for an example overlay using the ILI9881. The Pi panel overlay is merged as arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Maru
Posts: 2
Joined: Mon Dec 21, 2020 8:29 am

Re: How does the official Raspberry Pi 7" Touch Screen work?

Mon Dec 21, 2020 8:35 am

6by9 wrote:
Tue Dec 08, 2020 5:16 pm
The DSI display is now functional under the full KMS kernel driver (the one where the ARM does everything).

It currently uses the panel-raspberrypi-touchscreen driver to control the backlight and power (over I2C) and configure the TC358762 DSI to DPI bridge chip (via DSI commands).
The touchscreen uses the EDT FT5406 driver.

The pair don't play perfectly though as the TC358762 driver goes and turns the power off on the touchscreen driver. Mainline Linux developers have just reworked things to have separate TC358762, and regulator/backlight driver. The touchscreen driver should then be able to hook into the regulator and keep the power on, but it's not quite working at the moment.

If you update to the 5.10 kernel branch (now in BRANCH=next rpi-update) you can load it using

Code: Select all

ignore_lcd=1
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-7inch
in config.txt. (Not recommended on a Pi1 or other low memory devices).
Once loaded, run "sudo dtoverlay edt-ft5406" to load the touchscreen driver.
Good Morning,

Should this also work for the console or is this X11 only for now?
I recently upgraded an old pi2 to a pi4 and noticed that I had to use kms now for the console (kivy application with the 7inch touchscreen). I got it running with fkms without any issues but wanted to try "real" kms as well.
When add

Code: Select all

ignore_lcd=1
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-7inch
in the config, the system boots up but then the display turns white and fades out and no longer displays anything. It does not make a difference if I then load the touchscreen driver.
I am using the latest 5.10 kernel via rpi-update.

Maru
Posts: 2
Joined: Mon Dec 21, 2020 8:29 am

Re: How does the official Raspberry Pi 7" Touch Screen work?

Mon Dec 21, 2020 3:15 pm

Hi,

I had a look at the dmesg output and can see the following entries.

[ 7.433705] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[ 7.433723] vc4_dsi fe700000.dsi: instat: 0x00000000
[ 7.433820] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[ 8.473696] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[ 8.473713] vc4_dsi fe700000.dsi: instat: 0x00000000
[ 8.473798] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[ 9.513694] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[ 9.513710] vc4_dsi fe700000.dsi: instat: 0x00000000
[ 9.513792] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110

Nothing shows during boot up, not even the rainbow screen.

zlemonpie
Posts: 35
Joined: Tue Dec 08, 2020 3:05 am

Re: How does the official Raspberry Pi 7" Touch Screen work?

Thu Apr 01, 2021 5:24 pm

Hi,
I'm also getting an issue with enabling KMS with the official touchscreen on the Pi 4. Could someone check if my config.txt is correct:

Code: Select all

[Pi4]
ignore_lcd=1
dtoverlay=vc4-kms-v3d-pi4
dtoverlay=vc4-kms-dsi-7inch
max_framebuffers=2

[all]
kernel is 5.10.17-v7l+

Return to “Official Display”