23

I purchased a Human Machine Interface (Exor Esmart04). Running on Linux 3.10.12, however this Linux is stripped down and does not have a C compiler. Another problem is the disk space:

disk-space-snip

I've tried to install GCC on it but I do not have enough disk space for this, does anyone have other solutions or other C compilers which require less disk space?

  • 7
    Welcome to the site. Although it is not a real issue in this case, please try to avoid pasting screenshots of text. Rather copy-and-pase the text with appropriate markup; this will make reproducing problems easier for contributors wanting to help. – AdminBee Dec 11 '19 at 8:59
  • Something like this. Assumes you have a Linux PC... – xenoid Dec 11 '19 at 9:18
  • 2
    I would definitely go for the cross compilation. But have you tried the default c compiler: cc --version stackoverflow.com/a/1516658/1392758 – RSFalcon7 Dec 11 '19 at 12:01
  • 1
    why don't you put the exact name and specs of your device in the question? – Uncle Billy Dec 11 '19 at 23:23
  • 2
    @IkWeetHetOokNiet - HMI or MMI (Man-Machine Interface) is an old term referring to UI, ergonomics and user flow. These days we call it UX but there are still people who design kiosks, ticket machines, turnstiles, excavators, electric skateboards etc. who still call it HMI because the UX community don't talk about throttle pedals, coin slots etc. HMI includes not just the UI but the keyboard, the on/off button, should the machine have a touch screen or would physical buttons be better etc. which in theory would be UX – slebetman Dec 12 '19 at 4:08
63

Usually, for an embedded device, one doesn't compile software directly on it. It's more comfortable to do what is called cross-compilation which is, in short, compiling using your regular PC to another architecture than x86.

You said you're new to Linux; just for your information, you're facing a huge problem: cross-compiling to embedded devices is not an easy job.

I researched your HMI system and noticed some results that are talking about Yocto. Yocto is, in short, a whole framework to build firmware for embedded devices.

Since your HMI massively uses Open Source projects (Linux, probably busybox, etc.) the manufacturer must provide you a way to rebuild all the open source components by yourself. Usually, what you need to do that is the BSP (Board Support Package). Hardware manufacturer usually ship it:

  • Using buildroot project that allows you to rebuild your whole firmware from scratch.
  • Using yocto meta that, added to a fresh copy of the corresponding yocto project, will allow you to rebuild your whole firmware too.
  • More rarely, a bunch of crappy scripts and pre-built compiler.

So, if I was you, I would:

  1. Contact the manufacturer support to ask for the stuff to rebuild the firmware as implied by the use of Open Source.
  2. In parallel, search Google for "your HMI + yocto", "your HMI + buildroot", etc.

After Googling even more, I found out a Yocto meta on github.

You can check the machines implemented by this meta upon the directory conf/machine of the meta.

There's currently five machines defined under the following codenames:

  • us01-kit
  • us02-kit
  • us03-kit
  • usom01
  • usom02

So I suggest that you dig into this. This is probably the way you can build software by yourself. You can also check this page on the github account that may give you some more clues.

  • More resources like DevKit manuals, VirtualBox development VMs, SDcard images etc. can be found here. Also "Compiling Yocto BSP from scratch" and the deployment instructions (Exor-EvaluationKit-UserManual-v1.10.pdf, p.11) might be interesting. – Freddy Dec 12 '19 at 4:21
  • 9
    Cross-compiling user-mode (application) code for embedded devices is actually a relatively simple job. All you need to do is find a cross-compiler that targets your architecture, and GCC pretty much has you covered for all of the common embedded devices, especially considering that an overwhelming number of them are just ARM-based Linux machines. You don't need the BSP or anything else to build application code. Now, if you want to compile the system/kernel, you definitely do, and it becomes a bit trickier. But it's unlikely to need to do that; the embedded device probably came with it. – Cody Gray Dec 12 '19 at 4:52
  • @CodyGray you're right ... nevertheless, one need to be cautious regarding compiler and headers (libraries + kernel) version mistmatch. It may leads to erroneous behaviour ... That i would recommand working with a system like Yocto/Buildroot, especially if the BSP is provided by the manufacturer. – binarym Dec 12 '19 at 9:49
  • 2
    Cross-compiling doesn't have to be for a different ISA; just a different ABI, library headers/versions, or executable file format, for the same ISA is still cross compiling. e.g. using my x86-64 Linux desktop to run x86_64-w64-mingw64-gcc to make x86-64 Windows .exe executable (PE format, not ELF) is very much cross compiling; I could only run those executables under Wine or by dual-booting, or on a separate Windows PC. – Peter Cordes Dec 13 '19 at 10:55
3

I agree with binarym's answer regarding cross-compiling. However, if one still wanted to compile directly on a machine with such conservative hardware, I would recommend taking a look at smaller compiler such as the Tiny C Compiler (tcc) which takes up approximately 100KB on x86 architecture. I will point out, however, that it extends support only up to ISO C99, not C11.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.