Ada for Microcontrollers
This software consists of a makefile and patches to enable using the GNAT GPL 2015 Linux-hosted arm-eabi toolchain to build an Ada application for the Atmel SAM4S MCU.
Support is provided for the "ravenscar-full" runtime. The following packages were added to the ravenscar-full runtime:
The "ravenscar-sfp" runtime is also supported. The following packages were added to the ravenscar-sfp runtime:
If you do not wish to include these packages, then modify Makefile.hie and build-rts.sh accordingly.
Peripheral support is provided in SAM4S. packages.
To build and use the toolchain, perform the following steps:
- In your own Makefile, set the variables ROOT_DIR and OUTPUT_DIR.
- Place the contents of this repository in $(ROOT_DIR)/toolchain/
- Include toolchain.mk in your own makefile.
- Download the following files and place them in $(ROOT_DIR)/toolchain/dl:
- Add a rule to your own Makefile to build the toolchain. For example:
ROOT_DIR = $(shell dirname $(abspath $(firstword $(MAKEFILE_LIST)))) OUTPUT_DIR = $(ROOT_DIR)/output
all: $(TOOLCHAIN) $(MY_EXE)
- Add a rule to your own Makefile to build your application with this toolchain. For example, if you are using a gpr project, then:
OBJ_DIR := obj GPRCONFIG := $(TOOLCHAIN_DIR)/gnat/bin/gprconfig GPRBUILD := $(TOOLCHAIN_DIR)/gnat/bin/gprbuild GPRCLEAN := $(TOOLCHAIN_DIR)/gnat/bin/gprclean CONFIG_FILE := $(OBJ_DIR)/my_proj.cgpr
$(MY_EXE): $(TOOLCHAIN) $(OBJ_DIR) $(MY_SOURCE) $(CONFIG_FILE) @echo Building file: $@ @PATH=$(TOOLCHAIN_DIR)/gnat/bin:$(PATH) $(GPRBUILD) --target=arm-eabi -P$(ROOT_DIR)/my_proj.gpr --config=$(CONFIG_FILE)