Home

Awesome

Nodate (野点)

A light-weight framework for STM32 and other architectures written in C++ and Ada.

Overview

STM32

Supported boards:

 MCUBoardsBoard name
F0   
 STM32F042K6TNucleo-F042K6nucleo-f042k6
 STM32F051R8TSTM32F0-Discoverystm32f0-discovery
 STM32F072C8Tx'Otter Pill'otter_pill
F1   
 STM32F103C8'Blue Pill'blue_pill
 STM32F103CBMaple Minimaple_mini
F3
 STM32F334R8Nucleo-F334R8nucleo-f334r8
F4   
 STM32F407VGTSTM32F4-Discoverystm32f4-discovery
 STM32F411CEWeAct MiniF4 ('Black Pill')black_pill_f411
F7   
 STM32F746ZGNucleo-F746ZGnucleo-f746zg
L4
 STM32L432KCNucleo-L432KCnucleo-l432kc
 STM32L433CCTFox Pillfox_pill

Usage

Nodate can be installed in any location, with the only requirement being that the environment variable NODATE_HOME is set to the root of this location.

Examples on how to use Nodate can be found in the arch/stm32/cpp/examples folder. The basic structure of a Nodate project consists out of a Makefile and a source folder. This Makefile defines the project properties and target architecture, board or processor. E.g. the user-editable part of the 'Blinky' example's Makefile'

ARCH ?= stm32

# Target programming language (Ada, C++)
NDLANGUAGE ?= cpp

# Board preset.
BOARD ?= nucleo-f042k6

# Set the name of the output (ELF & Hex) file.
OUTPUT := blinky	

# Add files to include for compilation to these variables.
APP_CPP_FILES = $(wildcard src/*.cpp)
APP_C_FILES = $(wildcard src/*.c)

# Set Nodate modules to enable.
# Available modules:
# ethernet, i2c, gpio, interrupts, timer, usart
NODATE_MODULES = gpio timer

# Set library modules to enable.
# library name matches the folder name in libs/. E.g. freertos, LwIP, libscpi, bme280
NODATE_LIBRARIES = 

When running make in the folder with the project Makefile, the project's .map, .elf and .bin files will be written to the /bin/ sub-folder. Use make clean to remove any build files.

In order to flash the target board, ensure that OpenOCD is installed, then run make flash.

Dependencies

Nodate-STM32 requires make and the arm-none-eabi GCC toolchain to be installed for compilation, and OpenOCD for flashing boards.

For Ada, use the STM32 toolchain from AdaCore.

Implemented features

The following functionality has been implemented on the C++ side:

In progress:

AVR & Others

The current version has been tested with the following boards:

Usage

Nodate can be copied to any location, with the environment variable NODATE_HOME set to this location so that it can be found later on.

Take a look at the Blinky example in the examples/ folder to get an idea of how Nodate is meant to be used. Essentially one can use Nodate as one would use Arduino, using the same API calls. Main differences include having to handle one's own includes, such as:

After adapting the example's Makefile for one's own use, simply execute make and a bin/ folder will be created in the project's root folder containing both the ELF binary and the .hex file that is to be flashed to the device.

Execute make flash COM_PORT=<port> to flash this file to the MCU's EEPROM/Flash. The port is for example COM4 on Windows, and /dev/ttyUSB# on Linux, depending on how the system is connected to the board or programming device.

Note

This is a project in its early stages. While so far UART, GPIO and SPI have been successfully used on a limited number of configurations, this is no guarantee of success on other configurations.

Feedback and PRs would be most kind and helpful :)

Required Packages

Debian

Of course, make is needed.

avr

To compile for AVR on Debian, install the following packages:

sam (Atmel ARM)

To compile for sam on Arch Linux, install the following packages:

Arch Linux

Of course, make is needed.

avr

To compile for AVR on Arch Linux, install the following packages:

esp8266

To compile for esp8266 on Arch Linux, install the following packages:

sam (Atmel ARM)

To compile for sam on Arch Linux, install the following packages: