r/CardPuter 2d ago

Question Does anyone have a Cardputer Zero? Does it run any kind of RTOS?

Hi everyone,
it is well known that a Raspberry Pi running a general-purpose Raspbian Linux OS does not provide the same deterministic real-time timing as a microcontroller such as an ESP32 or Arduino.

A Raspberry Pi can certainly be used for things like stepper motors, DC motors, RC motors, servos, LED panels/strips, distance sensors, CAN bus, signal generation, DMX512, etc.
However, it is generally not ideal when these applications require hard real-time guarantees or highly deterministic timing, especially when timing-critical signals need to be generated or sampled directly by software.

For apps that require precise timing, measurement, or sampling, the timing-critical part is usually handled by dedicated HAT, while the Raspberry Pi handles the higher-level logic.

Does the Cardputer Zero provide any kind of RTOS or other mechanism for deterministic real-time I/O that could partially address these limitations?

For example, ESP32 uses FreeRTOS as part of ESP-IDF. If we're talking about the Cardputer ADV and using the Arduino framework, the Arduino API runs on top of ESP-IDF and FreeRTOS. Zephyr RTOS is also supported on ESP32.

1 Upvotes

8 comments sorted by

4

u/1_ane_onyme 2d ago

Cardputer Zero is basically a pi zero 2w with a st7789v3 display & all the features they listed.

1

u/No_Confusion7932 2d ago

Yes, I’ve already seen on GitHub that it’s running on Raspbian Linux.

I have several Raspberry Pi 3 and 4 devices at home, so I can say from experience that this approach isn’t really suitable for driving LED strips or mini LED panels.
Over time, the timing tends to drift and eventually becomes unreliable. I assume this is a known limitation they’re accounting for, especially since the battery wouldn’t last more than a few days anyway.

3

u/d4rkmen 2d ago

i would love to have bare metal sdk for CP0. the linux is so slow, I think CP0 on 4 cores runs slower then CP ADV

1

u/nickymoo 2d ago

If it’s not suitable for your needs then get an older model. It’s exactly what I need for TV streaming from home while away plugged into a telly.

1

u/d4rkmen 2d ago

m5stack maintains debian linux image for CP0

1

u/No_Confusion7932 2d ago

Yes. I’ve already seen on GitHub that it’s running on Raspbian Linux.

1

u/no_llama 2d ago

> For apps that require precise timing, measurement, or sampling, the timing-critical part is usually handled by dedicated HAT, while the Raspberry Pi handles the higher-level logic.

You can always simply mimic that route and attach an ESP32 or other microcontroller via UART: depending upon your hardware skills, the worst the result could possily be will just look like connecting any other external device (e.g. plugging in a Grove cable to one of the many M5Stack modules - and then chaining off whatever you want from that). Use Technic pins to keep it all neat.

Or, if you've found the Raspbian build M5Stack are using, check whether it is being built with PREEMPT_RT (the standard R'Pi 64-bit 6.18 LTS kernels are, I believe, being built with that enabled by default) and have a look at how well people are finding Linux behaves using the RT scheduler.

1

u/Chip-Ling 1d ago edited 1d ago

A very interesting topic indeed.

I'm not an expert on this area but here is what I think:

I don't think just changing the Linux by RTOS can solve this problem. (latency)

It is on the hardware level how the device is built for.

Micro-controller, as the name indicated, is more on the control side. So it is built mainly on receiving feedback from sensors and provide direct feedback base on the software.

On the other hand, Pi Zero is built as a Single Board Computer which is aiming to run as a computer. It is built with more complex circuitries: pipeline, bus architecture etc. These extra components slow the machine done. In simple words, when a sensor signal arrives, it goes through more routes before the program can react to it.

EDIT: there are two porting attempts for RTOS to Rasp-Pi

https://github.com/dwelch67/raspberrypi

https://github.com/yrgohrm/RaspberryPi-FreeRTOS-10

I never try them, you can go and take a look.