Raspberry Pi
µGFX applications can run natively (without emulation/simulation) on any Linux system. This means that µGFX can run without any problems on a Raspberry Pi. This is a step-by-step setup & configuration guide that will explain everything necessary to run µGFX on a Raspberry Pi.
Introduction
The most common question asked in this context is why to run µGFX on an embedded Linux device. Today's single board computers running Linux are powerful enough to run X and a complete desktop environment. Therefore, GUI applications can be written using desktop GUI frameworks such as Qt or GTK. Running µGFX instead on such as system has two main, but very important advantages:
- Dependencies: Installing X, a desktop environment all required desktop applications and the required libraries to run custom built desktop applications pull many dependencies. This makes the system become heavy and bloated. However, the most important issue is that all these dependencies need to be maintainer. For example, when performing as sytem update, more components have to be tested to ensure the continuous and uninterrupted functioning of the device. This becomes even more important for mission critical equipmenet such as medical devices where each component needs to be audited and certified individually. Running µGFX on such a device vastly reduces the complexity of the system and therefore allows to built more stable & cheaper devices featuring a GUI while still running on a powerful Linux based system.
- Resource requiremenets: ToDo
- Security: ToDo
Used utilities
The following utilities will be used in this tutorial:
However, this guide has been kept as generic as possible. Following the same steps should allow running µGFX on any embedded Linux system.
Prerequisites
It is important that the used Linux kernel has been compiled with framebuffer support. With the latest version of Raspbian (state of 2016-08-23) this is the case. Therefore, we don't need to modify anything. If your Linux distribution doesn't come with a Linux kernel with enabled framebuffer support, please consult the corresponding documentation on how to enable it.
If your Linux kernel comes with built-in framebuffer support, you should see the framebuffer device under /dev/fb0
, /dev/fb/0
or similar.
For more information about the Linux framebuffer, please see Linux Framebuffer.
Disabling X
For simplicity, we are using the pre-configured Raspbian Linux distribution in this tutorial. That distribution comes with X and and entire desktop environment. It is configured in such a way that X always starts automatically. However, X blocks the access to the framebuffer. Therefore, we first have to manually disable X before we can continue. The easiest way of doing this is simply removing the X from auto-start. This is process is different for every Linux distribution. In case of Raspbian we can use the raspi-config
tool to disable X:
raspi-config ---> Boot Options ---> Console (Text console, requires user to login)
However, if you'd like to keep your system as small as possible (in which case you probably don't want to start off with Raspbian in first place), you can just completely remove X from your system. See here for instructions.
Troubleshooting
The most common issues are:
- The Linux kernel you are using has not been compiled with framebuffer support. (See Prerequisites).
- The framebuffer device is not accessible through one of the standard paths. (See Linux Framebuffer).
- The user executing the µGFX application doesn't have the permission required to access the framebuffer device. (See Linux Framebuffer).
- Another application (usually the X Server) already uses, and therefore blocks, the framebuffer. (See Prerequisites).