Repository navigation
uCompute — uComputeOS
The board runs uComputeOS, a mini embedded operating system written in MicroPython.
In a standard educational setup, students write code on a PC and rely constantly on an IDE like Thonny to execute scripts via the REPL serial link. While great for initial writing, this method creates a heavy hardware dependency. uComputeOS completely breaks this limitation, providing massive engineering and pedagogical advantages:
-
True Autonomy (Untethered Hardware): With Thonny, the micro-controller is merely an extension of the computer. If you unplug the USB cable, execution stops. uComputeOS transforms the board into a standalone computer. Once code is stored on the Flash memory or an SD card, a student can walk away, power the board with a standard battery pack, and fully operate, test, or showcase their projects anywhere.
-
Instant "Plug-and-Play" Script Swapping: In classrooms, switching between multiple software routines (e.g., jumping from an LED test script to a complex sensor logging loop) usually requires opening Thonny, loading files from the hard drive, and clicking the "Run" button manually. uComputeOS handles file indexing natively on the silicon. Users can browse, select, and fire up different scripts directly from the on-board hardware buttons in a fraction of a second.
-
Production-Grade Resilience (No REPL Freezes): When a MicroPython script crashes inside an IDE like Thonny, the REPL console often freezes, locks the serial interface port, or forces the developer to perform a hardware hard reset. uComputeOS wraps code execution inside a robust
try/exceptabstraction layer. If an application throws a fatal runtime exception, uComputeOS catches the crash, renders an informative visual warning screen, and drops the student smoothly back into the root File Manager—keeping the hardware responsive and active. -
Realistic Embedded Lifecycle Simulation: Developing inside a tethered IDE masks the realities of field-deployed electronics. By utilizing uComputeOS, students learn to package their software into distinct executable modules, manage file hierarchies across dual physical media (Flash vs. SD storage), and handle real-world user interface inputs (analog resistor ladders). It shifts the learning experience from basic syntax scripting to professional embedded product design.
uComputeOS is available in two variants (ST7789 IPS or SSD1306 monochrome) with specific hardware dependencies and features like a splash screen, file manager, and dynamic execution. oth versions maintain identical core logic (File Manager, block-based multi-medium file copying, and runtime exception catching), but differ in how they interface with the display drivers and allocate internal memory resources.
This version is tailored for the high-resolution 1.3" IPS TFT display (240x240 pixels) over the high-speed SPI0 bus.
-
Graphical Framework: Uses a dedicated 16-bit RGB565 pixel buffer via
framebuf2.py. -
Memory Management: Allocates a larger RAM buffer array (
240 * 240 * 2 = 115.2 KB) to achieve fluid visual rendering and handle smooth custom fonts. - Source Repository Link: uComputeOS_ST7789.py
This streamlined edition is optimized for the ultra-budget 0.96" SSD1306 OLED display (128x64 pixels) running on the I2C0 bus (Address: 0x3C).
-
Graphical Framework: Relies directly on the lightweight native
ssd1306.SSD1306_I2Cstandard driver. - Resource Optimization: Consumes a microscopic memory footprint (only a single 1-bit allocation for black/white states), freeing up vast amounts of internal RAM for extensive, multi-threaded user applications.
- Source Repository Link: uComputeOS_oled.py
- Identify which display technology is populated on your custom board.
- Download the matching script from the repository links above.
- Rename your chosen configuration file to
main.pyand save it directly at the root of the internal storage to ensure it boots automatically when powering on the device.
The board runs uComputeOS, a mini embedded operating system written in MicroPython.
-
LCD Screen Version:
st7789py.py,framebuf2.py,vga1_8x8.py,vga2_bold_16x16.py -
OLED Screen Version:
ssd1306.py -
Common Storage:
sdcard.py
-
Splash Screen: Displays system information (
os.uname), firmware version, as well as total and free Flash space calculated live. -
File Manager (FileManager): Dynamically detects at boot if a Micro SD card is present. The user selects their root storage space (
FLASHorSD). -
Navigation & Selection: Visual interface navigable using the analog button (
Up,Down,Select). A triangle-shaped cursor points to the selected script. -
Dynamic Execution (
EXEC): Allows opening any user.pyfile present on the storage medium and executing it on the fly. In case of a code error, uComputeOS captures the exception and displays a red error screen without crashing the board. -
Inter-Storage Copying (
CP>SD/CP>\): Integrates a block-based copy function (512 bytes) allowing scripts to be transferred from the internal Flash memory to the SD card (and vice versa) directly from the hardware interface.
For the graphical interface (uComputeOS) to launch automatically upon powering up the board without requiring a computer, you must register it as the main script:
- Select the version of the code corresponding to your hardware configuration (ST7789 LCD Screen Version or SSD1306 OLED Screen Version).
-
Rename the chosen file to
main.py. -
Transfer it to the root of the RP2040's internal Flash memory (and not in the
lib/folder) using your IDE (such as Thonny). -
Ensure that all required dependencies (
sdcard.py, screen drivers, and fonts) are present in the/libfolder of the internal memory.
On the next reboot or power cycle, the MicroPython firmware will natively look for the main.py file and instantly boot the GUI on the screen.