ifm CR1140 Rust HAL & SDK
Open Source, Rust, C#, Embedded, HMI, CAN

ifm CR1140 Rust HAL & SDK

Native Rust hardware abstraction layer and SDK for the ifm CR1140/CR1141 ecomatDisplay — run your own application in place of the stock CODESYS runtime.

Description

The ifm CR1140 / CR1141 (ecomatDisplay 4.3″) is a rugged operator display built around an NXP i.MX 8M Nano (aarch64) running Yocto Linux. It ships with a CODESYS runtime. cr1140-hal is a native Rust hardware abstraction layer that lets you build and run your own application in place of that runtime — full control of the panel, no CODESYS in the loop.

What it exposes:

  • Display: a stride-aware xRGB8888 Surface with copy_from blit, plus an fbdev/linuxfb FbDisplay (800×480, format-checked, optional double buffering and backlight blanking).
  • Input: evdev keypad decoding — InputEvent into Button/ButtonEvent, with by-name device discovery and epoll-friendly file descriptors.
  • CAN: a CanBus over SocketCAN (open / send / receive).
  • System: a typed LED enum, backlight control, SoC temperature, and other sysfs-backed device access.
  • Persistent storage: a retain store that survives reflashes, using the device’s writable overlay partition and factory EEPROM.

Two UI stacks sit on top of the HAL. On the Rust side, cr1140-sdk (run loop, telemetry, config, persistence) drives Slint demo apps, cross-compiled statically for aarch64 with cargo-zigbuild. On the .NET side, Cr1140.Avalonia is an Avalonia LinuxFramebuffer/DRM support library — published as a NuGet package — providing evdev keypad input, a SoftKeyFooter control, rotating fbdev and tear-free DRM/KMS output backends, onboard-LED control, and a system-telemetry API; an Avalonia demo app renders straight to /dev/fb0, and a desktop emulator (Cr1140.Avalonia.Emulator) runs that same app in a device-bezel window on a dev host. Reversible deploy scripts disable and mask the CODESYS service — with a tested path back to stock.

GitHub: https://github.com/uptux/ifm-cr1140

Used Tools and Technologies

  • Rust
  • C# / .NET
  • Avalonia
  • NuGet
  • Slint
  • SocketCAN
  • Linux framebuffer / DRM/KMS / evdev / sysfs
  • NXP i.MX 8M Nano (aarch64)
  • Yocto Linux
  • cargo-zigbuild