comp.lang.ada
 help / color / mirror / Atom feed
* Arduino Due
@ 2013-11-21  7:33 Stephen Leake
  2013-11-21 15:58 ` Tero Koskinen
  2013-11-24 13:12 ` MatthiasR
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Leake @ 2013-11-21  7:33 UTC (permalink / raw)


I've recently purchased an Arduino Due
(http://arduino.cc/en/Main/arduinoBoardDue), to build a home robot. The
processor is an AT91SAM3X8E, which according to Atmel
http://www.atmel.com/devices/SAM3X8E.aspx is an ARM Cortex-M3 84 MHz 32
bit processor, no floating point hardware, along with a bunch of IO
stuff.

Has anyone ported GNAT to this? It appears I can use gcc targeted to
arm, and specify -mcpu=cortex-m3.

I'm guessing the runtime from AVR-Ada could be useful, depending on how
much is in assembler.

The Atmel website provides a C/C++ IDE and a download tool, so I can at
least write hello_world.c and try things out, but I'd like to write real
code in Ada.

I've ported GNAT to a couple of different processors before, but it's
been a while ...

--
-- Stephe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2013-11-21  7:33 Arduino Due Stephen Leake
@ 2013-11-21 15:58 ` Tero Koskinen
  2013-11-24 13:12 ` MatthiasR
  1 sibling, 0 replies; 8+ messages in thread
From: Tero Koskinen @ 2013-11-21 15:58 UTC (permalink / raw)


On Thu, 21 Nov 2013 01:33:42 -0600
Stephen Leake <stephen_leake@stephe-leake.org> wrote:

> I've recently purchased an Arduino Due
> (http://arduino.cc/en/Main/arduinoBoardDue), to build a home robot. The
> processor is an AT91SAM3X8E, which according to Atmel
> http://www.atmel.com/devices/SAM3X8E.aspx is an ARM Cortex-M3 84 MHz 32
> bit processor, no floating point hardware, along with a bunch of IO
> stuff.
> 
> Has anyone ported GNAT to this?

I have also Due, actually has been almost a year already[1], but I
haven't had time to port GNAT on it yet. But it is on my todo list
along with N+1 other things. :)

> It appears I can use gcc targeted to
> arm, and specify -mcpu=cortex-m3.

Yes, Due has Atmel's Cortex-m3 class ARM microcontroller and it is
supported by gcc.

> I'm guessing the runtime from AVR-Ada could be useful, depending on how
> much is in assembler.

You can probably get the runtime skeleton from AVR-Ada, but most of
AVR.* packages are useless. They control peripherals of
attiny/atmega/at90 AVR microcontrollers (done mostly in Ada, but
most of the register addresses and stuff should be specific to AVRs).

Currently, the best place to start is Lucretia's work at
https://github.com/Lucretia/ , especially TAMP:
https://github.com/Lucretia/tamp

> The Atmel website provides a C/C++ IDE and a download tool, so I can at
> least write hello_world.c and try things out, but I'd like to write real
> code in Ada.

I haven't checked AT91SAM3X8E datasheet in detail, but unless Atmel has
recycled their UART/I2C/SPI/etc peripheral logic from AVRs to ARM,
you have pretty hard road a head. (You need to either create bindings
to C functions or implement all peripheral handling from scratch.)

Btw, if you would use Arduino Uno and AVR-Ada, you could have robot
coded in about 30 lines of code[2]. ;)

-- 
Tero Koskinen - http://iki.fi/tero.koskinen/

[1] http://arduino.ada-language.com/arduino-due.html
[2] http://arduino.ada-language.com/remote-controlled-robot-using-xbees-and-ada.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2013-11-21  7:33 Arduino Due Stephen Leake
  2013-11-21 15:58 ` Tero Koskinen
@ 2013-11-24 13:12 ` MatthiasR
  2018-03-11 23:48   ` john
  1 sibling, 1 reply; 8+ messages in thread
From: MatthiasR @ 2013-11-24 13:12 UTC (permalink / raw)


I don't know about a ready-to-use solution *) for Cortex-M3, but besides the 
already mentioned project from 'Lucretia' there are some more starting 
points:

http://sourceforge.net/projects/arm-ada/
- for LPC21xx (ARM7); with Ravenscar runtime
- as far as I know based on GNAT for Mindstorms

https://github.com/telrob/stm32-ada
- for STM32F4 (Cortex M4F); with Ravenscar runtime
- I have made some tests on a STM32F4-Discovery board; simple test programs 
with multiple tasks are working

*) technically speaking, there is one, but I assume it's out of question for 
your project:
GNAT Pro for ARM supports Cortex M3, M4F and R4F, 'Zero Footprint' and 
Ravenscar runtimes are provided.

The source distribution of GNAT GPL 2013 contains most parts of the ARM 
support, but it is not complete. Some parts of the bareboard runtimes are 
located in the 'zfp-support' package. This package was publicly released 
only as part of the sources for GNAT GPL for Mindstorms and GNAT GPL for 
AVR. There was neither a 2013 release for Mindstorms nor for AVR, thus the 
most recent release of this package was in 2012. And back then, there was no 
support for ARM...


Regards

Matthias


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2013-11-24 13:12 ` MatthiasR
@ 2018-03-11 23:48   ` john
  2018-03-12  8:42     ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: john @ 2018-03-11 23:48 UTC (permalink / raw)


I thought I'd comment here instead of creating a new thread, but I was going to ask a similar question about Cortex-M3 stuff. I'm using an NXP LPC1778/1788 at the moment and wondered if anyone else had used either of these with Ada. I'd love to demo Ada running on our hardware, but don't have the managerial support to let me spend much time on it. 

Cheers 
John

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2018-03-11 23:48   ` john
@ 2018-03-12  8:42     ` Simon Wright
  2018-05-01 23:05       ` john
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2018-03-12  8:42 UTC (permalink / raw)


john@mccabe.org.uk writes:

> I thought I'd comment here instead of creating a new thread, but I was
> going to ask a similar question about Cortex-M3 stuff. I'm using an
> NXP LPC1778/1788 at the moment and wondered if anyone else had used
> either of these with Ada. I'd love to demo Ada running on our
> hardware, but don't have the managerial support to let me spend much
> time on it.

See https://github.com/simonjwright/cortex-gnat-rts/tree/master .

Which GNAT release are you using? I'd assume GNAT GPL 2017, in which
case ignore the remarks in INSTALL.md about compiler compatibility and
use the gnat-gpl-2017 branch.

At the moment I'm working on finalization, and having SCM troubles with
maintaining consistency between the master (gcc7), gcc8, and
gnat-gpl-2017 branches!

One thing I see I don't emphasise is that these RTSs require FreeRTOS.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2018-03-12  8:42     ` Simon Wright
@ 2018-05-01 23:05       ` john
  2018-05-02  7:58         ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: john @ 2018-05-01 23:05 UTC (permalink / raw)


I'm sorry it's taken so long to reply;I thought I had! Since my message I've discovered an STM32F4 DISCOVERY board lying around at work so had a quick play with it. I'll try to check out your RTS work; FreeRTOS is obviously well known in the Cortex world, so it will be interesting to see in action.

John

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2018-05-01 23:05       ` john
@ 2018-05-02  7:58         ` Simon Wright
  2018-05-03  6:46           ` john
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2018-05-02  7:58 UTC (permalink / raw)


john@mccabe.org.uk writes:

> I'm sorry it's taken so long to reply;I thought I had! Since my
> message I've discovered an STM32F4 DISCOVERY board lying around at
> work so had a quick play with it. I'll try to check out your RTS work;
> FreeRTOS is obviously well known in the Cortex world, so it will be
> interesting to see in action.

At the moment FreeRTOS.gpr assumes FreeRTOSV9.0.0.

Good luck!


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Arduino Due
  2018-05-02  7:58         ` Simon Wright
@ 2018-05-03  6:46           ` john
  0 siblings, 0 replies; 8+ messages in thread
From: john @ 2018-05-03  6:46 UTC (permalink / raw)


Thanks Simon. 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-03  6:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21  7:33 Arduino Due Stephen Leake
2013-11-21 15:58 ` Tero Koskinen
2013-11-24 13:12 ` MatthiasR
2018-03-11 23:48   ` john
2018-03-12  8:42     ` Simon Wright
2018-05-01 23:05       ` john
2018-05-02  7:58         ` Simon Wright
2018-05-03  6:46           ` john

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