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?

muru
  • 69,900
  • 13
  • 192
  • 292
NielsStenden
  • 345
  • 2
  • 7
  • 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](https://unix.stackexchange.com/help/formatting); this will make reproducing problems easier for contributors wanting to help. – AdminBee Dec 11 '19 at 08:59
  • Something like [this](https://www.acmesystems.it/arm9_toolchain). Assumes you have a Linux PC... – xenoid Dec 11 '19 at 09:18
  • 2
    I would definitely go for the cross compilation. But have you tried the default c compiler: `cc --version` https://stackoverflow.com/a/1516658/1392758 – RSFalcon7 Dec 11 '19 at 12:01
  • The Exor Esmart 04 uses, according to the data sheet, an ARM processor and Linux 3.12. This processor is similar to the Raspberry pi, and Raspbian used the same same kernel version from 2014-06 to 2014-12. Chances are very good that you can just copy a binary from those Raspbian versions over, or compile your software on a Raspi. I used this method successfully with various other ARM-based devices. – Guntram Blohm Dec 11 '19 at 19:23
  • 1
    why don't you put the exact name and specs of your device _in the question_? –  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 04:08
  • If this thing have a USB port.... – user3528438 Dec 13 '19 at 05:28
  • Note that the answer to this was actually touched upon in a question comment to your first question on 2019-12-09. https://unix.stackexchange.com/q/556315/5132 – JdeBP Dec 13 '19 at 17:17

2 Answers2

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.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
binarym
  • 2,639
  • 9
  • 12
  • More resources like DevKit manuals, VirtualBox development VMs, SDcard images etc. can be found [here](http://download.exorembedded.net:8080/Public/). Also "Compiling Yocto BSP from scratch" and the deployment instructions ([Exor-EvaluationKit-UserManual-v1.10.pdf](http://download.exorembedded.net:8080/Public/DevKit_manual/Exor-EvaluationKit-UserManual-v1.10.pdf), p.11) might be interesting. – Freddy Dec 12 '19 at 04: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 - on strike Dec 12 '19 at 04: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 09: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.