BalenaFin Co-Processor Base
Please be aware that this is currently under beta-release.
This base project is designed to provide a quick and platform independent method of building projects for the balenaFin coprocessor.
Dependencies
- cmake
- make
- arm-none-eabi-gcc
- JLink
Usage
This project can either be used standalone or as a submodule, for example see balena-fin-coprocessor-firmata.
Standalone
- Download this repository
- Change the project name and device in the CMakeLists.txt file
- Move source and include files into the src and inc directories
- Add source files to the CMakeLists.txt file
Submodule
- Add the submodule to main project using:
git submodule add https://github.com/balena-io-playground/balena-fin-coprocessor-base.git
git submodule update
- Copy the CMakeLists.txt file from this project (balena-sdk) to the top level of the main project
- Update the project name and BASE_LOCATION variables in the new CMakeLists.txt
- Add source files (and cmake libraries) to the CMakeLists.txt file
Building
To build the project, the following flow can be used:
make setup
make balena
cd builds/balena
make flash
When configuring the build, (either in CMakeLists.txt
or using the -D
flag) the variables such as DEVICE
, FLASH_ORIGIN
, FLASH_LENGTH
, RAM_ORIGIN
and RAM_LENGTH
can be defined. If not defined, the build will use the default memory addresses and sizes for the FLASH and RAM regions specified in the Silicon Labs provided linker script for the selected device.
Debugging
Debugging using a Segger J-Link device (such as on Silabs Dev Kits) 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. Open two terminal sessions and run:
make debug-server
ormake ds
from the first session to start the debug server and connect to the targetmake debug
ormake d
from the second session to launch GDB in Terminal User Interface (TUI) mode
This can then be used with the GDB interface to interact with the running application.
Updating
Add devices / Update the SDK:
- Grab the Silabs Gecko SDK (likely will need to download Simplicity Studio and extract this).
- Copy the
cmsis
,device
,drivers
,emdrv
andemlib
folders from the SDK into this repo. - Add provide entry point for building specified device, i.e.
make bgm111
- Add fixes to the
.cmake
files through the repo to correct any new naming inconsistencies (ie.EFM32G210F128
vs.EFR32FG13P231F512GM48
. - Open a PR against the
master
Licensing
TBD - pending Silabs license query.
Based on efm32-base under MIT license.