Linux buildroot quick-start with .NET and Avalonia UI

Linux buildroot quick-start with .NET and Avalonia UI

Using .NET SDK and a cross platform user interface framework like Avalonia UI enables cross platform development for multiple platforms. While the process is well-known and straightforward on Windows, configuring an embedded target is a bit more complicated.

To simplify the process, we supply a starter project at https://github.com/TiMaMi-GmbH/buildroot-external-timami.

The repository contains a project tree with board configurations for STM32MP1 and Raspberry Pi with additional packages. With these packages you can create:

Avalonia UI is a cross platfrom user interface framework for .NET.

What exactly is it doing?

The repository provides a buildroot BR2_EXTERNAL tree dedicated to supporting .NET on various platforms. This BR2_EXTERNAL tree also provides example configurations demonstrating how to use .NET on the STM32MP1 platform and on Raspberry Pi 3.

BR2_EXTERNAL is a way to customize Buildroot for a project without altering buildroot itself. You can read more about this topic in the official buildroot mirror on gitlab (HERE).

Getting started

You can find the instructions on how to set up the included example configurations HERE

Contents

Configuration Examples

Basic configurations activating the full ASP.NET framework package and an Avalonia UI example application for following boards:

Package .NET runtime

This package downloads the .NET version 7.0.14 runtime from the official Microsoft homepage and installs it into your buildroot image so you can use the dotnet command on your command line.

This package supports the following platforms:

  • linux-musl-x64
  • linux-x64
  • linux-arm
  • linux-musl-arm64
  • linux-arm64

Package ASP.NET runtime

This package downloads the ASP.NET version 7.0.14 runtime from the official Microsoft homepage and installs it into your buildroot image so you can use the „dotnet“ command on your command line. The runtime from Microsoft already contains the full .NET runtime, so you can install only one of the two packages.

This package supports the following platforms:

  • linux-musl-x64
  • linux-x64
  • linux-arm
  • linux-musl-arm64
  • linux-arm64

Package Avalonia example

This package contains an example of an Avalonia UI cross-platform application. The application will be installed into the „/opt/“ directory of your Buildroot image. And will be set to automatically start upon boot. The application will run on a framebuffer device, so no desktop environment needs to be installed. The downside is, that there is no support for mouse or keyboard on Avalonia framebuffer applications right now, so you need to have a touchscreen attached to your device to actually interact with the application. When started from a desktop framework like X11 you will have full support for mouse and keyboard.

This application supports the following platforms:

  • linux-musl-x64
  • linux-x64
  • linux-arm
  • linux-arm64