PiLibSDK
Raspberry Pi bare-metal SDK library
Pre-alpha version 0.22, in progress - under development
Last Update: 04/15/2026
(c) 2026 Miroslav Nemecek
https://github.com/Panda381/PiLibSDK
Download library along with sample applications and all resources (350 MB)
Schematics and printed circuit boards are in KiCAD 9 format.
PiLibSDK is a bare-metal library for Raspberry Pi modules. "Bare-metal" means that programs run directly on the hardware without an operating system, they are not controlled by the operating system, and they have full access to the hardware. Raspberry Pi modules can thus be used in a similar way to microchips. Another advantage is that the device is fully operational within 3 seconds of powering on. Currently, the Raspberry Zero 1, Zero 2 W, Pi 2, and Pi 3 modules are supported. Support for the Pi 4 and Pi 5 modules is very limited, and they will likely not be supported in the future either, as their benefits for bare-metal use are minimal.
A boot loader is available for ZeroPC device, which allows easy launching of programs from an SD card. The programs are ready for ZeroPC and ZeroTiny, with Zero 1, Zero 2 32-bit, or Zero 2 64-bit modules. The Zero 1 and Zero 2 modules differ primarily in speed - the Zero 2 is noticeably faster than the Zero 1. The higher speed is due not only to a higher processor frequency but also to a newer architecture. In addition, the Zero 2 module has 4 cores, while the Zero 1 has only one core. Therefore, it is strongly recommended to use the Zero 2 module. Use the Zero 1 module only if you own it and have no better use for it. The Zero 2 module can be operated in 32-bit or 64-bit mode. The compilations are prepared for both modes. From a user’s point of view, there is no noticeable difference between the modes. It is recommended to prefer 64-bit mode, which may be slightly faster in some cases.
Note: A boot loader is not required to run programs. You can run programs directly on the Zero1/Zero2 module itself, without additional hardware or a boot loader. Copy the system files from the Root directory of the corresponding !ZeroTiny* folder to the SD card. You will need the files "bootcode.bin", "config.txt", "fixup.dat", and "start.elf". Copy the program to the Root folder as well, and rename it to KERNEL.IMG. The program will start automatically when power is turned on.
All of my source code and data are completely free to use for any purpose. The exception is certain files derived from third-party sources - these are subject to the original author’s license. This includes most fonts, as well as portions of source files taken from the Circle library and Linux code - these sections are marked in the source files.
Most fonts in this library are not my creation. They were downloaded from the internet from unknown sources, with unknown license terms of use. If you want to use only strict licenses, do not use fonts from this library.
To compile 32-bit mode, you will need AArch32 GCC (tool name "arm-none-eabi"). Install to C:\ARM_GCC32.
To compile 64-bit mode, you will need AArch64 GCC (tool name "aarch64-none-elf"). Install to C:\ARM_GCC64.
from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
If you will use another paths, edit paths in _c1.bat (set GCC_PI_PATH).
!ZeroPC ... content of SD card for device ZeroPC - common files
!ZeroPC_1 ... content of SD card for device ZeroPC - executables for module Zero 1
!ZeroPC_3 ... content of SD card for device ZeroPC - executables for module Zero 2 32-bit
!ZeroPC_4 ... content of SD card for device ZeroPC - executables for module Zero 2 64-bit
!ZeroTiny ... content of SD card for device ZeroTiny - common files
!ZeroTiny_1 ... content of SD card for device ZeroTiny - executables for module Zero 1
!ZeroTiny_3 ... content of SD card for device ZeroTiny - executables for module Zero 2 32-bit
!ZeroTiny_4 ... content of SD card for device ZeroTiny - executables for module Zero 2 64-bit
_devices ... devices: pibase = base Pi module, zeroPC = ZeroPC module
_font ... fonts
_lib ... libraries
_sdk ... SDK (peripherals drivers)
_tools ... compilation tools
Apps ... source codes of sample applications
To prepare the SD card, format it to FAT32, copy the contents of the !ZeroPC or !ZeroTiny folders (depending on the device type) to it, as well as one of the !ZeroPC_* or !ZeroTiny_* folders (depending on the module type).
ZeroTiny is the simplest game console based on the Raspberry Pi Zero 1 or Zero 2 modules. It is recommended to preferably use the Zero 2 module in 64-bit mode. The Zero 1 module may be noticeably slower in some applications. ZeroTiny features 8 buttons, a stereo PWM audio output, and an HDMI display output. A boot loader is available, allowing for easy program launch from an SD card.
The ZeroTiny is designed in a sandwich-style construction. In my prototype, I connected the Zero module to the motherboard via an 8mm header - primarily to facilitate easy module replacement. If you solder the Zero module to the board using only a pin header, the design will be lower. However, this may make repairs more difficult, such as replacing a button.
Detailed materials for ZeroPC hardware can be found in the "_devices/ZeroTiny/diagram" folder.
Source code and sample programs can be found in the "Apps" folder.
You can find the compiled sample programs in the "!ZeroTiny*" folders, organized by module type and processor mode.
ZeroPC is a small computer based on the Raspberry Pi Zero 1 or Zero 2 modules. It is typically intended for use with the Zero 2 module in 64-bit mode. In addition to the module, the ZeroPC includes stereo PWM audio output, HDMI display output, an external connector for peripherals, and an internal keyboard consisting of 49 microswitches. A boot loader is available, allowing for easy program launching from an SD card.
I recommend not soldering the Zero module directly to the motherboard; instead, use an 8mm slot - this will allow for easy replacement of the module if you want to use it in another device or if you want to use a different module, such as swapping the Zero 2 for a Zero 1. There are 3 electrolytic capacitors on the board - be careful where you place them so they don’t interfere with the top panel; you may need to lay them flat. If you mount the Zero module onto the board using a pin header (without a socket header), you may be able to use only one cover panel that spans the entire size of the board. When using a socket header, you must use two panels - the panel above the module will be positioned higher and will be screwed to the keyboard panel using columns. The pins on the external connector are divided into groups so that small modules can be connected only to a specific interface. Blind pins are blocked, for example with heat-shrink tubing, to prevent incorrect insertion of the connector - the connector should not have a pin in that location. There is a 1-pin gap between the individual groups - either break the connector at that point or clearly mark on the board where each group of pins is located.
Detailed materials for ZeroPC hardware can be found in the "_devices/ZeroPC/diagram" folder.
Source code and sample programs can be found in the "Apps" folder.
You can find the compiled sample programs in the "!ZeroPC*" folders, organized by module type and processor mode.
System
Book
![]() ABC - Fairy Tales from the Alphabet (Czech) |
![]() GINGER - Gingerbread House (English) |
![]() GINGERCZ - Gingerbread House (Czech) |
Demo
I recommend using MP3 files with a constant bitrate. Some older MP3 formats, or MP3s with a variable bitrate, may not allow you to move the playback pointer, or the track may end prematurely before the end. The player only supports short file names - that is, the name of an MP3 file can be up to 8 characters long. If a folder also contains a JPG image with the same name as the MP3, with dimensions of 320x240 pixels, it will be displayed instead of the info page. You can switch between the image and the info using the Tab key. The Space key plays the current directory starting from the first track. The Enter key starts playback from the current track.
The player comes with a sample set of songs, in the style of various artists, created in Suno AI. In total, there are 248 tracks, containing 13 hours of music. Samples can be downloaded here.
Download samples part 1 (200 MB): styles of ABBA, The Beatles, Breton Celtic, Classical
Download samples part 2 (224 MB): styles of Computer, Cyberpunk, Enya, Folk
Download samples part 3 (213 MB): styles of Children, Jean-Michel Jarre, J-pop
Download samples part 4 (217 MB): styles of Loreena McKennitt, Medieval, Meditation, Metal, Vox Angeli
Download samples part 5 (207 MB): styles of Mixed, Nightwish with Tarja Turunen, Mike Oldfield
Miroslav Nemecek