comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Interfacing Ada With Full Runtime Directly to Electronic Chips
Date: Mon, 02 Jan 2017 16:25:23 +0000
Date: 2017-01-02T16:25:23+00:00	[thread overview]
Message-ID: <lymvf9xwcs.fsf@pushface.org> (raw)
In-Reply-To: 9ca07b79-db85-4d4a-b082-61cd75fcc1c8@googlegroups.com

patrick@spellingbeewinnars.org writes:

> If I want to connect any sort of computer running Linux directly to a
> circuit using "full Ada" with tasking support what are my options?
>
> By circuit, I mean a variety of electronic components and in this case
> with no microcontroller, an A/D chip is a simple example.
>
> I am thinking that single board computers like BeagleBone are my best
> bet, they have plenty of GPIO lines.
>
> Has anyone interfaced directly with chips via SPI or IC2 via a GPIO
> PCI card or GPIO-USB adapter ?
>
> Is there any other options?

You can talk I2C from a Raspberry Pi; see [1], [2]. It was simple to
install GNAT etc from libre.adacore.com, since Raspbian is a Debian
offshoot.

Beaglebone also supports Debian, see [3] for a report on this.

Both of the above use OS device support via file read/write/ioctl. If
you want to go bare(ish) metal, there is the AdaCore Ada_Drivers_Library
at [4]. This uses cross-compilation for ARM Cortex MCUs, compilers from
AdaCore (or [5], [6] for Mac), with runtimes for boards mostly from
STMicroelectronics (e.g. [7]).

The AdaCore runtimes support Ravenscar tasking[8] and come in two
flavours, small footprint (-sfp-) and full (-full-). The -full- version
supports exception handling and finalization and includes
Ada.Numerics. Neither support containers (easy enough to copy into the
-full- version, I expect).

The Ada_Drivers_Library uses a BSD license. The AdaCore runtimes use a
full-GPL license. If this matters to you I have runtimes for Arduino Due
and STM32F4[9] which are based on FreeRTOS and have the GCC Runtime
Library Exception, allowing release of code on proprietary terms.

Just to indicate the flavour of this bare-metal code, I have some SPI
code for an STM32F427, using interface code generated by AdaCore's
SVD2Ada[10], at [11].

[1] https://sourceforge.net/projects/raspi-i2c-ada/
[2] http://raspi-i2c-ada.sourceforge.net
[3] https://groups.google.com/forum/#!topic/beagleboard/O5AU2XL6NJ8
[4] https://github.com/AdaCore/Ada_Drivers_Library
[5] https://sourceforge.net/projects/gnuada/files/GNAT_GPL%20Mac%20OS%20X/2016-arm-eabi-darwin-bin/
[6] https://sourceforge.net/projects/gnuada/files/GNAT_GCC%20Mac%20OS%20X/6.1.0/arm-eabi/
[7]
http://uk.farnell.com/stmicroelectronics/stm32f407g-disc1/dev-board-foundation-line-mcu/dp/2506840
[8] https://en.wikipedia.org/wiki/Ravenscar_profile
[9] https://sourceforge.net/projects/cortex-gnat-rts/
[10] https://github.com/AdaCore/svd2ada
[11] https://github.com/simonjwright/multiplexed-io/blob/master/drivers/spi1/src/spi1-device.adb


  parent reply	other threads:[~2017-01-02 16:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02  2:42 Interfacing Ada With Full Runtime Directly to Electronic Chips patrick
2017-01-02  9:14 ` Dmitry A. Kazakov
2017-01-02 13:28   ` patrick
2017-01-02 17:19     ` Dmitry A. Kazakov
2017-01-03  2:41       ` patrick
2017-01-03  5:33     ` Shark8
2017-01-03 10:34       ` Dmitry A. Kazakov
2017-01-03 18:02         ` Shark8
2017-01-03 20:34           ` Dmitry A. Kazakov
2017-01-03 20:50             ` Shark8
2017-01-03 21:41               ` Dmitry A. Kazakov
2017-01-02 14:02 ` Brian Drummond
2017-01-02 15:02 ` Dennis Lee Bieber
2017-01-02 16:25 ` Simon Wright [this message]
2017-01-02 16:46   ` patrick
2017-01-04 19:29   ` antispam
2017-01-04 20:51     ` Simon Wright
2017-01-04 22:05       ` antispam
2017-01-03  7:55 ` philip.munts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox