Luckfox Lyra on PicoCalc

it does have external repo support, though it’s our own repo and we only have a handful of packages for it yet. The kernel driver development is in a separate repo, in part to make it easier for it to be re-used by other projects. There is also a copy of the Luckfox kernel and u-boot forks hosted under our github organization.

I guess this seems like as good a time as any to introduce the project - Calculinux · GitHub - https://calculinux.org - it’s intended to be a distro for the Picocalc and a home for documentation for and/or links to other distros for the picocalc. The work up there is mostly @0xd61 and @johnlaur’s work, with a little of my own on the infrastructure side, and the keyboard patches by @beapig. pull requests are of course welcome!

In particular the documentation up there is very rough. I’ve reviewed and edited some of it, but it was initially AI generated and contains a lot of inaccurate information and assumptions. I would LOVE some help with that documentation, feel FREE to submit PRs as you see fit and we’ll get them merged.

Right now, it’s very early days. we aren’t done with the initial kernel work, but we at least have an alpha version of the distro you can install with the ability to install as many as a dozen packages! :smiley:

Because it’s yocto, the packages are compiled and hosted for the luckfox lyra specifically. we do intend to eventually support the milk v duo so we are trying for a flexible approach, however.

I would love to have this be a collaboration point for the Linux on picocalc community!

5 Likes

@hpsaturn there is a psckage for your hp calculator emulator fork (compiled with SDL) but I have no idea how to use it.

1 Like

do you have any buildroot or other build scripts somewhere that could be used as a template for building this on yocto?

@Astrox For writing an OS, or a shell (your ‘OS’ looks awfully like a shell to me), the RP2350 is far more open and flexible than the Rockchip RK3506 in the Luckfox Lyra, and thus far more amenable for targeting at the bare metal level than the RK3506.

In my own case, creating zeptoforth for the RP2040 and RP2350 was a lot of work, but at the end it was entirely doable, and if all copies of zeptoforth were somehow erased from the Earth, but civilization and computing still survived by some miracle, I could write it again need be.

Not so with the RK3506. I wouldn’t know where to even start if I wanted to make a version of zeptoforth that ran on it, considering the proprietary binary blobs it uses which makes it essentially impossible to use anything other than Linux on.

This is why I limit myself to open microcontrollers (and cases where if there are binary blobs they can simply be uploaded to external chips and then forgotten about, such as in the case of the CYW43439).

And this is why, sad to say, you probably shouldn’t consider the Luckfox Lyra as a target for your OS/shell. If for me, where I have been programming on bare metal for years now, the RK3506 in the Luckfox Lyra is out of reach, it is almost certainly even further out of reach for you.

OK So this hasnt been heavily discussed yet – the below is just my personal opinion.

I came into the project a bit later, but decided to support this effort because I personally think it’s best to center around a build system designed to deal with the peculiarities of weird embedded hardware, vendor patched kernels, and all of the nonsense necessary to support that stuff. Yocto/openembedded is an extremely popular system in and out of industry designed to do that, and it makes sense to use it. It starts with nothing and produces all of the stuff (not just the kernel) that you actually need to bootstrap the system, including the weird partition requirements, the bootloader, the kernel, the kernel modules, udev configuration, and the devicetree, all sprinkled and baked up with the rockchip rkbin secret sauce. Eventually we’ll probably have it build the stm32 firmware as well.

I like the use of an immutable base system and A/B firmware because it makes it very easy to update and much harder to break. This is a UX thing, and I think it’s important to minimize the amount of time people have to spend opening up their calculators and being frustrated if something breaks. I think a very highly curated distribution is proper here because of the peculiarity of the hardware. IMO if you ultimately just dump users to a vanilla ubuntu shell, that’s a bit rougher than most people want. And you don’t really have the resources to do the full ubuntu X11 desktop either. So you just spend all of your time shoehorning ubuntu onto something it wasnt really designed for.

But setting Ubuntu aside, I agree with you that users must be able to easily add their own software. The system currently supports an overlayfs partition, so data and configuration can persist across updates of the underlying system. This currently requires that packages designed for user installation manage their data within these overlays.

Yocto (even with RAUC’s A/B system) doesnt have to be run as immutable root. It’s perfectly fine to have a read/write rootfs and do local package installation. We have explored some possibilities for perhaps automating the reinstallation of local packages after system update so whether we can support this in some way remains to be seen, but it is a goal. Probably this will serve well as a repository of packages or package recipes designed and/or configured specifically for the picocalc hardware.

So bringing Ubuntu (and lots of other software) back into the discussion: my first question is why not containers/podman? We can support persistence in the overlayfs so you could have a persistent ubuntu environment that is about as resource efficient (except for disk space) as it can get. You can pass through all the hardware you want with –privileged or –device. I mean, I’m running builds out of a privileged ubuntu container running in colima on my mac so I already know the UX is pretty good. Honestly I’m going to try this soon. I think we can deliver a better Ubuntu user experience on this limited hardware via Calculinux + Ubuntu container than trying to do ubuntu root anyway. Or am I missing the point?

If you do want to run an ubuntu root, the Calculinux build already builds everything you need; start with the wks image for the sd card; delete partitions 3-6, add ubuntu arm rootfs as partion 3, leave room for 1-2GB swap as partition 4, copy the zboot image into /boot. The only other things you’ll have to do is modify /boot/boot.scr to remove the RAUC stuff, do a static boot of partition 3, and then probably the hardest part of the whole thing – handle the kernel modules and initrd.

3 Likes

Yes his project is excellent! I ran across it looking for other 3rd party kernel work for rk3506. This little chip has some tricks up its sleeve yet. It would be an exciting platform if Rockchip & Luckfox were willing to properly and fully support it. It seems all that is missing is documentation of the registers necessary to restore access to the memory region to the AP after shutting down the MCU. What at unfortunate situation to be stalled in this state. But it’s also par for the course in the SoC world.

1 Like

Wow! good job. Good initiative! Definitely we need a better alternative than buildroot. Yocto it is one of that.. I used it some years ago for some Android Auto alternatives.. I need a refresh, in order to try to help you guys..

1 Like

In other things, in my free time the past weekend I started a GNUChess front end for Luckfox Lyra from scratch:

screenshot20251029_013945

6 Likes

I’m not sure if containers would be the best use of ram - it would limit the ability to leverage shared libraries to decrease duplication in memory. That said if we enable kernel samepage merging, we could possibly regain some of that memory if the libraries used in the containers have enough overlap with those in the base system.

Early development for Armbian on Luckfox Lyra for those that might me interested to follow along

PicoCalc specific drivers would still need to be incl this is the latest vendor kernel

I pushed an alpha release con pre-compiled binaries for Luckfox Lyra. Now, it has basic settings:

1 Like

Would you consider making a Discord group for this effort? I’ve ported Armbian to the Luckfox Lyra (and Luckfox Pico) – as linked by @markbirss. I would love to “cross-pollinate” these projects to make RK3506 a better experience for everyone.

1 Like