Skip to content

Latest commit

 

History

History

examples

Ada_Drivers_Library examples

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.

Getting started

Download and install the tools

Compiler and IDE

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, there are GNAT FSF and GPRbuild releases from the Alire project that you can download here.

A public release of GNAT Studio is also available here.

stlink

For the STM32 board we recommend to use the open-source probe interface stlink.

On Windows, you can get it from the Msys2 package manager.

On Linux, you have to download the source and compile the tool:

$ git clone https://github.com/texane/stlink.git
$ cd stlink
$ make release

Miscellaneous

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).

Clone the repository

If you are on Windows, we recommend to use the GitHub Desktop application.

Otherwise, from the command line:

git clone --recursive https://github.com/AdaCore/Ada_Drivers_Library.git

Open an example project

Start GNAT Programming Studio and open one of the project supported by the board you have:

Compile the project

Use the "Build all" button in GNAT Programming Studio tool bar.

Run the project

For the STM32 board, use the "Flash to board" button in the tool bar.

We need your help

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.