# 'GPIO not allocated' error for HyperPixel 4.0 on a raspberry pi 4B

**URL:** <https://forums.pimoroni.com/t/gpio-not-allocated-error-for-hyperpixel-4-0-on-a-raspberry-pi-4b/28950>\
**Category:** Support\
**Created:** [July 5, 2026, 1:30pm UTC](https://forums.pimoroni.com/t/gpio-not-allocated-error-for-hyperpixel-4-0-on-a-raspberry-pi-4b/28950 "2026-07-05T13:30:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![acardona](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/acardona/32/12218_2.png) [@acardona](https://forums.pimoroni.com/u/acardona)\
**Post date:** [July 5, 2026, 1:30pm UTC](https://forums.pimoroni.com/t/gpio-not-allocated-error-for-hyperpixel-4-0-on-a-raspberry-pi-4b/28950/1 "2026-07-05T13:30:11Z")

</div>

I have flashed a fresh raspbian into the SD card of a 2018 raspberry pi 4B, running:

```auto
$ uname -a
Linux raspberrypi 6.18.34+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.18.34-1+rpt1 (2026-06-09) aarch64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 13 (trixie)
Release:	13
Codename:	trixie

```

After following the setup instructions from here:

> **[Getting Started with HyperPixel 4.0](https://learn.pimoroni.com/article/getting-started-with-hyperpixel-4)**
>
> Learn how to connect and setup your HyperPixel 4.0! – Pimoroni Learning Portal

… to setup the driver under `/boot/firmware/config.txt` like this:

```auto
...

[all]
dtoverlay=vc4-kms-dpi-hyperpixel4

```

… upon reboot, the HyperPixel 4.0 touchscreen doesn’t light up. The desktop, though, adopts the dimensions and resolution of the screen, as if it was working. I can see that via remote desktop (VNC).

I’ve checked the logs with `journalctl` for the `hyperpixel4-init.service` and I see this error, related to ‘GPIO not allocated’:

```auto
$ journalctl -xeu hyperpixel4-init.service

Jul 05 13:04:18 raspberrypi systemd[1]: Starting hyperpixel4-init.service - HyperPixel 4.0" LCD Display Initialization...
░░ Subject: A start job for unit hyperpixel4-init.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit hyperpixel4-init.service has begun execution.
░░ 
░░ The job identifier is 119.
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: Traceback (most recent call last):
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: File "/usr/bin/hyperpixel4-init", line 241, in <module>
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: setup_pins()
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: ~~~~~~~~~~ ^^
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: File "/usr/bin/hyperpixel4-init", line 12, in setup_pins
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: GPIO.setup([CLK, MOSI, CS], GPIO.OUT)
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: ~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: File "/usr/lib/python3/dist-packages/RPi/GPIO/ __init__.py", line 704, in setup
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: initial = _check(lgpio.gpio_read(_chip, gpio))
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: ~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: File "/usr/lib/python3/dist-packages/lgpio.py", line 903, in gpio_read
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: return _u2i(_lgpio._gpio_read(handle&0xffff, gpio))
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: raise error(error_text(v))
Jul 05 13:04:19 raspberrypi hyperpixel4-init[825]: lgpio.error: 'GPIO not allocated'
Jul 05 13:04:19 raspberrypi systemd[1]: hyperpixel4-init.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ An ExecStart= process belonging to unit hyperpixel4-init.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Jul 05 13:04:19 raspberrypi systemd[1]: hyperpixel4-init.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit hyperpixel4-init.service has entered the 'failed' state with result 'exit-code'.
Jul 05 13:04:19 raspberrypi systemd[1]: Failed to start hyperpixel4-init.service - HyperPixel 4.0" LCD Display Initialization.
░░ Subject: A start job for unit hyperpixel4-init.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit hyperpixel4-init.service has finished with a failure.
░░ 
░░ The job identifier is 119 and the job result is failed.

```

Upon checking with `raspi-config` whether any interfaces are on, neither SPI nor I2C are activated: both are off.

There are 3 devices according to `/dev/i2c` :

```auto
$ ls /dev/i2c-*
/dev/i2c-20 /dev/i2c-21 /dev/i2c-22

```

The `i2cdetect` command shows the screen is detected:

```auto
$ i2cdetect -y 22
     0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- 
10: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

```

At this point I am out of ideas. What else can I do to avoid this error?

Thank you!

---

<div class="post-metadata">

**Author:** ![acardona](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/acardona/32/12218_2.png) [@acardona](https://forums.pimoroni.com/u/acardona)\
**Post date:** [July 10, 2026, 3:36pm UTC](https://forums.pimoroni.com/t/gpio-not-allocated-error-for-hyperpixel-4-0-on-a-raspberry-pi-4b/28950/3 "2026-07-10T15:36:36Z")

</div>

More that I have tried:

Install raspbian/debian bookworm instead. There were some libraries that weren’t found in trixie. The installation manual present in the HyperPixel 4.0 were 5 years old, and the errors in the script that we were running pointed at various dependency issues with bcm library, that isn’t present in trixie. Same situation though: screen seems to be detected but continues to be blank (black, no light).

I’ve found the modern guide online [Getting Started with HyperPixel 4.0](https://learn.pimoroni.com/article/getting-started-with-hyperpixel-4) but I don’t know if it applies to my version of the HyperPixel 4.04 from 2021. The setup of the /boot/firmware/config.txt file there looks like mine, but the screen never turns on.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [July 10, 2026, 8:37pm UTC](https://forums.pimoroni.com/t/gpio-not-allocated-error-for-hyperpixel-4-0-on-a-raspberry-pi-4b/28950/4 "2026-07-10T20:37:28Z")

</div>

First off, I don’t own a HyperPixel. =(  
But I will try to help anyway. ;)  
Disclaimer, I only glanced at the setup guide.

You say that i2c is disabled, but then run a scan and find a device?  
I’m pretty sure the scan won’t run if i2c is disabled?  
It’s not used with a hyperpixel, even the touch versions, and those pins are repuposed.

> **[Hyperpixel at Raspberry Pi GPIO Pinout](https://pinout.xyz/pinout/hyperpixel)**
>
> A high-resolution 3.5

If its **on** it’s going to mess things up.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [July 10, 2026, 8:46pm UTC](https://forums.pimoroni.com/t/gpio-not-allocated-error-for-hyperpixel-4-0-on-a-raspberry-pi-4b/28950/5 "2026-07-10T20:46:51Z")

</div>

Do you have anything else connected to that Pi’s GPIO header?
