The main repository for the Component Oriented Device Abstraction Layer (CODAL).
This repository is an empty shell that provides the tooling needed to produce a bin/hex/uf2 file for a CODAL device.
This software has its grounding on the founding principles of Yotta, the simplest install path would be to install their tools via their handy installer.
A docker image is available that contains toolchains used to build codal targets. A wrapper Dockerfile is available that can be used to build your project with ease.
Then follow the build steps listed below.
- Install
git
, ensure it is available on your platforms path. - Install the
arm-none-eabi-*
command line utilities for ARM based devices and/oravr-gcc
,avr-binutils
,avr-libc
for AVR based devices, ensure they are available on your platforms path. - Install CMake(Cross platform make), this is the entirety of the build system. 5. If on Windows, install ninja.
- Install
Python 2.7
(if you are unfamiliar with CMake), python scripts are used to simplify the build process. - Clone this repository
-
Generate or create a
codal.json
filepython build.py ls
lists all available targetspython build.py <target-name>
generates a codal.json file for a given target
-
In the root of this repository type
python build.py
the-c
option cleans before building.- If you are not using python:
- Windows:
- In the root of the repository make a build folder.
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja
- Mac:
- In the root of the repository make a build folder.
cd build
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo
make
- Windows:
- If you are not using python:
-
The hex file will be placed at the location specified by
codal.json
, by default this is the root.
Below is an example of how to configure codal to build the codal-circuit-playground target, example applications will automatically be loaded into the "source" folder:
{
"target":{
"name":"codal-circuit-playground",
"url":"https://github.com/lancaster-university/codal-circuit-playground",
"branch":"master",
"type":"git"
}
}
For more targets, read the targets section below.
If you would like to override or define any additional configuration options (#define's
) that are used by the supporting libraries, the codal build system allows the addition of a config field in codal.json
:
{
"target":{
"name":"codal-circuit-playground",
"url":"https://github.com/lancaster-university/codal-circuit-playground",
"branch":"master",
"type":"git"
},
"config":{
"NUMBER_ONE":1
},
"application":"source",
"output_folder":"."
}
The above example will be translate "NUMBER_ONE":1
into: #define NUMBER_ONE 1
and force include it during compilation. You can also specify alternate application or output folders.
To obtain a full list of targets type:
python build.py ls
To generate the codal.json
for a target listed by the ls command, please run:
python build.py <target-name>
Please note you may need to remove the libraries folder if your previous build relied on similar dependencies.
This target specifies the arduino uno which is driven by an atmega328p.
"target":{
"name":"codal-arduino-uno",
"url":"https://github.com/lancaster-university/codal-arduino-uno",
"branch":"master",
"type":"git"
}
This target depends on:
- codal-core provides the core CODAL abstractions
- codal-atmega328p implements basic CODAL components (I2C, Pin, Serial, Timer)
This target specifies the BrainPad which is driven by a STM32F.
"target":{
"name":"codal-brainpad",
"url":"https://github.com/lancaster-university/codal-brainpad",
"branch":"master",
"type":"git"
}
This target depends on:
- codal-core provides the core CODAL abstractions
- codal-mbedos implements required CODAL basic components (Timer, Serial, Pin, I2C, ...) using Mbed
This target specifies the circuit playground which is driven by a SAMD21.
"target":{
"name":"codal-circuit-playground",
"url":"https://github.com/lancaster-university/codal-circuit-playground",
"branch":"master",
"type":"git"
}
This target depends on:
- codal-core provides the core CODAL abstractions
- codal-mbed implements required CODAL basic components (Timer, Serial, Pin, I2C, ...) using Mbed
- codal-samd21 implements SAMD21-specific components (such as USB)
- mbed-classic is a fork of mbed, used by codal-mbed