comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: How to configure GNAT GPL on x86-64 Linux for ARM ELF development
Date: Thu, 24 May 2018 12:12:26 -0000 (UTC)
Date: 2018-05-24T12:12:26+00:00	[thread overview]
Message-ID: <pe6a7a$pu2$1@dont-email.me> (raw)
In-Reply-To: pe5q0h$617$1@dont-email.me

On Thu, 24 May 2018 07:35:46 +0000, Adam Jensen wrote:

> On Wed, 23 May 2018 09:07:51 +0100, Simon Wright wrote:
> 
>> Adam Jensen <hanzer@riseup.net> writes:
>> 
>>> Any advice on how to proceed would be very much appreciated!
>> 
>> I managed to get a compilation using this over-the-top incantation:
>> 
>>    $ gprbuild -c -u -f program.adb --target=arm-eabi --RTS=zfp-stm32f4
>> 
>> 
> Many thanks, this works! I do not yet know why it works - what it is
> doing - but the hint is a valuable. It occurred to me that I should be
> looking for Adacore documentation. I have yet to find a "getting
> started"

The error you saw "Cannot find system.ads" and Simon's answer arise 
because, targeting small embedded CPUs, you are looking below the full 
Ada environment (supplied by the runtime system (RTS) on the host 
machine, to targets which may require unique runtimes supplying the 
facilities you need and nothing more (thanks to potential space 
limitations).

As such I would suggest a ZFP RTS as a good short-term study,for several 
reasons:

it can be a pretty small codebase, but revealing in terms of how things 
are done and how to adapt them.

there are a plethora of targets out there, un- or semi-supported by Ada, 
from the AVR and MSP430 to ARM cores from ST, NXP, TI and others. 
Starting with the STM4 as you are is good, but you may want to port to 
other platforms for cost, power, security or other reasons ... the TI 
Hercules which runs dual ARM cores in lockstep for safety, has obvious 
attractions as an Ada target, for example. 

Nice price too ... https://store.ti.com/LAUNCHXL-TMS57004.aspx 

And porting to these builds on understanding the RTS, starting with the 
simplest - ZFP - as in Simon's suggestion - or AVR-Ada or my MSP430-Ada 
adaptation. I finally got round to machining the case and bezel, so I am 
wearing a wristwatch running Ada, telling the time 1970's style, in under 
1 kilobyte including RTS.

(the current version still has 200 bytes of C startup code which the 
linker insists on inserting by default; one TODO is to persuade the 
linker to let me replace that with pure Ada and strip out the unnecessary 
stuff)


You suggest going in 2 more interesting directions: 

building up to a Ravenscar profile : I believe Simon's work so far builds 
on FreeRTOS, but a "native" Ravenscar RTOS would be nice too...

SPARK qualification would be excellent ... again, especially for the 
Hercules. And again, a SPARK proven ZFP RTS would be a good base to build 
on, and a relatively simple place to start.


-- Brian


  reply	other threads:[~2018-05-24 12:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23  6:37 How to configure GNAT GPL on x86-64 Linux for ARM ELF development Adam Jensen
2018-05-23  8:07 ` Simon Wright
2018-05-24  7:35   ` Adam Jensen
2018-05-24 12:12     ` Brian Drummond [this message]
2018-05-25  4:45       ` Adam Jensen
2018-05-25 10:50         ` Brian Drummond
2018-05-26  5:06           ` Adam Jensen
2018-05-26 23:58             ` Brian Drummond
2018-05-27  8:26               ` Jacob Sparre Andersen
2018-05-30 19:52             ` JLotty
2018-05-30 21:58               ` Simon Wright
2018-06-03 23:21                 ` JLotty
2018-06-04  7:11                   ` Simon Wright
2018-05-25  3:29   ` Adam Jensen
2018-05-25  7:55     ` Simon Wright
replies disabled

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