From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada 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) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 24 May 2018 12:12:26 -0000 (UTC) Injection-Info: h2725194.stratoserver.net; posting-host="fbe857f9ce31e10a86faa1fc5e12114b"; logging-data="26562"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19skG4mAZG1fP7vCSu/+XHVbxyqMKW4uyE=" User-Agent: Pan/0.141 (Tarzan's Death; 168b179 git.gnome.org/pan2) Cancel-Lock: sha1:yAeiIHUM+xmlczjAlEYPJgaBoAo= Xref: reader02.eternal-september.org comp.lang.ada:52639 Date: 2018-05-24T12:12:26+00:00 List-Id: 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 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