
2/11/2020
TS-7100 - Technologic Systems Manuals
https://wiki.embeddedarm.com/w/index.php?title=TS-7100&printable=yes
13/44
arm-linux-gnueabihf-gcc hello-world.c
-o
hello-world
file
hello-world
This will return that the binary created is for ARM. Copy this to the target platform to run it there.
Debian Stretch supports multiarch which can install packages designed for other architectures. On workstations this
is how 32-bit and 64-bit support is provided. This can also be used to install armhf packages on an x86 based
workstation.
This cross compile environment can link to a shared library from the Debian root. The package would be installed
in Debian on the workstation to provide headers and libraries. This is included in most "-dev" packages. When run
on the arm target it will also need a copy of the library installed, but it does not need the -dev package.
apt-get install
libcurl4-openssl-dev:armhf
# Download the simple.c example from curl:
wget
https://raw.githubusercontent.com/bagder/curl/master/docs/examples/simple.c
# After installing the supporting library, curl will link as compiling on the unit.
arm-linux-gnueabihf-gcc simple.c
-o
simple
-lcurl
Copy the binary to the target platform and run on the target. This can be accomplished with network protocols like
NFS, SCP, FTP, etc.
If any created binaries do not rely on hardware support like GPIO or CAN, they can be run using 'qemu'.
# using the hello world example from before:
./hello-world
# Returns Exec format error
apt-get install
qemu-user-static
./hello-world
5.4 Debian Installing New Software
Debian provides the apt-get system which allows management of pre-built applications. The apt tools require a
network connection to the internet in order to automatically download and install new software. The update
command will download a list of the current versions of pre-built packages.
apt-get update
A common example is installing Java runtime support for a system. Find the package name first with search, and
then install it.
root@ts:~# apt-cache search openjdk
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jdk-headless - Standard Java or Java compatible Development Kit (headless)
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
jtreg - Regression Test Harness for the OpenJDK platform
libreoffice - office productivity suite (metapackage)
openjdk-8-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-8-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-8-doc - OpenJDK Development Kit (JDK) documentation
openjdk-8-jdk - OpenJDK Development Kit (JDK)