Ubuntu linux on Picocalc (with luckfox lyra SBC) tinkering megathread

Before Starting The Journey

Main thread:

The purpose of this post is to share my experience “tinkering” with Picocalc on the Luckfox Lyra SBC. I hope my journey can help those who follow or provide some troubleshooting ideas for anyone encountering similar issues.

Regrettably, I am a complete novice when it comes to programming and Linux system development. I relied heavily on AI to implement many of the technical solutions. As a result, my skills in customizing the rootfs are still quite basic, and the current state is far from “out-of-the-box” ready. I would like to sincerely apologize for that.

However, I plan to update this post continuously. My goal is to build a more seamless, plug-and-play experience so that more people can enjoy the fun of embedded Linux hardware through Picocalc. (Just like me—Picocalc has become an excellent platform for learning about both the SBC and Linux.)

The First Version Image:

features:

  • Intree LCD drivers with DRM support;
  • Adb and RNDIS network interface;
  • Baud Rate: The serial port operates at 1,500,000 bps. You can log in via the USB-C port on the Picocalc and view system boot verbose as power up.
  • Includes an improved keyboard driver loaded as a .ko kernel module. This update specifically addresses Shift key shortcut usability within the Picocalc’s unique layout and retains the original mouse mode design from
  • Supports hardware PWM audio via the RMIO12 pin (requires minor hardware modification/soldering).
  • SD Card Slot: The onboard SD card slot is fully functional but requires manual mounting. Note that read/write speeds are relatively slow, which may limit its practical utility for high-performance tasks.

Hardware Requirements:

  • Luckfox Lyra SBC: If you want the board to fit perfectly inside the back cover, you should purchase the non-PLUS version (the one without the Ethernet port). Personally, I don’t recommend the version with 256MB Flash, as the capacity is too small for an SBC intended for learning. The TF-card-only version is much more convenient, as it allows you to swap systems quickly just by changing cards.

  • USB Wi-Fi/Bluetooth Module: I am using the BL-M8188FU3, so my network testing concluded once I got this specific module working. It is very affordable—only about 6 RMB in China, and you can find plenty of them on AliExpress globally.

  • MX1.25 Connector Cable. You need to connect the wifi module to the lyra board with this cable.

  • Soldering Tools (Soldering iron, solder, flux): Basic soldering is required to connect the Wi-Fi module and to enable hardware PWM audio output.

  • Note 1: I tested software PWM for audio, but it suffered from annoying noise and poor compatibility. If you need audio output, a basic hardware modification to use hardware PWM is the only recommended path.

  • Note 2: Soldering is not necessary if you don’t need audio or Wi-Fi (you can actually get a network connection via the USB-C port) or if you prefer using an MX1.25 to USB-A adapter cable to handle the Wi-Fi module.

  • A vast amount of time and patience: The joy is in the endless tinkering, right?

Flash the image

Disclaimer

Unfortunately, I haven’t yet mastered the complete packaging techniques of the Rockchip SDK. As a result, this image is a “pieced-together” version rather than a polished “one-click flash” package.But the magic of apt works here: once you get the system boot up and make access to internet, every thing can be installed and customized by yourself.

Additionally, I have only tested this image on Windows. Users on Linux or macOS will need to figure out the flashing process on their own.


Step 1: Download and Extract

Download the image file and extract it to your local directory.

Step 2: Prepare the TF Card

Insert a TF card (minimum 8GB) into your Lyra Board. During the first boot after flashing, the system will automatically expand the rootfs to fill all available space on the card and create a 1GB swap file.

Step 3: Enter Flashing Mode

Refer to the official Luckfox flashing tutorial. Download RKDevTool and put your device into Loader Mode or Maskrom Mode.

Step 4: Import Configuration

Open RKDevTool and go to the first tab, “Download Image”(下载镜像).

  1. Right-click anywhere in the list and select “Clear All Items”(清空所有项).

  2. Right-click again and select “Import Config”(导入配置).

  3. In the file selection window, change the file type filter (bottom right) to “ParameterFile(*.txt)”.

  4. Select the parameter.txt from my extracted folder.

Step 5: Select Image Files

After importing the config, you will see several partitions in the list: Loader, Parameter, uboot, boot, and rootfs. Match them with the files in the folder as follows:

  • LoaderMiniLoaderAll.bin
  • Parameterparameter.txt
  • ubootuboot.img
  • bootboot.img
  • rootfsrootfs.img

Click the […] button in each row to select the corresponding file, and ensure the “Check” box for each item is ticked.

Step 6: Execute Flashing

Click the [Run] (执行) button at the bottom left and wait for the process to complete. Once finished, the system will reboot automatically. If you see the red LED on the Lyra Board start blinking, the system is running.

Step 7: Final Assembly

Unplug the USB-C cable, install your Lyra Board back into the Picocalc, and power it on. If everything went well, you should see the Linux Tux penguin logo. Mission accomplished—now, enjoy the fun of tinkering with Linux !

1 Like

Regarding the Ubuntu 24.04 Image

This image is based on the Ubuntu 24.04 release by @markbirss Since the original image was massive and took a long time to flash during testing, I stripped out a large number of pre-installed packages to reduce it to its current size. I also replaced the keyboard .ko driver to ensure the keyboard functions correctly upon system startup.

In my testing, my boot.img is compatible with both Ubuntu versions (22.04 and 24.04) release (I am using the 24.04 one).

however, due to changes in kernel compilation options, the keyboard will not work if you boot those images directly. You will need to manually replace the keyboard .ko file provided in my Google Drive.

How to Replace the Driver via ADB:

Requirements: * A PC with ADB and drivers installed (Note: RK Driver Assistant and RKDevTool mentioned above already include these).


  • A USB-C cable connecting the Lyra Board to your PC.

Steps:

  1. Power on your Picocalc and connect it to your PC.
  2. Open a Command Prompt (CMD) and run: adb shell.
  3. If successful, you will enter the Lyra Board’s terminal with root privileges.
  4. Use adb push from another cmd window to transfer the file: adb push C:\path\to\your\file.ko /destination/path/in/linux/ (Note: Be mindful of the difference between Windows backslashes \ and Linux forward slashes /).
  5. Move the .ko file to the following directory in linux to replace the original: /usr/lib/modules/6.1.99/kernel/drivers/picocalc/ (Tip: For safety, rename the original file to .bak using the mv command is the best way).
  6. Run the reboot command. The keyboard should be functional after the restart.
  7. Testing: You can use insmod /path/to/file.ko to load the driver temporarily. If it says a module is already running, use lsmod to find the name and rmmod [module_name] to unload it.

About Wi-Fi Driver

I have only tested the rtl8188fu driver. Unfortunately, the fastest way to enable this driver is via insmod. You can write an /etc/init.d/ script to automate this at boot. (Note: For the RTL8188, you must also copy the firmware file to /lib/firmware/rtlwifi/rtl8188fufw.bin).

I wrote an install.sh script, but the final modprobe step fails in my tests. This is because I compiled the USB and cfg80211 drivers directly into the kernel, which conflicts with the existing .ko modules in the rootfs. When modprobe runs, Linux tries to load those original modules; if it sees the driver is already in the kernel, it throws an error. Solution: Manually clean up or rename any .ko files related to usb and cfg80211 (renaming to *.bak is the safest method).

(you can use dmesg -w to see the debug info from modprobe to locale those problem .ko modules)

Regarding the Keyboard Driver

Due to Picocalc’s unique keyboard layout, the default firmware fails to trigger certain combinations like Shift + F1. In fact, the official firmware has several logical flaws regarding modifier keys (for example, pressing Shift + F1 results in Linux receiving Shift + F6).

I have improved the key logic based on hiptoot’s keyboard driver. By differentiating between Left Shift and Right Shift, the system can now handle these specific shortcuts. I have also retained the Mouse Mode design, which remains highly convenient when running GUI applications.

Note on Hardware Limitations:

Unfortunately, due to internal logic issues in the official Picocalc firmware, pressing Shift simultaneously with the Left/Right Arrow keys, CapsLock, or Backspace results in no output at all. Fixing this would require a complete overhaul of the keyboard firmware—a daunting task. Consequently, some shortcut logic remains slightly unintuitive, which I hope to address in the future.

Key Mapping Table

Physical Key Combo Logical Output
RShift + Enter Toggle Mouse Mode
LShift + Enter Shift + Enter (Firmware would output Insert if not deal with)
RShift + F1~F5, Esc, Tab, Del, Up, Down F6~F10, Brk, Home, End, PageUp, PageDown
LShift + F1~F5, Esc, Tab, Del, Up, Down Shift + F1~F5, Esc, Tab, Del, Up, Down
LShift + RShift + F1~F5 Shift + F6~F10, Brk, Home, End, PageUp, PageDown

In Mouse Mode:

  • Up, Down, Left, Right: Move Mouse Cursor
  • “[” and “]”: Left Click / Right Click
  • RShift + Up / Down: PageUp / PageDown
1 Like

Gaming on Picocalc

The main reason I chose Ubuntu 24.04 was the hope of running Picoarch (due to Glibc version requirements). However, running this software under fbcon proved to be a nightmare, no matter what you did(recomplite on device,try to link all library from buildroot image)alway get segmentation faults. While Picoarch delivers impressive performance on some Buildroot-based systems (reaching a full 50–60 FPS), the limited package extensibility of those systems is a major drawback. Consequently, I opted for the flexibility of apt and arrived at the following conclusions:

1. Running Picoarch via X11 GUI

Using my custom kernel, you can successfully run Picoarch within the X11 GUI.

  • To improve Picoarch frame rates under X11, you need to configure the X11 driver to FBdev. However, compared to using DRM, you will notice a significant drop in the smoothness of the rest of the UI such like the mouse cursor. It is truly frustrating to have to compromise one for the other.
  • Performance: Approximately 40 FPS.
  • This setup provides a very smooth experience for emulators like gPSP, which features built-in frame skipping.

2. Running via RetroArch (Recommended)

Ultimately, I chose RetroArch (which you can install directly via apt). Here are my optimized settings for running NES, GB, GBC, and GBA games reasonably smoothly:

  • You can directly download the compiled libretro core from the following website.
    https://buildbot.libretro.com/

  • Launch Environment: Start RetroArch directly from the console CLI (not in X11).

  • Video Driver: Set to gl, You must set the full-screen resolution to 320x320. Otherwise, the gl driver will fail to initialize the screen (as other resolutions are not supported) and throw an error..

  • Audio Driver: Set to alsa.

  • Menu Driver: Use rgui. This keeps memory usage right at the 100MB limit.

  • Settings: Ensure “Threaded Video” is enabled.

  • Emulation Logic: Even if RetroArch doesn’t hit a full 60 FPS screen on NES or GB, it uses frame skipping to maintain stable logical speeds. This ensures audio sounds normal and the game speed remains consistent.

  • CPU Usage: Since gl uses the CPU to emulate GPU functions, CPU usage will appear significantly higher.

  • Expectations: In the UI, the gl driver can reach about 53 FPS (nearly the limit of the SPI bus). During actual gameplay, you can expect around 30+ FPS video output (feels), which is playable.

Since this setup relies on RetroArch, a system based on Ubuntu 22.04 might offer even better performance. I look forward to hearing your results if you decide to test it!

1 Like

GUI on Picocalc

I previously believed that running a modern GUI with only 100MB of RAM was impossible. I was completely wrong. Running X11—even on a screen as small as 320x320—is an absolute game-changer. Here are some notes:

  • x11vnc: You can remotely operate the Picocalc from your PC via a graphical interface. This allows you to share your PC’s clipboard, keyboard, and mouse (most of the screenshots in this post will captured this way).

  • Window Manager (fluxbox): I chose fluxbox as it features a lightweight taskbar and supports multiple desktops. It offers extensive customization for hotkeys, menus, and themes. With the right configuration, it creates an experience remarkably similar to the classic Windows Mobile 5.x era, multitask switching is fast and fluent, no longer “framebuffer contention” problems compared with the fbterm.

  • Terminal (mlterm): I selected mlterm because it supports pixel-based TTF fonts, customizable color schemes, and the Sixel protocol, which allows for inline image rendering directly within the terminal, In X11, most CLI applications can display upto 256 colors, resulting in quite good visual effects.

  • Fonts (fusion pixel font): This font provides three sizes (8px, 10px, and 12px) with full CJK (Chinese, Japanese, Korean) character support and monospaced variants. It is a perfect match for the terminal; at 10px, it can display 64 columns of text on the Picocalc screen with incredible clarity and sharpness.
    GitHub - TakWolf/fusion-pixel-font: 开源的泛中日韩像素字体,黑体风格

1 Like

Thank you for taking the time and effort too further enhance functionality and features, im sure many other people will certainly benefit

Yes, replacing boot.img is a fast and convient way to chage particularly device tree changes.

My initial use case was too run for example a lora spi module and I can understand that people are wanting to enable the picocalc included standard devices/pheripherals etc also

Furhter since my initial images i did update the sdk, but have not included the various optimized changes you are including and i switched to running the Luckfox Lyra Zero W via an adapter board

another meshcalc branch is also here

Including the various driver changed and enhancements directly to the sdk could also help with the size of images and removing unwanted packages, but i also modified the rootfs and it is a bit of a hack to add and remove things.