• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language
    C
  • License
    GNU Lesser Genera...
  • Created over 6 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Nodate (野点)

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

Overview

  • The STM32 branch is currently under heavy development, aiming to support all major STM32 MCUs and features.
  • The SAM branch is considered a future development target once the STM32 branch stabilises.
  • The RP branch is considered an experimental addition.
  • The AVR branch is still a modified Arduino AVR core, supporting C++ and compatible with Arduino libraries. The future of this branch is currently undecided.
  • The ESP8266 branch is experimental and may be removed in the future.

STM32

Supported boards:

  MCU Boards Board name
F0      
  STM32F042K6T Nucleo-F042K6 nucleo-f042k6
  STM32F051R8T STM32F0-Discovery stm32f0-discovery
  STM32F072C8Tx 'Otter Pill' otter_pill
F1      
  STM32F103C8 'Blue Pill' blue_pill
  STM32F103CB Maple Mini maple_mini
F3
  STM32F334R8 Nucleo-F334R8 nucleo-f334r8
F4      
  STM32F407VGT STM32F4-Discovery stm32f4-discovery
  STM32F411CE WeAct MiniF4 ('Black Pill') black_pill_f411
F7      
  STM32F746ZG Nucleo-F746ZG nucleo-f746zg
L4
  STM32L432KC Nucleo-L432KC nucleo-l432kc
  STM32L433CCT Fox Pill fox_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:

  • RCC.
  • GPIO (digital & AF).
  • USART (basic UART with settable baud rate).
  • SysTick (millisecond-accurate delay function).
  • IO: set stdout to e.g. a UART.

In progress:

  • U(S)ART with DMA.
  • I2S.
  • I2C.
  • SPI.
  • SDIO (with FatFS).

AVR & Others

The current version has been tested with the following boards:

  • Arduino Duemilanove (ATmega328p)
  • Arduino Mega (ATmega1280, ATmega2560)
  • Arduino Uno (ATmega328p)

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:

  • <wiring.h> - For GPIO.
  • <HardwareSerial.h> - For UART
  • <SPI.h> - For SPI.
  • <Wire.h> - For I2C.

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:

  • gcc-avr
  • avr-libc

sam (Atmel ARM)

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

  • gcc-arm-none-eabi

Arch Linux

Of course, make is needed.

avr

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

  • gcc-avr
  • avr-libc

esp8266

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

  • esp-open-sdk (from AUR, include /opt/esp-open-sdk/xtensa-lx106-elf/bin into PATH)

sam (Atmel ARM)

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

  • gcc-arm-none-eabi-bin (from AUR)

More Repositories

1

NymphCast

Audio and video casting system with support for custom applications.
C
2,406
star
2

BMaC

Building Management and Control system
C++
106
star
3

Sarge

Simple command line argument parser for C++ and Ada.
Ada
78
star
4

MQTTCute

An advanced desktop MQTT client, suitable for binary protocol development and monitoring
C
64
star
5

NymphRPC

Versatile and fast remote procedure call library.
C++
60
star
6

LockFreeRingBuffer

Implementation of a lock-free ring buffer class.
C++
30
star
7

WildFox

Webkit-based, multi-platform and Firefox-compatible browser.
C++
26
star
8

DebounceHat

Fully isolated, input debounce Hat for Raspberry Pi, for up to 6 switches, relays and powered devices
HTML
22
star
9

Universal_Data_Share

Application to share files with in a peer-to-peer fashion. Also demonstration of the UDS protocol.
C++
20
star
10

NyanSD

Service discovery protocol and reference implementation.
C++
18
star
11

NymphMQTT

MQTT library.
C++
17
star
12

EmbeddedProgrammingWithCpp17

Code projects for the book 'Hands-On Embedded Programming with C++17' by Maya Posch
C
14
star
13

ChronoTrigger

A simple, restartable interval timer.
C++
12
star
14

FreeRTOS_HTTP_server

STM32-based FreeRTOS HTTP webserver example.
C
12
star
15

Cerflet

C++ & POCO-based web-application server.
C++
11
star
16

FreeRTOS_SCPI

SCPI server implementation for STM32 using FreeRTOS, CMSIS-RTOS and libscpi.
C
11
star
17

NymphCast-MediaServer

Media server for the NymphCast ecosystem.
C++
8
star
18

NymphCastAudio-ESP32

ESP32 version of NymphCastAudio.
C
8
star
19

ClubStatusService

Simple C++ service to monitor inputs via interrupts and update a clubroom status.
C++
7
star
20

Poco-build

Non-clunky build system for the Poco framework libraries.
C++
6
star
21

ByteBauble

Utility library that handles endianness and other common byte/bit-related operations.
C++
6
star
22

OpenPNR

Open source place & routing tool for FPGAs.
C++
4
star
23

FLR

File Level Revision system.
C++
3
star
24

LEDNip

STM32F427-based developer board with 5 channels for controlling LEDs.
C
3
star
25

HD44780_i2c

HD44780-compatible I2C adapter for 5V & 3.3V I2C buses.
HTML
3
star
26

libnymphcast

NymphCast Client Library.
C++
3
star
27

NPoCo

Nyanko Portable Components libraries.
C++
3
star
28

pcm_recorder

A simple PCM audio recorder for ESP32.
C
3
star
29

Nt

Classes based upon the Qt framework. Pronounced as 'neat'.
2
star
30

Nucleo-144_mounting

Helpful components to ease integrating Nucleo-144 boards.
OpenSCAD
2
star
31

libmosquitto

The Mosquitto client library tweaked to support MinGW and use Makefiles everywhere.
C
1
star
32

colour_analyser

Analysing colours (RGBC) with colour sensors and AVR.
C++
1
star
33

Sweet32-LLVM

LLVM backend for the Sweet32 32-bit processor.
1
star