Skip to main content

Posts

Showing posts with the label discovery

First attempt at using Ada to program the STM32F4 Discovery board

Here's my first attempt at pushing the user button to blink the red LED on a STM32F4 Discovery board, using AdaCore's GNAT Community Edition. What you need: STM32F4 Discovery board GNAT Community Edition  (download and install both the compiler toolchain and the arm-elf) Ada Drivers Library with examples It's been a while since I had my STM32 boards installed on my computer, so you may (or may not) need to install a driver for the ST-LINK/V2 programmer... 1. Connect the board, you should have a STM32 STLink device. 2. Start GPS (GNAP Programming Studio). 3. Open one of the examples from the Drivers library / examples / STM32F4_DISCO. 4. Edit main.adb and replace all text with the following source code. ---------------------------------------------------------------- -- -- -- Testing user button and red LED on STM32F4 Discovery board -- -- ...

Welcome to Ada for Embedded Systems!

Instead of starting with a long rationale for using Ada to program embedded systems, I'm just going to say this: "Why not"? After all, Ada was  designed from the start as a safe and secure computer programming language, initially developed for the United States Department of Defense (DoD) to be used in embedded systems such as aircrafts, ships, radars, or command and control systems that operate in real time, as events are occuring. The following links will explain all of this (much better than I could ever do...) AdaCore's video: Developing Embedded Systems in Ada Jack Ganssle's video: Ada - Even on a Microcontroller! This blog will address the topic of using Ada on the following platforms:  BBC Micro:Bit  and  STM32F4 Discovery . Edit: Although not exactly an embedded platform, there will also be examples about using AdaCore's GNAT and the Linux Simple I/O Library from Philip Munts on  Raspberry Pi  boards. Another thing that got me into starti...