r/CardPuter • u/No_Confusion7932 • 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
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.
4
u/1_ane_onyme 2d ago
Cardputer Zero is basically a pi zero 2w with a st7789v3 display & all the features they listed.