Codal target for the STeaMi programming board. Codal comprises the core set of drivers, mechanisms and types that form the runtime for a board in Makecode.
The codal runtime, developed by Lancaster University, provides an easy-to-use environment for programming the board in the C/C++ language. It contains device drivers for all the hardware capabilities, and also a suite of runtime mechanisms to make programming easier and more flexible. These range from control of the LED matrix display display control to peer-to-peer radio communication and secure Bluetooth Low Energy services.
Besides supporting development in C/C++, the runtime is specifically designed specifically to support higher level languages targeting physical computing and computer science education. It is currently used as a support library for Microsoft MakeCode
Codal-core must be implemented by third party developpers to support new hardware target.
STeaMi is a STM32 microcontoller-based programming board tailored for the classroom. STeaMi is designed for projects that use a ton of sensors, all built-in!
You can explore your world, measure, log and learn! Transmit data over Bluetooth to a computer or mobile device for data plotting and logging, or save it for later use.
- STM32WB55 Application Processor
- Bluetooth Wireless Communication
- Tact momentary push buttons
- Circular display
- Motion sensors
- Environemental sensors
- Light sensors
- Distance and gesture sensor
- Power supply management
- USB Serial Communications
- Flash memory
- Expansion connectors:
- micro:bit edge connector
- Jacdac connectors
- Qwiic/STEMMA connectors
- Additionnal Croc connectors
Install all dependencies for cross compiling on a programming board could be a tedious (and time consuming) experience. To allows developers to benefit from a consistent experience when writing, compiling, and debugging their code for Codal we create an additionnal repo called codal-letssteam. To use it follow this steps :
-
Clone the repository:
git clone https://github.com/letssteam/codal-letssteam.git cd codal-letssteam
-
Open with VSCode:
- Open VSCode.
- Open the file
codal-letssteam.code-workspace
and click onOpen Workspace
button. - Choose the "Open in a Dev Container" option to automatically configure the environment.
-
Use build tasks:
- Use the tasks defined in the Makefile to compile and deploy your program.
Before using this target, you need to configure your platforms with software. Codal is also a build system to simplify as much as possible the experience of novice users, so the steps are simple:
- Install
git
and ensure it is available on your platforms path. - Install the
arm-none-eabi-*
command line utilities for ARM based devices and ensure they are available on your platforms path. - Install CMake(Cross platform make). CMake is the build system that handle all the compilation and configuration.
- Install
Python
(if you are unfamiliar with CMake). Python scripts are used to simplify the build process and hide CMake. - Clone the repository https://github.com/lancaster-university/codal
- Create a
codal.json
file :{ "target": { "name": "codal-stm32-STEAM32_WB55RG", "url": "https://github.com/letssteam/codal-stm32-STEAM32_WB55RG", "branch": "master", "type": "git", "test_ignore": true } }
- In the root of the codal repository type
python build.py -c
the-c
option cleans before building. - The bin file
STM32.bin
will be placed at the location specified bycodal.json
, by default this is the root. - To test the sample program, you can just copy the binary file in the mass storage of the board.
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-stm32-STEAM32_WB55RG",
"url": "https://github.com/letssteam/codal-stm32-STEAM32_WB55RG",
"branch": "master",
"type": "git",
"test_ignore": true
},
"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.
By default, the application present in the source
directory is the content of the samples
directory of this repository. Since you can just execute one example at the time, you need to configure your target to specify the one you want.
For example, if you want to test the BLE_TEMPERATURE_ALARM_SAMPLE
, you need to configure the corresponding #define
with the following codal.json
:
{
"target": {
"name": "codal-stm32-STEAM32_WB55RG",
"url": "https://github.com/letssteam/codal-stm32-STEAM32_WB55RG",
"branch": "master",
"type": "git",
"test_ignore": true
},
"config": {
"BLE_TEMPERATURE_ALARM_SAMPLE": 1
},
"application": "source",
"output_folder": "."
}