34
edits
No edit summary |
No edit summary |
||
As of time of writing, we use two MCUs: an STM32G0B1RE, and an STM32G431CB. Both of them use a 32-bit ARM CPU, so that is our target architecture. Arm and other companies use a standardized ABI for their embedded processors, called the '''Embedded ABI''' (EABI), and that is the ABI we use. Thus, the name of our compiler is <code>arm-none-eabi-gcc</code> (and now you know where the name comes from).
=== Downloads for Our Board ===
We first need higher-level tools that help automate the compilation of any C or C++ program. To do this, run the command
<code>sudo apt install make cmake</code>
<code>make</code> is a program that adjudicates what files need to be compiled, determined by whether they were changed or not. If you are working on a project with thousands of files that takes maybe 10 minutes to compile, you really don't want to sit around and wait for the whole program to recompile if you just add one print statement in a random file somewhere for example. It turns out that all you have to do is recompile that source file, and then re-link everything, which might take a couple seconds to do. While we won't be working with a codebase that large, <code>make</code> has a bonus side effect of making compiling more "scriptable", meaning that rather than manually type out a bunch of flags for the compiler every time I want to recompile, I can just type it all out once in a Makefile (the file that contains the instructions for <code>make</code> to follow), and call <code>make</code>.
<code>cmake</code> is a program that builds Makefiles for <code>make</code> to call. It is simply another layer of abstraction that, in a sense, makes <code>make</code> more readable and easier to edit. We may use <code>cmake</code> later on for building some projects.
|
edits