Skip to content


First Build.

Assuming the development environment is set up correctly, it is time to perform a first build.

Make

  • Open a terminal and get into the embedul.ar framework main directory, for example, “cd ~/embedul.ar”.
  • Run a build with default parameters using make: “log_hello_world” example for the “native_hosted” target (your PC).

cd ~/embedul.ar

make

The output from make should resemble the image on the left. Last line should read “[LD] build/binary/native_hosted/gcc/debug_generic_O0/embedul.ar.elf” which implies the executable is now built.

Compilation database

Some integrated development environments consult a compilation database stored in the “compile_commands.json” file to learn how the compiler built the source code and to highlight code accordingly. A tool called Bear intercepts Make commands and creates that database. Therefore, we recommend using “bear” when building the code, as follows:

bear -‌‌- make

The command builds normally, generates the same output as before, but also updates the compilation database.

Running the example

The embedul.ar framework stores each build inside a “./build” directory containing further sub-directories representing build parameters: compiler, platform, processor core, debug information or optimization level, etc. Since make already knows this information, it is easier to call make itself to execute the right program, as follows:

make run

You should see output resembling the sample image on the left.
Note that “make run” works for the “native_hosted” target only.

Success!

Let’s learn about using VSCodium to develop embedded systems.

If something goes wrong…

Perform the following checks and see if your outputs match the examples below running on a Debian 11 distribution.
Your utilities may be newer.

Troubleshooting

Git, Make, Bear, or GCC command(s) not found? Install required system tools.

LIB_EMBEDULAR_PATH environment variable empty or undefined? Define LIB_EMBEDULAR_PATH.

git -‌-version

git version 2.30.2

make -‌-version

GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

bear -‌-version

bear 3.0.8

gcc -‌-version

gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$LIB_EMBEDULAR_PATH

bash: /home/royconejo: Is a directory

Still not working?

Visit the Support Q&A.
When writing your question, please paste all checked command outputs as seen on your PC.