This base project is designed to provide a quick and platform independent method of building projects for Silicon Labs EFM32 microcontrollers.
Designed and tested on OSX and Debian. Windows might work with cygwig/mingw/gnuwindows tools, but hasn't been attempted.
If you have any issues, suggestions or alterations, feel free to open an issue or a pull request.
This project addresses this by providing a common base for for projects using Silicon Labs EFM32, EZR32 and EFR32 processors.
If you're not into cmake, you might want to check out ARM Mbed Yotta or PlatformIO, both of which offer higher level approaches to embedded setup/development.
If you're into docker, check out ryankurte/docker-arm-embedded for a containerised toolchain. You will still need JLink tools locally to flash and debug.
This project can either be used directly or as a submodule in a larger project.
Note that submodule use will allow updates to this project for fixes or further device support.
For an example project using this method, see ryankurte/usb-thing.
git submodule add https://github.com/ryankurte/efm32-base.git
git submodule update
Once you have integrated this project with your project, you can build in the standard cmake manner.
mkdir build
to create the build directorycd build
to switch to the build directorycmake ..
to configure the buildmake
to execute the buildmake flash
to flash to a deviceWhen configuring the build, you may want to define (either in CMakeLists.txt
or using the -D
flag) the variables DEVICE
, FLASH_ORIGIN
, FLASH_LENGTH
, RAM_ORIGIN
and RAM_LENGTH
. If not defined, the build will use the default memory addresses and sizes for the FLASH and RAM regions defined in the Silicon Labs provided linker script for your device (these are usually 0x00000000
and 0x20000000
for flash start and RAM start, respectively).
Debugging using a Segger J-Link device (as is present on the Silicon Labs evaluation boards) requires two processes, a GDB server that connects to the target and provides a local interface as well as a GDB instance that connects to this interface. As such, you have to run two terminal sessions and swap between a bit to use this.
make debug-server
or make ds
from the first session to start the debug server and connect to the targetmake debug
or make d
from the second session to launch GDB in Terminal User Interface (TUI) modeYou can then use the GDB interface to interact with the running application.
cmsis
, device
, drivers
, emdrv
and emlib
folders from the SDK into this repo..cmake
files through the repo to fix any new naming inconsistencies (ie. EFM32G210F128
vs. EFR32FG13P231F512GM48
until all the tests build again.Since this is a combination of a number of Silicon Labs (ex. Energy Micro) components, as well as custom additions, licensing is a little interesting. A summary of the licenses involved follows, but I take no responsibility for the accuracy or interpretation of such.
The CMSIS Core falls under a fairly permissive ARM license. This requires that the license requires the copyright and license note to be distributed in the documentation accompanying binary distribution, and that the name ARM LIMITED may not be used to promote any products derived from this without written permission.
The device and emlib components fall under the above ARM license (startup files) as well as a permissive Silicon Labs license. This allows use, alteration and distribution for any purpose provided the origin of the source is not represented, altered versions are plainly marked, and the notice is not removed from the source distribution.
Drivers are covered by the Silabs License Agreement. This is similar to the the license above, however prohibits sublicensing the included code and use of the code on non-silabs devices.
The CMake components of this project are distributed under the MIT license.
What does all this mean?