Hyperpixel 4.0" Portrait, Raspbian Stretch Lite


Attempting to use a Hyperpixel 4.0" on Raspbian Stretch Lite in a portrait configuration but touch is always orthogonal to the display. Normal instructions here https://github.com/pimoroni/hyperpixel4 work just fine for the base install. Using the normal dtbo or the src/make dtbo and modifying the config file doesn’t appear to correct the issue.

I’ve so far tried the following: going into /boot/config.txt and changing dtoverlay=hyperpixel4 to dtoverlay=hyperpixel4:rotate doesn’t correct touch to portrait. Changing display_rotate=3 to display_rotate=0 does, however, correctly set the image to portrait. Flipping the height and width makes it render across the full screen. With this done, everything is working except for touch.

Has anyone done this before? Are there generalized steps for modifying a dtoverlay to do this?

Any support would be very much appreciated, thank you.



There’s an alternate driver for the HyperPixel4 touchscreen which might help- details here- https://github.com/pimoroni/HyperPixel4TouchScreen/tree/master/driver

And also discussed at great length here: https://github.com/pimoroni/HyperPixel4TouchScreen/tree/master/driver

Granted this repository doesn’t tell you that you need to make build and make install to replace the hyperpixel4.dtbo with a modified one before using the rotation commands documented at the top. ( I need to fix that )

Edit: For clarity the rotation settings specified in the normal hyperpixel4.dts for the normal driver are just for 0 and 180 degrees landscape modes. It’s been a while, but I think I remember issues with portrait that the alt driver fixed.

Edit 2: for brevity:

wget https://github.com/pimoroni/HyperPixel4TouchScreen/releases/download/v1.0/hyperpixel4-goodix-dkms_1.0_all.deb
sudo dpkg -i hyperpixel4-goodix-dkms_1.0_all.deb
git clone https://github.com/pimoroni/HyperPixel4TouchScreen
cd HyperPixel4TouchScreen/driver
make build
sudo make install

And then in /boot/config.txt use:

  • dtoverlay=hyperpixel4:rotate_0 - Portrait, USB ports on top
  • dtoverlay=hyperpixel4:rotate_1 - Landscape, USB ports on left
  • dtoverlay=hyperpixel4:rotate_2 - Portrait, USB ports underneath
  • dtoverlay=hyperpixel4:rotate_3 - Landscape, USB ports on right

These all match the number you supply to display_lcd_rotate=.

Note: both Portrait orientations must have framebuffer_width=480 and framebuffer_height=800 specified instead of the defaults in /boot/config.txt.

Hyperpixel 4.0 Touchscreen Rotate with Display

Hello and thanks for such a prompt and thorough reply! This resolved my issue for running it in rotate_0 mode with two (very) minor modifications to what you posted in Edit 2. I needed to sudo apt install dkms raspberrypi-kernel-headers before doing dpkg -i in step 2 of Edit 2 to satisfy dependencies. The only other thing I did differently was modify the display_rotate parameter instead of display_lcd_rotate in /boot/config.txt.

Thank you so much, worked great.


Hello! I am curious. So if I just follow the “Edit 2 for brevity”, it will allow to rotate the screen and the touch? Or do I need to do something else? I want to rotate to landscape with the usb ports on the left side.


for me in portrait mode the touch is still inverted on x and y axis.
i followed this guide and the others in the forum but where not able to get a propper tochscreen support working in portrait mode.
can someone please help? this wasted nearly my hole weekend in trying out.
frustrating :(


What application are you using to read the touch coordinates?

Using the custom drivers on Stretch Lite with rotate2 (portrait) and observing the touch output with evtest gives me sane X and Y coordinates (more so than the ones I get in landscape!). Same with rotate0.