CLR Run time with Mono .NET Framework on ARM-Linux

Embien has helped customers run their legacy software in new platforms with minimal effort and save significant cost and time. Our team with rich cross-platform experience and domain knowledge can help maintain the product continuity with ease. This case study discusses a case of running .NET application on top of an embedded Linux platform with CLR Run time with Mono .NET Framework on ARM-Linux.

Software Maintenance Challenges

In case of life-cycle of any reliable product, the price of its software development outruns the hardware/system costs eventually. Considering a typical embedded system scenario, the major costs associated with hardware are typically one time – NRE for PCB, prototyping, manufacturing set up followed up typically by the per-unit costs based on the number of units produced. In the software development perspective, though the initial costs cover up most of the development, there is a need for continuous maintenance and updates to retain the market share. Thus the software development is most likely to last for a major chunk of the product lifetime.

Another aspect of a long life product is that the application framework is pretty much fixed and it is not most likely possible to change them after some time. While the customer likes to have the continuity in terms of look and feel, the development team likes to continue in the same technology. In fact, in many cases the application development framework has to be retained for the next iteration/update of the product too. In such cases, the concept of virtual machine comes in handy.

To explain with an example, Java from Sun/Oracle promoted the Write Once, Run anywhere concept of development. An application written in Java can be run on any platform provided the underlying VM is available for that platform. This is made possible by compiling the code to a Java Byte code, rather than the native executable. These byte codes are interpreted by the Java Virtual Machine and internally executed as native code.

Microsoft .NET Compact Framework

Similar to Java, Microsoft has their own architecture called .NET Framework. Just like the JVM, it has a run time environment called the CLR – Common Language Run Time. All the .NET applications, written usually in VB or C#, are compiled to a platform-independent binary which will be run by the CLR in the target processor supported by Framework Class library. For resource constraint embedded platforms, Microsoft has a stripped-down version of the .NET framework called the .NET Compact framework.

The .NET Framework for embedded systems (.NET Compact Framework) is supported on the Windows CE and Mobile devices. It enables application developers to develop the application once and run it in almost all versions of the Windows CE platform. But of late, Microsoft is no longer showcasing an active road map for the Windows CE. More or less, the development stopped in 2013 with Windows Embedded Compact 2013 along with .NET CF 3.9. The Windows 10 IoT released thereafter follows a different approach.

This has left several devices in the field and their successors in a lurch. Without Microsoft road map, it will not be possible to develop new devices running Windows CE. Programmers who have been working on embedded devices with .NET have to update themselves and re-write the whole application in a new framework. But this is going to be a lot of work. There may be many legacy applications, which needed to be run on the new hardware, without changes, especially in the industrial segments.

Porting .NET Applications

There are two approaches possible to overcome the problem of depreciation of .NET for embedded devices by Microsoft.

  • Porting/Rewriting to a new application framework
  • Enabling CLR Run time in other platforms

The first approach is recommended for UI heavy applications where it is better to re-write the application for the new platform. With processors and memory getting powerful and cheaper, Android has undoubtedly become a market leader. For lower-end platforms, smaller libraries such as Sparklet UI Library are ideal. Embien, with its highly experienced application development team, can do a re-write optimized for the new platform and keeping the design philosophy intact.

Second option, suitable for UI light applications, is to enable the .NET framework in the underlying platform. The most used way is to port Linux to the same and run it on a cross-platform library such as Mono or Portable.NET.

Mono .NET Framework on ARM-Linux

Of these, Mono suits the job better. Apart from a sleek design and continuous maintenance, other advantages are that it is completely open-source and has free licensing options. Embien has experience enabling various .NET applications on top of Mono. We have enabled Mono on top of Linux running on Allwinner A20, PXA270, iMx6UL platforms as well. Effectively the legacy applications can be run on the new platform with less effort.

Of late, for a customer request to run their legacy .NET application on the new hardware, we chose Mono. The Linux OS is ported on to the platform and the Mono library ported for it. The application was run on CLR Run time with Mono .NET Framework on ARM-Linux. We also exported some of the platform-specific functionality as libraries and made it available over .NET. Thus the customer can extend the functionality as well in their .NET application. The whole system is hardened for product grade operation with thorough testing. Complete source code is delivered to the customer for further development and support.

Thus the application developers can be in their comfort zone while the underlying challenges are addressed by Embien’s team. Feel free to get in touch to enable/port your legacy application porting or .NET Framework for embedded system on to newer product lines.

Reach us