* USB Boarduino on AVR-Ada Tutorial @ 2010-08-04 2:50 Warren 2010-08-04 10:52 ` Brian Drummond ` (2 more replies) 0 siblings, 3 replies; 26+ messages in thread From: Warren @ 2010-08-04 2:50 UTC (permalink / raw) Rolf graciously granted me access to add to the AVR-Ada's Tutorial page, my own notes on using the USB Boarduino (Arduino) with AVR-Ada. It can be found here: https://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Tutorial#USB_Boarduino_Tutorial If you are currently using the Arduino, this should make it easier to get started with AVR-Ada. This documents some things that are specific to the Arduino environment that took me some time to work out. Consider it the "fast track". The Arduino focus has always been to make it easy for people to get started and teaching, which is ok. But I think they've sometimes "dumbed it down" too much. They don't want their students to get confused by technical details like upload baud rates or I/O ports and pins. They'd prefer them to know that the LED is "digital pin 13" instead of Port B, bit 5 (on a particular chip). Anyway, that's just my opinion- I like to drive. So I've documented a few Arduino details that may be of interest in that tutorial. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 2:50 USB Boarduino on AVR-Ada Tutorial Warren @ 2010-08-04 10:52 ` Brian Drummond 2010-08-04 12:42 ` Warren 2010-08-04 13:13 ` Warren 2010-08-05 14:53 ` Brian Drummond 2010-08-26 0:26 ` b.robinson.jp 2 siblings, 2 replies; 26+ messages in thread From: Brian Drummond @ 2010-08-04 10:52 UTC (permalink / raw) On Tue, 3 Aug 2010 19:50:20 -0700 (PDT), Warren <ve3wwg@gmail.com> wrote: >Rolf graciously granted me access to add to the AVR-Ada's Tutorial >page, >my own notes on using the USB Boarduino (Arduino) with AVR-Ada. >It can be found here: > >https://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Tutorial#USB_Boarduino_Tutorial > >If you are currently using the Arduino, this should make it easier to >get >started with AVR-Ada. This documents some things that are specific >to the Arduino environment that took me some time to work out. >Consider it the "fast track". >So I've documented a few Arduino details that may be of interest >in that tutorial. > >Warren Thanks! One or two questions though: "I'm going to assume you have Cygwin installed (or using Linux). Alternatively, you may be using a DOS or MSYS shell instead. To install AVR-Ada currently, you need to download and install: 1. WinAVR-20100110-install.exe 2. AVR-Ada-1.1.0.exe " It seems these instructions are Windows only, despite the assumption. Presumably WinAVR is unnecessary; the only tool I can see in the Linux section is avrdude, available from http://www.nongnu.org/avrdude/ The Linux AVR-Ada binaries are very obsolete - 0.41 - so presumably it's built from source. But then: "If you're using Linux instead (not using Cygwin), your make file can be simpler: MCU=atmega168p AVRDUDE_CONF=C:/WinAVR-20100110/bin/avrdude.conf" C:? Makes me wonder if you ARE using WinAVR, but under Wine? If so, it's worth mentioning which version of Wine it was tested with. Or is this a Cygwin-ism that escaped into the Linux script? If you can easily answer these - great! If not, you may just have inspired me to test it for myself. I bought an Arduino in, ahem, March, and it's been waiting for a spare moment ;-) - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 10:52 ` Brian Drummond @ 2010-08-04 12:42 ` Warren 2010-08-04 13:13 ` Warren 1 sibling, 0 replies; 26+ messages in thread From: Warren @ 2010-08-04 12:42 UTC (permalink / raw) On Aug 4, 6:52 am, Brian Drummond <brian_drumm...@btconnect.com> wrote: > On Tue, 3 Aug 2010 19:50:20 -0700 (PDT), Warren <ve3...@gmail.com> wrote: > >Rolf graciously granted me access to add to the AVR-Ada's Tutorial > >page, > >my own notes on using the USB Boarduino (Arduino) with AVR-Ada. > >It can be found here: > > >https://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Tutori... > One or two questions though: > > "I'm going to assume you have Cygwin installed (or using Linux). > Alternatively, you may be using a DOS or MSYS shell instead. > To install AVR-Ada currently, you need to download and install: > > 1. WinAVR-20100110-install.exe > 2. AVR-Ada-1.1.0.exe " > > It seems these instructions are Windows only, despite the assumption. True, as far as WinAVR is concerned. I assumed Linux users would naturally use the AVR tool chain instead. > Presumably WinAVR is unnecessary; the only tool I can see in the Linux section > is avrdude, available fromhttp://www.nongnu.org/avrdude/ > The Linux AVR-Ada binaries are very obsolete - 0.41 - so presumably it's built > from source. Ya, I didn't try out the Linux tools for it. But you're right, some clarification would be useful. > MCU=atmega168p > AVRDUDE_CONF=C:/WinAVR-20100110/bin/avrdude.conf" > > C:? > Makes me wonder if you ARE using WinAVR, but under Wine? No, that should be changed to a UNIX path. ;-) > If you can easily answer these - great! If not, you may just have inspired me to > test it for myself. I bought an Arduino in, ahem, March, and it's been waiting > for a spare moment ;-) > > - Brian I only tested with WinAVR, even though Linux would be my development platform by choice. But my music recording software is Windows specific, and I generally like keeping things in one place. I have Linux, Solaris etc. on other machines here, but keeping my consoles all working is a pain. But I know there are many people using AVR under Linux. So give it a try. Like you said, you may need to download sources though. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 10:52 ` Brian Drummond 2010-08-04 12:42 ` Warren @ 2010-08-04 13:13 ` Warren 2010-08-04 21:26 ` Brian Drummond 1 sibling, 1 reply; 26+ messages in thread From: Warren @ 2010-08-04 13:13 UTC (permalink / raw) On Aug 4, 6:52 am, Brian Drummond <brian_drumm...@btconnect.com> wrote: > On Tue, 3 Aug 2010 19:50:20 -0700 (PDT), Warren <ve3...@gmail.com> wrote: > >Rolf graciously granted me access to add to the AVR-Ada's Tutorial > >page, > >my own notes on using the USB Boarduino (Arduino) with AVR-Ada. > >It can be found here: > > >https://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Tutori... ... > Presumably WinAVR is unnecessary; the only tool I can see in the Linux section > is avrdude, available fromhttp://www.nongnu.org/avrdude/ > The Linux AVR-Ada binaries are very obsolete - 0.41 - so presumably it's built > from source. ... > - Brian Brian, I made some minor tweaks to the tutorial to be clearer about the platforms (and fixed the unix path). While I've not used AVR-GCC under Linux, it is probably a genrally better experience than WinAVR, provided you can find reasonably recent packages. The following might be a good place to start: http://www.avrfreaks.net/wiki/index.php/Documentation:AVR_GCC Otherwise google AVR-GCC. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 13:13 ` Warren @ 2010-08-04 21:26 ` Brian Drummond 2010-08-05 0:59 ` Warren 2010-08-22 22:41 ` Brian Drummond 0 siblings, 2 replies; 26+ messages in thread From: Brian Drummond @ 2010-08-04 21:26 UTC (permalink / raw) On Wed, 4 Aug 2010 06:13:31 -0700 (PDT), Warren <ve3wwg@gmail.com> wrote: >On Aug 4, 6:52�am, Brian Drummond <brian_drumm...@btconnect.com> >wrote: >> On Tue, 3 Aug 2010 19:50:20 -0700 (PDT), Warren <ve3...@gmail.com> wrote: >> >Rolf graciously granted me access to add to the AVR-Ada's Tutorial >> >page, >> >my own notes on using the USB Boarduino (Arduino) with AVR-Ada. >> >It can be found here: >> >> >https://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Tutori... >... >> Presumably WinAVR is unnecessary; the only tool I can see in the Linux section >> is avrdude, available fromhttp://www.nongnu.org/avrdude/ >> The Linux AVR-Ada binaries are very obsolete - 0.41 - so presumably it's built >> from source. >... >> - Brian > >Brian, I made some minor tweaks to the tutorial to be clearer about >the >platforms (and fixed the unix path). Very useful clarifications, thanks! It'll probably be the weekend before I can try it, but the instructions now give me much more confidence that it'll work on Linux. - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 21:26 ` Brian Drummond @ 2010-08-05 0:59 ` Warren 2010-08-22 22:41 ` Brian Drummond 1 sibling, 0 replies; 26+ messages in thread From: Warren @ 2010-08-05 0:59 UTC (permalink / raw) On Aug 4, 5:26 pm, Brian Drummond <brian_drumm...@btconnect.com> wrote: > On Wed, 4 Aug 2010 06:13:31 -0700 (PDT), Warren <ve3...@gmail.com> wrote: ... > >Brian, I made some minor tweaks to the tutorial to be clearer about > >the > >platforms (and fixed the unix path). > > Very useful clarifications, thanks! > > It'll probably be the weekend before I can try it, but the instructions now give > me much more confidence that it'll work on Linux. > > - Brian If you run into any Linux AVR-GCC issues you think are worth sharing, I could add them to the tutorial as well. Good luck with that! I'm curious: Precisely which chip and programmer did you get? Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 21:26 ` Brian Drummond 2010-08-05 0:59 ` Warren @ 2010-08-22 22:41 ` Brian Drummond 2010-08-23 9:29 ` Tero Koskinen ` (2 more replies) 1 sibling, 3 replies; 26+ messages in thread From: Brian Drummond @ 2010-08-22 22:41 UTC (permalink / raw) On Wed, 04 Aug 2010 22:26:32 +0100, Brian Drummond <brian_drummond@btconnect.com> wrote: >On Wed, 4 Aug 2010 06:13:31 -0700 (PDT), Warren <ve3wwg@gmail.com> wrote: >>Brian, I made some minor tweaks to the tutorial to be clearer about >>the >>platforms (and fixed the unix path). > >Very useful clarifications, thanks! > >It'll probably be the weekend before I can try it, but the instructions now give >me much more confidence that it'll work on Linux. Several weekends later, I have managed to spend a few hours on this. None of the obvious (to me) approaches to installing the tools have worked smoothly on my machine (running OpenSuse 11.3). The closest I've got is using the cross-avr-binutils (2.20) and cross-avr-gcc (4.5.0) packages from OpenSuse, available as binary and source rpms. The binary version is built without Ada support, but the source builds without apparent complaints, to support Ada. Ditto avr-libc v1.70 (with more difficulty) from the same source. Now the AVR-Ada package (1.1-0) won't build, complaining that "avr-gnatprep" is not found (and indeed I can't find it!, though gnatbind is present) Does anyone know which package SHOULD supply gnatprep, so I can try to track down what's missing?) Incidentally the AVR-Ada package contains a do-it-all script based around GCC4.3.2. This fails, building binutils, with compile errors in tc-avr.c. Presumably it would work if I could dig out a 4.3 era GCC, but that's not a trivial route either. - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-22 22:41 ` Brian Drummond @ 2010-08-23 9:29 ` Tero Koskinen 2010-08-24 11:37 ` Brian Drummond 2010-08-23 15:28 ` Warren 2010-08-24 12:12 ` Brian Drummond 2 siblings, 1 reply; 26+ messages in thread From: Tero Koskinen @ 2010-08-23 9:29 UTC (permalink / raw) On Sun, 22 Aug 2010 23:41:37 +0100 Brian Drummond wrote: > On Wed, 04 Aug 2010 22:26:32 +0100, Brian Drummond > <brian_drummond@btconnect.com> wrote: > > >On Wed, 4 Aug 2010 06:13:31 -0700 (PDT), Warren <ve3wwg@gmail.com> wrote: > > >>Brian, I made some minor tweaks to the tutorial to be clearer about > >>the > >>platforms (and fixed the unix path). > > > >Very useful clarifications, thanks! > > > >It'll probably be the weekend before I can try it, but the instructions now give > >me much more confidence that it'll work on Linux. > > Several weekends later, I have managed to spend a few hours on this. > > None of the obvious (to me) approaches to installing the tools have worked > smoothly on my machine (running OpenSuse 11.3). > > The closest I've got is using the cross-avr-binutils (2.20) and cross-avr-gcc > (4.5.0) packages from OpenSuse, available as binary and source rpms. I have AVR-GCC 4.5.0 with Ada support and AVR-Ada 1.1.0 RPM .spec files for Fedora 13 available at http://iki.fi/tero.koskinen/avr-gnat/ They should probably work out of the box with Arduino (atmega328p), but I think I disabled support for all other chipsets[1] because it was easier (for me) that way. > - Brian -- Tero Koskinen - http://iki.fi/tero.koskinen/ [1] file arduino.patch ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-23 9:29 ` Tero Koskinen @ 2010-08-24 11:37 ` Brian Drummond 2010-08-24 12:25 ` Ludovic Brenta 0 siblings, 1 reply; 26+ messages in thread From: Brian Drummond @ 2010-08-24 11:37 UTC (permalink / raw) On Mon, 23 Aug 2010 12:29:31 +0300, Tero Koskinen <tero.koskinen@iki.fi> wrote: >> None of the obvious (to me) approaches to installing the tools have worked >> smoothly on my machine (running OpenSuse 11.3). >> >> The closest I've got is using the cross-avr-binutils (2.20) and cross-avr-gcc >> (4.5.0) packages from OpenSuse, available as binary and source rpms. > >I have AVR-GCC 4.5.0 with Ada support and AVR-Ada 1.1.0 RPM .spec files >for Fedora 13 available at http://iki.fi/tero.koskinen/avr-gnat/ > >They should probably work out of the box with Arduino (atmega328p), >but I think I disabled support for all other chipsets[1] because it was >easier (for me) that way. Thanks to you and David for further suggestions. Building the 4.3 toolset using GCC4.5 would be non-trivial, involving patching the sources (the previously mentioned failure in binutils2.19, tc-avr.c turns out to be a negative enum! GCC4.5 objects to this - the "solution" in 2.20 is to cast it to an int...) The atmega328p is not the only AVR I want to target, so I may have work to do if I use these. But it's good to know there's life in AVR-GCC 4.5 despite the number of online sources reporting you need 4.3.x. If my current build runs into difficulty I'll take a look at these rpms. I had to disable *some* devices to build avr-libc 1.70 with GCC4.5.0 (or 4.5.1), because the compiler didn't recognise them, and didn't report correctly http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45261 But not many. (why did the source rpm named 4.5.0 build a compiler identifying itself as 4.5.1, I wonder?) - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-24 11:37 ` Brian Drummond @ 2010-08-24 12:25 ` Ludovic Brenta 0 siblings, 0 replies; 26+ messages in thread From: Ludovic Brenta @ 2010-08-24 12:25 UTC (permalink / raw) Brian Drummond wrote on comp.lang.ada: > why did the source rpm named 4.5.0 build a compiler identifying > itself as 4.5.1, I wonder? Probably because this RPM was built from the gcc-4_4-branch some time between the releases of 4.5.0 and 4.5.1. The GCC maintainers change the version number in the sources immediately after each release. Thus, the compiler can report itself as 4.5.1 even before 4.5.1 is formally released. You would normally also get a date to disambiguate the version. -- Ludovic Brenta. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-22 22:41 ` Brian Drummond 2010-08-23 9:29 ` Tero Koskinen @ 2010-08-23 15:28 ` Warren 2010-08-23 22:08 ` Brian Drummond 2010-08-24 11:15 ` Brian Drummond 2010-08-24 12:12 ` Brian Drummond 2 siblings, 2 replies; 26+ messages in thread From: Warren @ 2010-08-23 15:28 UTC (permalink / raw) Brian Drummond expounded in news:6e8376p4ltcvberbt9a44ub44vc48vjr3m@4ax.com: > None of the obvious (to me) approaches to installing the tools have > worked smoothly on my machine (running OpenSuse 11.3). > > The closest I've got is using the cross-avr-binutils (2.20) and > cross-avr-gcc (4.5.0) packages from OpenSuse, available as binary and > source rpms. The binary version is built without Ada support, but the > source builds without apparent complaints, to support Ada. Ditto > avr-libc v1.70 (with more difficulty) from the same source. > > Now the AVR-Ada package (1.1-0) won't build, complaining that > "avr-gnatprep" is not found (and indeed I can't find it!, though > gnatbind is present) avr-gnatprep AFAIK, should be available from your "cross-avr-binutils" if it supported Ada, which you say doesn't. I would also expect to find it if you built and installed it from sources. BUT, under Linux I can't think of a good reason to have an avr-gnatprep in addition to a Linux native gnatprep. So maybe all you need to do is to create a symlink from gnatprep to avr-gnatprep, where ever your gnatprep is installed. > Does anyone know which package SHOULD supply gnatprep, so I can try to > track down what's missing?) On the WinAVR side, AVR-Ada builds on top of the plain "avr-gcc" toolset supplied in WinAVR. So AVR-Ada is designed to build an Ada toolset, in addition to it's Ada avr libraries and code. If you have a built version of the toolchain working already (and resolved avr-gnatprep), then you can skip the toolchain build in AVR-Ada, I would think. Hopefully you can just build the Ada AVR libraries and package support. > Incidentally the AVR-Ada package contains a do-it-all script based > around GCC4.3.2. This fails, building binutils, with compile errors in > tc-avr.c. Presumably it would work if I could dig out a 4.3 era GCC, > but that's not a trivial route either. > > - Brian I haven't looked at the script, but you can probably edit the script (or supply arguments) to skip the tool chain build, and just focus on compiling the AVR-Ada components with the toolchain you installed. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-23 15:28 ` Warren @ 2010-08-23 22:08 ` Brian Drummond 2010-08-24 9:07 ` David Sauvage 2010-08-24 11:15 ` Brian Drummond 1 sibling, 1 reply; 26+ messages in thread From: Brian Drummond @ 2010-08-23 22:08 UTC (permalink / raw) On Mon, 23 Aug 2010 15:28:53 +0000 (UTC), Warren <ve3wwg@gmail.com> wrote: >Brian Drummond expounded in >news:6e8376p4ltcvberbt9a44ub44vc48vjr3m@4ax.com: > >> None of the obvious (to me) approaches to installing the tools have >> worked smoothly on my machine (running OpenSuse 11.3). >> >> The closest I've got is using the cross-avr-binutils (2.20) and >> cross-avr-gcc (4.5.0) packages from OpenSuse, available as binary and >> source rpms. The binary version is built without Ada support, but the >> source builds without apparent complaints, to support Ada. Ditto >> avr-libc v1.70 (with more difficulty) from the same source. >> >> Now the AVR-Ada package (1.1-0) won't build, complaining that >> "avr-gnatprep" is not found (and indeed I can't find it!, though >> gnatbind is present) > >avr-gnatprep AFAIK, should be available from your "cross-avr-binutils" >if it supported Ada, which you say doesn't. I would also expect to >find it if you built and installed it from sources. Thanks. There was no sign of config options to support Ada building cross-avr-binutils, but I wondered. It's good to know that binutils is where to focus, if need be... >So maybe all you need to do >is to create a symlink from gnatprep to avr-gnatprep, where ever >your gnatprep is installed. Good point! It's not clear to me what needs to be cross-specific (beyond compiler and assembler, obviously!) and which native tools will do, but the preprocessor should be agnostic if anything is. So I'll try that first. >> Incidentally the AVR-Ada package contains a do-it-all script based >> around GCC4.3.2. This fails, building binutils, with compile errors in >> tc-avr.c. Presumably it would work if I could dig out a 4.3 era GCC, >> but that's not a trivial route either. >> >I haven't looked at the script, but you can probably edit the >script (or supply arguments) to skip the tool chain build, and >just focus on compiling the AVR-Ada components with the toolchain >you installed. The pre-packaged cross-avr-gcc chain appears OK except for Ada support. Rebuilding from source (loosely following the instructions on http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Setup#Compiling_the_AVR-Ada_libraries but adapting for 4.5) appears to be successful (i.e. complete with only minor difficulty and no errors) Compiling the AVR-Ada components is where I came unstuck. I'll try the symlink next. Thanks for the suggestion, - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-23 22:08 ` Brian Drummond @ 2010-08-24 9:07 ` David Sauvage 0 siblings, 0 replies; 26+ messages in thread From: David Sauvage @ 2010-08-24 9:07 UTC (permalink / raw) > > >> Incidentally the AVR-Ada package contains a do-it-all script based > >> around GCC4.3.2. This fails, building binutils, with compile errors in > >> tc-avr.c. Presumably it would work if I could dig out a 4.3 era GCC, > >> but that's not a trivial route either. > There is also a tutorial on AVR-Ada wiki to build AVR-Ada 1.1.0 (patched version)/GCC-4.3 from Ubuntu 10.04 Lucid and Debian 6.0 Squeeze host, see : http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Build_From_Ubuntu_Lucid_Or_Debian_Squeeze Arduino Board abstraction package are in development and will be published soon. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-23 15:28 ` Warren 2010-08-23 22:08 ` Brian Drummond @ 2010-08-24 11:15 ` Brian Drummond 2010-08-24 13:40 ` Warren 1 sibling, 1 reply; 26+ messages in thread From: Brian Drummond @ 2010-08-24 11:15 UTC (permalink / raw) On Mon, 23 Aug 2010 15:28:53 +0000 (UTC), Warren <ve3wwg@gmail.com> wrote: >So maybe all you need to do >is to create a symlink from gnatprep to avr-gnatprep, where ever >your gnatprep is installed. That did the trick, as far as completing the build. I'll update again when I test the tools. Thanks again, - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-24 11:15 ` Brian Drummond @ 2010-08-24 13:40 ` Warren 0 siblings, 0 replies; 26+ messages in thread From: Warren @ 2010-08-24 13:40 UTC (permalink / raw) Brian Drummond expounded in news:3ba776pdc7ld4fb5rhhhivckvs00u5rb0e@4ax.com: > On Mon, 23 Aug 2010 15:28:53 +0000 (UTC), Warren <ve3wwg@gmail.com> > wrote: > >>So maybe all you need to do >>is to create a symlink from gnatprep to avr-gnatprep, where ever >>your gnatprep is installed. > > That did the trick, as far as completing the build. > I'll update again when I test the tools. > > Thanks again, > - Brian I'm glad to hear that! Good luck. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-22 22:41 ` Brian Drummond 2010-08-23 9:29 ` Tero Koskinen 2010-08-23 15:28 ` Warren @ 2010-08-24 12:12 ` Brian Drummond 2 siblings, 0 replies; 26+ messages in thread From: Brian Drummond @ 2010-08-24 12:12 UTC (permalink / raw) On Sun, 22 Aug 2010 23:41:37 +0100, Brian Drummond <brian_drummond@btconnect.com> wrote: >None of the obvious (to me) approaches to installing the tools have worked >smoothly on my machine (running OpenSuse 11.3). > >The closest I've got is using the cross-avr-binutils (2.20) and cross-avr-gcc >(4.5.0) packages from OpenSuse, available as binary and source rpms. The binary >version is built without Ada support, but the source builds without apparent >complaints, to support Ada. Ditto avr-libc v1.70 (with more difficulty) from >the same source. If anyone's interested, I have since found this page http://jmanton.wordpress.com/2010/08/08/compiling-avr-gcc-toolchain-from-scratch/ which, apart from the GCC configure command line changes to add Ada support from http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Setup is probably what I should have done. It includes the patch to add support for the missing devices, hence avoids the difficulty I had with avr-libc 1.70. - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 2:50 USB Boarduino on AVR-Ada Tutorial Warren 2010-08-04 10:52 ` Brian Drummond @ 2010-08-05 14:53 ` Brian Drummond 2010-08-16 14:16 ` Warren 2010-08-26 0:26 ` b.robinson.jp 2 siblings, 1 reply; 26+ messages in thread From: Brian Drummond @ 2010-08-05 14:53 UTC (permalink / raw) On Tue, 3 Aug 2010 19:50:20 -0700 (PDT), Warren <ve3wwg@gmail.com> wrote: >Rolf graciously granted me access to add to the AVR-Ada's Tutorial >page, >The Arduino focus has always been to make it easy for people to get >started and teaching, which is ok. But I think they've sometimes >"dumbed it down" too much. They don't want their students to get >confused by technical details like upload baud rates or I/O ports >and pins. They'd prefer them to know that the LED is "digital pin 13" >instead of Port B, bit 5 (on a particular chip). Anyway, that's >just my opinion- I like to drive. Forgot to mention: this looks like a candidate for an "Arduino" package which contains all the renames, so you can "with Arduino" and write Arduino.Led := On; or, if you want to drive the port directly, simply read the package instead of rummaging through data sheets and schematics. Led types should be enumerations, or renamed subtypes of boolean, (On,Off) or (Off,On) according to the way they are connected, rather than (True,False). - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-05 14:53 ` Brian Drummond @ 2010-08-16 14:16 ` Warren 2010-08-23 22:10 ` Brian Drummond 0 siblings, 1 reply; 26+ messages in thread From: Warren @ 2010-08-16 14:16 UTC (permalink / raw) Brian Drummond expounded in news:8cjl56l69ruae3ev5ntfnjvker3uldlctg@4ax.com: >>The Arduino focus has always been to make it easy for people to get >>started and teaching, which is ok. But I think they've sometimes >>"dumbed it down" too much. They don't want their students to get >>confused by technical details like upload baud rates or I/O ports >>and pins. They'd prefer them to know that the LED is "digital pin 13" >>instead of Port B, bit 5 (on a particular chip). Anyway, that's >>just my opinion- I like to drive. > > Forgot to mention: > > this looks like a candidate for an "Arduino" package which contains > all the renames, so you can "with Arduino" and write > Arduino.Led := On; > or, if you want to drive the port directly, simply read the package > instead of rummaging through data sheets and schematics. > > Led types should be enumerations, or renamed subtypes of boolean, > (On,Off) or (Off,On) according to the way they are connected, rather > than (True,False). > > - Brian I have no interest in doing that myself. The Arduino folks have what I consider, a rather extreme focus on "easy for new students". That's ok, it's their project. But as part of that focus, they've made changes to the compiler to make it "a new language" to simplify it further for students -- so it's not strictly C/C++, though it obviously is mostly that. They've even entertained making "010" mean 10 decimal, instead of the octal value of 8 it means in true C. To me this seems all wrong, but it's their project (this will have a major impact on include files if they do it!) So even maintaining a separate AVR C include file set may introduce extra work. It would certainly be a full time job keeping a separately maintained set of Arduino "mapping packages" in Ada. In my opinion, you choose an AVR platform (or family) and design for that. At that point you know what your hardware looks like. Since you're laying out the code, you can formalize ports etc. symbolically yourself, and thus eliminate hard-coding. To me, the biggest plus on the Arduino side is the cheap and easy to use programmers, hardware, "shields" and PCBs etc. Now, being able to use Ada on them, is just icing on the cake. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-16 14:16 ` Warren @ 2010-08-23 22:10 ` Brian Drummond 0 siblings, 0 replies; 26+ messages in thread From: Brian Drummond @ 2010-08-23 22:10 UTC (permalink / raw) On Mon, 16 Aug 2010 14:16:38 +0000 (UTC), Warren <ve3wwg@gmail.com> wrote: >Brian Drummond expounded in >news:8cjl56l69ruae3ev5ntfnjvker3uldlctg@4ax.com: >>>The Arduino focus has always been to make it easy for people to get >>>started and teaching, which is ok. But I think they've sometimes >>>"dumbed it down" too much. They don't want their students to get >>>confused by technical details like upload baud rates or I/O ports >>>and pins. They'd prefer them to know that the LED is "digital pin 13" >>>instead of Port B, bit 5 (on a particular chip). Anyway, that's >>>just my opinion- I like to drive. >> this looks like a candidate for an "Arduino" package which contains >> all the renames, so you can "with Arduino" and write >> Arduino.Led := On; >I have no interest in doing that myself. The Arduino folks >have what I consider, a rather extreme focus on "easy for >new students". That's ok, it's their project. Apologies if that sounded like a request! It may be something I can tackle, once the basic tools are in place. >To me, the biggest plus on the Arduino side is the cheap >and easy to use programmers, hardware, "shields" and PCBs >etc. Now, being able to use Ada on them, is just icing >on the cake. Agreed. - Brian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-04 2:50 USB Boarduino on AVR-Ada Tutorial Warren 2010-08-04 10:52 ` Brian Drummond 2010-08-05 14:53 ` Brian Drummond @ 2010-08-26 0:26 ` b.robinson.jp 2010-08-26 7:48 ` David Sauvage 2 siblings, 1 reply; 26+ messages in thread From: b.robinson.jp @ 2010-08-26 0:26 UTC (permalink / raw) Warren, Thanks for taking the time to share your notes. I tried to get AVR- Ada working for my AVR project earlier this but I never made any progress and ended up sticking with C. I really would like to have a go at Ada on my AVR as I do enjoy Ada programming. Thank you for your efforts. To all, I've followed the notes and I've made it through getting the C version of Blinky to run on my hardware. I'm running into an issue with the GNAT project file, however. I created a directory "C:\AVR\Projects \Blinky" that has blinky.adb, blinky.gpr and the regular Makefile from Warren's notes. The files are exactly the same except the MCU setting is different. When I run the make in that directory, I get the following error: C:\AVR\Projects\Blinky> make avr-gnatmake -g -XMCU=at90usb646 -f blinky.gpr avr-gcc -c -g -x ada blinky.gpr blinky.gpr:1:06: identifier expected blinky.gpr:2:01: compilation unit expected avr-gnatmake: "blinky.gpr" compilation error make: *** [all] Error 4 The line it is referring to is: > with "avr.gpr"; Should avr-gcc be running on blinky.gpr? I had expected blinky.adb, but not blinky.gpr. Then again I'm new to GNAT... Any suggestions for getting past this error? Do I need to specify a path to avr.gpr from C:\AVR\AvrAda1_1_0\lib\gnat somewhere? I'd really appreciate any pointers or advice. Thank you. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-26 0:26 ` b.robinson.jp @ 2010-08-26 7:48 ` David Sauvage 2010-08-26 12:59 ` Warren 2010-08-27 1:44 ` b.robinson.jp 0 siblings, 2 replies; 26+ messages in thread From: David Sauvage @ 2010-08-26 7:48 UTC (permalink / raw) On 26 août, 04:26, "b.robinson...@gmail.com" <b.robinson...@gmail.com> wrote: > Should avr-gcc be running on blinky.gpr? no >Any suggestions for getting past this error? There is a problem in your Makefile paste it and others could help you > Do I need to specify a path to avr.gpr no, if the path of avr.gpr is set in your ADA_PROJECT_PATH global env > I'd really appreciate any pointers or advice. The correct command would start like this: avr-gnatmake -P blinky.gpr -XMCU=at90usb646 ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-26 7:48 ` David Sauvage @ 2010-08-26 12:59 ` Warren 2010-08-27 1:44 ` b.robinson.jp 1 sibling, 0 replies; 26+ messages in thread From: Warren @ 2010-08-26 12:59 UTC (permalink / raw) David Sauvage expounded in news:8bfbd728-638e-4d27-b52e- 0107c6b2847d@i31g2000yqm.googlegroups.com: >> I'd really appreciate any pointers or advice. > The correct command would start like this: > > avr-gnatmake -P blinky.gpr -XMCU=at90usb646 Yes, the "-P" option is the key. Without it, avr-gnatmake doesn't know there is a project file involved. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-26 7:48 ` David Sauvage 2010-08-26 12:59 ` Warren @ 2010-08-27 1:44 ` b.robinson.jp 2010-08-27 12:51 ` Warren 1 sibling, 1 reply; 26+ messages in thread From: b.robinson.jp @ 2010-08-27 1:44 UTC (permalink / raw) > > Do I need to specify a path to avr.gpr > > no, if the path of avr.gpr is set in your ADA_PROJECT_PATH global env Thanks for the tip. I must have missed the ADA_PROJECT_PATH in the docs somewhere, because as soon as I set that variable, I was able to compile the project and generate my binary. The LED stays lit and does not flash, but at least I have something to work on now. :) ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-27 1:44 ` b.robinson.jp @ 2010-08-27 12:51 ` Warren 2010-09-02 3:39 ` b.robinson.jp 0 siblings, 1 reply; 26+ messages in thread From: Warren @ 2010-08-27 12:51 UTC (permalink / raw) b.robinson.jp@gmail.com expounded in news:1db702dd-3289-4e76-98fe- 08ab4bae38e1@v8g2000yqe.googlegroups.com: >>.. I was able to > compile the project and generate my binary. The LED stays lit and > does not flash, but at least I have something to work on now. :) Check that you have exactly the right part specified for compiling the unit. What happens is that the object code may be compatible, but the configured SRAM size is not. This is critical in the main program, where it initializes the stack pointer (SP) at startup. I ran into this when building for atmega328, which supports a 2K SRAM. I was using an atmega168 with a 1K SRAM instead, but is otherwise completely compatible with the 328. So everything would work until you _called_ something. The called routine might work (if it needed no local vars or kept them in registers). But when it would try to return to the calling program, it would go west. Building for the 328 sets the SP 1K higher than the 168 address wise, where there is no SRAM. So a return would go to address 16#FFFF#, since FF is what "no memory" returns. Compiling _libraries_ for a bigger part is ok, since it doesn't have to initialize the SP. But the main program has to be "right on" in this respect. In your case, I suspect that the delay routine is not returning properly. This strongly hints at the stack size problem. So check that MCU= parameter (I had to get a magnifying glass out to read my chip). Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-08-27 12:51 ` Warren @ 2010-09-02 3:39 ` b.robinson.jp 2010-09-02 16:11 ` Charmed Snark 0 siblings, 1 reply; 26+ messages in thread From: b.robinson.jp @ 2010-09-02 3:39 UTC (permalink / raw) Thanks for the suggestion. I do have the right chip number (I verified it on the surface of the IC too), and I do have the right IO port and pin number (verified with the C program). The C version compiles and runs as expected, so I think I'm going to have to study the bootstrapping process and get my hands wet. On Aug 27, 8:51 am, Warren <ve3...@gmail.com> wrote: > b.robinson...@gmail.com expounded in news:1db702dd-3289-4e76-98fe- > 08ab4bae3...@v8g2000yqe.googlegroups.com: > > >>.. I was able to > > compile the project and generate my binary. The LED stays lit and > > does not flash, but at least I have something to work on now. :) > > Check that you have exactly the right part specified for > compiling the unit. What happens is that the object code > may be compatible, but the configured SRAM size is not. This > is critical in the main program, where it initializes the > stack pointer (SP) at startup. > > I ran into this when building for atmega328, which supports > a 2K SRAM. I was using an atmega168 with a 1K SRAM instead, > but is otherwise completely compatible with the 328. > > So everything would work until you _called_ something. The > called routine might work (if it needed no local vars or kept > them in registers). But when it would try to return to the > calling program, it would go west. Building for the 328 > sets the SP 1K higher than the 168 address wise, where > there is no SRAM. So a return would go to address 16#FFFF#, > since FF is what "no memory" returns. > > Compiling _libraries_ for a bigger part is ok, since it > doesn't have to initialize the SP. But the main program > has to be "right on" in this respect. > > In your case, I suspect that the delay routine is not > returning properly. This strongly hints at the stack > size problem. So check that MCU= parameter (I had to > get a magnifying glass out to read my chip). > > Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: USB Boarduino on AVR-Ada Tutorial 2010-09-02 3:39 ` b.robinson.jp @ 2010-09-02 16:11 ` Charmed Snark 0 siblings, 0 replies; 26+ messages in thread From: Charmed Snark @ 2010-09-02 16:11 UTC (permalink / raw) b.robinson.jp@gmail.com expounded in news:3be87447-5b06-4fcc-a0ed- 7037659b81a5@m1g2000yqo.googlegroups.com: > Thanks for the suggestion. > > I do have the right chip number (I verified it on the surface of the > IC too), and I do have the right IO port and pin number (verified with > the C program). The C version compiles and runs as expected, so I > think I'm going to have to study the bootstrapping process and get my > hands wet. Another thing you can try is to code your own delay loop. Just do something in a loop that doesn't get optimized away (sometimes tricky). Then if it works with your delay routine, you know something is up with the called on. You might need the help of the: pragma Volatile(Variable); in your own delay loop. Otherwise, if you compile with -Os, you should be ok. Warren ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2010-09-02 16:11 UTC | newest] Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-08-04 2:50 USB Boarduino on AVR-Ada Tutorial Warren 2010-08-04 10:52 ` Brian Drummond 2010-08-04 12:42 ` Warren 2010-08-04 13:13 ` Warren 2010-08-04 21:26 ` Brian Drummond 2010-08-05 0:59 ` Warren 2010-08-22 22:41 ` Brian Drummond 2010-08-23 9:29 ` Tero Koskinen 2010-08-24 11:37 ` Brian Drummond 2010-08-24 12:25 ` Ludovic Brenta 2010-08-23 15:28 ` Warren 2010-08-23 22:08 ` Brian Drummond 2010-08-24 9:07 ` David Sauvage 2010-08-24 11:15 ` Brian Drummond 2010-08-24 13:40 ` Warren 2010-08-24 12:12 ` Brian Drummond 2010-08-05 14:53 ` Brian Drummond 2010-08-16 14:16 ` Warren 2010-08-23 22:10 ` Brian Drummond 2010-08-26 0:26 ` b.robinson.jp 2010-08-26 7:48 ` David Sauvage 2010-08-26 12:59 ` Warren 2010-08-27 1:44 ` b.robinson.jp 2010-08-27 12:51 ` Warren 2010-09-02 3:39 ` b.robinson.jp 2010-09-02 16:11 ` Charmed Snark
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox