Feature #839

Integrate MHS-3.5inch RPi Display

Added by Hammel 17 days ago. Updated 5 days ago.

Status:In ProgressStart date:23 Apr 2021
Priority:ImmediateDue date:
Assignee:Hammel% Done:

20%

Category:Systems
Target version:2.0 - Harkonnen
Severity:01 - Critical

Description

This is for PiFile.
See

This display has only a 480x320 display area. I can scale icons to fit this but should expect that, because I'm not using EGL as a Cairo backend (yet) that things might be a little slow.

History

#1 Updated by Hammel 16 days ago

  • Severity changed from 02 - High to 01 - Critical

#2 Updated by Hammel 7 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

Looks like the model they sent me was actually an LCD-35, not an MHS-35.

Meta build created: lcdshow (not pushed yet).
Package available for testing.

#3 Updated by Hammel 7 days ago

  • Description updated (diff)

#4 Updated by Hammel 6 days ago

The build seems to work on the dev platform if I use the following command from a terminal window.

FRAMEBUFFER=/dev/fb1 startx

This is with the HDMI plugged in and acting as the default display. Touchscreen works but might be rotated incorrectly - the display is in landscape mode but touchscreen appears to be in portrait mode. I'll deal with the touchscreen later.

So now I need to see how I can force the TFT to be used at boot. I might need to use fbcon on the cmdline or con2fbmap 1 1. But mostly I just need to find out if there are one or two fb devices when HDMI is not plugged in, then set the X.org startup to use the correct device. This could be done, potentially, by using different xorg.conf files and specifying the TFT device conf like so.

Section "Device" 
        Identifier      "Allwinner A10/A13/A20 FBDEV" 
        Driver          "fbturbo" 
        Option          "fbdev" "/dev/fb1" 

        Option          "SwapbuffersWait" "true" 
EndSection

#5 Updated by Hammel 6 days ago

  • Description updated (diff)

#6 Updated by Hammel 5 days ago

Oh look - someone else is doing exactly what I'm doing. This could be really helpful.

#7 Updated by Hammel 5 days ago

I have scripts to switch from HDMI to TFT and back, but they're hacks that just rerun startx. Exiting the xterm that gets started from that drops me back to the last startx. So running pibox-tft puts me on the TFT and exiting that puts me back on the HDMI.

That's good enough for testing purposes to get the rest of the display working but not a production method of swapping. I need either fbcp or con2fbmap apparently.

The current problem is the display size. Setting the framebuffer wxh did squeeze the width but not the height.

I need to review the following links and gather information on how to complete this project:
  1. https://github.com/notro/fbtft/wiki
  2. https://learn.watterott.com/hats/rpi-display/fbtft-install/
  3. https://learn.watterott.com/hats/rpi-display/faq/
  4. http://www.willprice.dev/2017/09/16/adventures-with-tft-screens-for-raspberry-pi.html
  5. https://www.raspberrypi.org/forums/viewtopic.php?t=111817#p1041032
  6. https://philipp-weissmann.de/touch-display-auf-raspberry-pi-mit-arch-linux/ (German)
  7. https://forum.armbian.com/topic/13221-fbtft-with-device-tree-overlay-on-mainline/ (DTS info) #

Also available in: Atom PDF