Is it possible to compile and run C code directly on PicoCalc?

I’m wondering if it’s possible to go through the entire development process — writing, compiling, and running C code — all on the PicoCalc itself, without needing cross-compilation from another device.

I’ve looked through the Fuzix source and wiki but couldn’t find any clear information about this. Has anyone tried this or know if it’s feasible?

Fuzix and the Luckfox Lyra port of of Linux are both complete(?) operating systems. I don’t know much about either, but if they have a C compiler, you should be able to at least build small simple utilities. Beyond that, the answer is no, you need to cross compile from another device to build the uf2 images which are then flashed to the Pico. I suppose hypothetically, someone could port a C interpreter like Cling or CINT to run similarly to how PicoMite, uLisp or MicroPython run on the PicoCalc.

I have been developing on the Luckfox Lyra which includes vi, gcc, headers for SDL… It is fun. You have to copy documentation on it if you really want to be independent from other devices (or make a wifi addon work).

I haven’t seen a working compiler toolchain on smaller devices like the pico2, maybe Fuzix can do that, but optimizing compilers require ram, probably more than 500k.

2 Likes

This could be a fun thing if someone were to adapt it for the device.

4 Likes

This is so cool. No time now, but I will look into it.

1 Like

That would be great. Unfortunately, I don’t have enough experience doing something like that.
But it would be awesome if that would work on picocalc.

Gave pshell a try. It compiles but I get nothing though uart / usb. I will need to find a solder iron to add those SWD debug pins to my pico2…

1 Like

I tried the precompiled uf2 file on a pico 2. I can connect via minicom over USB. And it works great (shell-commands, vi, cc, …). But I have no clue how to integrate the display driver or keyboard driver and make it work on picocalc.

2 Likes

Fuzix at the moment only supports compiling stuff natively on a few targets and needs under 64K but it’s very much early days. At the moment there isn’t an ARM target for the fcc compiler but it would in theory be easy to produce a bad compiler. A good one would need some work.
It’s certainly theoretically possible to do. CP/M had a non C friendly CPU architecture and native compilers. ARM is a much more C friendly architecture.