Unicorn PHAT & SD corruption

Hi, I would use my Unicorn Phat on a RPI3; I wrote some python script and I use the PHAT as a monitor to check the status of my servers. It works fine for some minutes. but after som reboot of my PI3, I receive a lot of messages about corruption of SD (… EXT4-fs error (device mcblk0p2): ext4 get inode lock…).
Do you have some suggest to solve this issue?


What power supply are you using with your Pi 3?


I’m using a power adapter send to me with the RPI3:

STONTRONICS Switching adapter
INPUT: 100-240V
OUTPUT: 5.1V 2.5A

Guido Vizioli

That should be fine, what about the SD card?

The type of corruption you mention can happen for many reasons, but an unstable power supply or weird SD card are the most common cause.


I’m using Sandisk 16Mb sd card and before installation of Pimoroni library and script update, all worked fine….
I’m working about this project starting from 4 months and never, until now, I have had problems about cards corrupted…

Guido Vizioli

Hi, I executed a new test running rainbow.py at max brightness; after 15 minutes the SD was corrupted…

What do you suggest? (the power adapter is origonal with the raspberry logo)

Do you have suggest about what to check to avoid this?

Tried to check in with the other engineers to see if they’re got any ideas, but it’s been a busy week. It’s definitely unusual. We’ve had display Pi’s running Unicorn HAT for days at a time without these symptoms.

Do you have any other SD cards to try? It’s possible it could be a marginal card that doesn’t play well with noise from the HAT.


I tried with other SD, but the results is the same, but I think that the problem could be with what is running together with PHAT: I wrote an application in PYTHON that interface my domestic domestic (Bticino; It uses the following libraries: MYSQLDB, UPSAPCD, TELEPOT, PSUTIL, LOGGING, REDIS, SOCKET, URLIB2.

Do you think that could be some problems between PHAT modules and this scenario?

Thanks for your support.

Guido Vizioli

It’s possible that you’re running at the very, very high end of power consumption and that’s affecting writes to the SD card. Have you tried reducing the brightness of Unicorn HAT- you can quite drastically reduce power consumption with little visible change in brightness.

It might be worth removing the HAT, running your software for a while (including the software to drive the HAT, it wont care if there’s not one attached), and seeing if the corruption still occurs.


without the PHAT board, everything works fine, included 6 LED + 1 buzzer addressed using GPIO (I’m using this configuration for 1 month without problems); I need more visual check, so I would use a PHAT…. For all tests with PHAT I’m not using other LEDS and BUZZER…s

Guido Vizioli

Have you tried to modify your script so that it only uses a single row of pixels on the Unicorn? Ultimately, it seems to be a power related issue, but without knowing exactly what your script does it is hard to tell whether that is relevant.

Sorry. It looks like I might have been barking up the wrong tree with the power consumption theory. See: [SOLVED] Problems with Unicorn pHAT Software