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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:a319:: with SMTP id q25-v6mr703923jai.44.1532088044741; Fri, 20 Jul 2018 05:00:44 -0700 (PDT) X-Received: by 2002:aca:2b06:: with SMTP id i6-v6mr125275oik.0.1532088044519; Fri, 20 Jul 2018 05:00:44 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no1685764itj.0!news-out.google.com!l67-v6ni3164itl.0!nntp.google.com!d7-v6no1685763itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 20 Jul 2018 05:00:44 -0700 (PDT) In-Reply-To: <2e79b691-61d0-4ed4-8fb8-5d2187bbf06f@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.171.111.51; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 71.171.111.51 References: <1d3743b1-1a36-429d-92c7-9ae0e7c16e63@googlegroups.com> <8cf99886-bbf2-4fb9-9a92-aaa5403a2624@googlegroups.com> <821c650e-72ae-4bd1-97a4-3a9bd7433d48@googlegroups.com> <2e79b691-61d0-4ed4-8fb8-5d2187bbf06f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <611759ac-2b7f-4d12-9cc9-4769f7382d01@googlegroups.com> Subject: Re: Ada: A beginners experience From: Jere Injection-Date: Fri, 20 Jul 2018 12:00:44 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 5926 X-Received-Body-CRC: 1468599788 Xref: reader02.eternal-september.org comp.lang.ada:53917 Date: 2018-07-20T05:00:44-07:00 List-Id: On Monday, July 16, 2018 at 5:38:58 PM UTC-4, Maciej Sobczak wrote: > > Back a few years ago, I started similarly to where you did. I did find > > the Inspirel book to be very good, but you had to understand the contex= t > > it was coming from. It seemed to assume you were natively (not cross) > > compiling your code. >=20 > Hi there, thank you for taking the time to check that tutorial. Still, I = think there is some correction needed here - the examples in the tutorial w= ere written with the assumption of native compilation (for example on Raspb= erryPi), simply because this makes the command-line the most compact and ki= nd of neutral as well. All commands should give the same results in the cro= ss-compilation environment. If you found any troubles with this, let me kno= w. This can help improve the future tutorial revisions. This was a few years ago, so this is from memory (take it with a grain of salt). The biggest troubles I had with it was I was coming from cross-compile instead of native. In bare metal, it is somewhat rare to compile from native since you won't have an OS or shell. Just following along blindly came up with various errors like that it needed system.ads. A new=20 beginner is not going to immediately link this to not having and RTS.=20 My first workaround was to find a system.ads and add it. This placated the compiler so I moved on. Next I think I needed system.storage_elements, so I added the spec for that to my source. I was moving along fairly=20 well until I needed something from the package body for system.storage_elements. When I tried to add s-stoele.adb then the compile= r said it could compile system files (or a similar error). This was where I had to stop with your book as I hit a road block. I needed an actual RTS and there was really no help there. I spent a couple of weeks=20 trying to find a simple ZFP package that I could modify that didn't come from Adacore (I didn't want the base GPL license from GNAT GPL). Once I got one working, I went back to your book. Like I said, it was good. I just wanted the OP to understand that=20 while it mentions cross-compile, just blinding following the steps and replacing the commands with the cross compile ones doesn't work. This isn't a deficiency of the book, it is written from a native context, but as a beginner it can be really confusing if one doesn't understand the implications of that. The only other thing I found different was the section on shared state. I didn't have a full runtime as alluded to (I had a ZFP, which was much more bare). However, I was able to correctly create: package body Program is X : Integer :=3D 123; -- This actually worked correctly for me procedure Run is -- ... end Program; I'm guessing it had something to do with how my linker script was setup, but it surprised me as it contrasted what was stated in the book. I don't think this is an error or anything, but=20 bringing this up to you just incase. >=20 > > I ran into trouble because I wanted to work on > > a controller bare-metal (it was too small for a full Ada runtime). >=20 > The tutorial was exactly focusing on zero-foot-print, bare-metal developm= ent. There are other sources that cover the (more or less) full runtime app= roach, with ready runtimes and driver libraries, so the tutorial tried to f= ill the niche for smaller chips or those projects that chose zero-foot-prin= t for other reasons (traceability, IP politics, etc.). I would say the major thing here is if it really is meant to be for bare-metal ZFP style development, it was missing some more detailed discussion on how to get and setup a quick ZFP runtime. For beginners this will be a huge deal. Developing on a Raspberry Pi really isn't bare-metal since you are compiling native with in an OS. Yes, you can emulate bare-metal programming on it, but it isn't exactly the same. Note, I am not saying have an exhaustive section on how the ZFP runtime works or anything, but just some resource on how to setup your environment for one of the book's targeted boards. I really think your book is great, so please don't take any comments as antagonistic. I recommend it to anyone I see getting started in micro-controller development.