In this directory you will find instructions and examples to start your first Ada_Drivers_Library project.
The goals of the examples are:
- Offer a simple way to start a project
- Demonstrate the supported features of the boards
- Demonstrate the supported drivers of a micro-controller family
The examples are sorted by boards but some of them are working on multiple boards, in that case the code is stored in the shared directory.
Most of the boards/micro-controller supported are based on the ARM Cortex-M architecture. If you have a GNAT Pro subscription, you can download the compiler (GNAT) and IDE (GNAT Programming Studio) from your account. Otherwise, AdaCore provides a community version of GNAT that you can download here. We recomend to download the cross compiler and also the native one because it contains the GNAT Programming Studio IDE.
Follow the instructions to install GNAT and GPS.
For the STM32 board we recommend to use the open-source probe interface stlink.
On Windows, stlink should be included with your cross-compiler installation.
On Linux, you have to download the source and compile the tool:
$ git clone https://github.com/texane/stlink.git
$ cd stlink
$ make release
Some boards require a specific tool or configuration, in that case you will find the additional instructions in the example directory dedicated to this board (for instance Micro:bit).
If you are on Windows, we recomand to use the GitHub Desktop application.
Otherwise, from the command line:
git clone --recursive https://github.com/AdaCore/Ada_Drivers_Library.git
Not all the GNAT run-times used in the Ada_Drivers_Library are packaged with the compiler.
To build and install the missing run-times, use the install_dependencies.py
script:
python ./scripts/install_dependencies.py
Start GNAT Programming Studio and open one of the project supported by the board you have:
- HiFive1
- MicroBit
- OpenMV2
- STM32F429_Discovery
- STM32F469_Discovery
- STM32F4_DISCO
- STM32F746_Discovery
- STM32F769_Discovery
Use the "Build all" button in GNAT Programming Studio tool bar.
For the STM32 board, use the "Flash to board" button in the tool bar.
If you notice an error in these instructions, or if you want to improve them, please go to Ada_Drivers_Library GitHub repository. Thank you in advance.