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: border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT ARM on Mac OS X? Date: Sat, 08 Nov 2014 14:49:49 +0000 Organization: A noiseless patient Spider Message-ID: References: <1013422b-4823-4e5d-b8b6-46bf2d63a7fb@googlegroups.com> <545a71ed$0$56557$c3e8da3$38634283@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="ff529209d97605a4e00265a5af81ac3e"; logging-data="8459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0Kv944WDF0/LGm6/L48EMDpStRTTUGbY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:irK5Zu6k9juIyUC+DzGtNoouSa0= sha1:vvS4ouE51rHXIaCss/MLgwHfpbM= Xref: number.nntp.giganews.com comp.lang.ada:190386 Date: 2014-11-08T14:49:49+00:00 List-Id: Jerry Petrey writes: > On 11/5/2014 6:57 AM, Simon Wright wrote: >> Maciej Sobczak writes: >> >>> I have just checked the libre.adacore.com site and noticed that >>> there is no GNAT package for the ARM targets, hosted on Mac OS >>> X. Only Windows and Linux hosts are supported. >>> >>> Do you have any information on the possible plans for such a >>> package? >> >> It looks as though it might be an interesting project. >> >> The GNAT GPL 2014 package (I looked at the Linux version) is >> configured for arm-eabi and has zfp (zero footprint) and Ravenscar >> RTS's. >> >> I see that Farnell have the STM32F4DISCOVERY for £11.71 + p&p, looks >> like an inexpensive way to start. >> > > It is a very interesting project. I have Ada running on about a dozen > different ARM M4/M3 boards now and it is very nice. You can see my > article in Electronic Design magazine > (http://electronicdesign.com/dev-tools/armed-and-ready) for some help > in getting things set up. Unfortunately it is only available for > Windows and Linux - I have only used the Windows version. The > STMF429DISCOVERY board is an exceptional deal and has a graphics > LCD. I recently completed a basic driver in Ada for the LCD display > which makes this a very useful platform for development as I can catch > and display exceptions on the display. OK, getting there! I now have an STM32F429I Discovery board, and am getting to grips with it. I have an arm-eabi GNAT GPL 2014 toolchain running on Mac OS X Mavericks, produced by cobbling together AdaCore's linux-elf distro and various build tips from around the web (the best was [1]). There are various oddities: (1) during the second build, you have to configure with --disable-libada (because you don't want the full RTS), which makes you run make # build the base compiler, gnatmake, gnatbind make cross-gnattools # build the other gnat* tools make # rename the gnat* tools to gnat*-cross (!!!) make install # renames gnat*-cross to arm-eabi-gnat* This may change in newer base GCCs (GNAT GPL 2014 is based on 4.7.4). (2) There has to be an RTS or gprbuild won't see the compiler. I don't know how this is determined. I started out copying the Linux distro's rts-zfp RTS to lib/gcc/arm-eabi/4.7.4/, but that didn't work, so I made symlinks from lib/gcc/arm-eabi/4.7.4/rts-zfp/adalib,adainclude to the level above. OK! I see that the Linux distro has the Ravenscar RTS in lib/gnat/arm-eabi/ravenscar-sfp-stm32f4, perhaps that's the clue. (3) The stlink utilities work just fine, I had a problem misreading the flash load address as 0x80000000 rather than 0x8000000 and would have expected some error message instead of an immediate failure! st-flash requires a bin format rather than hex or elf, so I used hex2bin[2] for the former (good for getting the demo back on the card!) and arm-eabi-objcopy -O binary demo demo.bin for the latter. (4) Thanks for your pointer to [3] for the updated Ravenscar BSP for the STM32F429I Discovery! I now have the LEDs demo twinkling away beside me. This lot needs a writeup .. [1] http://istarc.wordpress.com/2014/07/21/stm32f4-build-your-toolchain-from-scratch/ [2] https://sourceforge.net/projects/hex2bin/ [3] https://github.com/gnlnops/gnat-stm32f429i-disco