comp.lang.ada
 help / color / mirror / Atom feed
From: Devin <devin.inspiredby@gmail.com>
Subject: Re: Inspirels Ada on cortex tutorial linker issue
Date: Sun, 24 Jul 2016 21:35:02 -0700 (PDT)
Date: 2016-07-24T21:35:02-07:00	[thread overview]
Message-ID: <0f7d1cd7-bde9-4fe0-80e0-332e886586e4@googlegroups.com> (raw)
In-Reply-To: <lyr3aj7aao.fsf@pushface.org>

On Sunday, July 24, 2016 at 9:41:17 AM UTC+2, Simon Wright wrote:
> Devin writes:
> 
> > Yes, after looking at the assembly, I recompiled using:
> > $ gcc -c -mcpu=cortex-m0 -mthumb -mfloat-abi=soft program.adb
> >
> > From the looks of it, the exception handling is added at compile time
> > when making the program.o file?  Would I be able to edit system.ads to
> > turn off exception handling?
> 
> It turns out that it's the .fnstart/.fnend assembler directives.
> 
> It is indeed system.ads that needs changing, but I'd strongly advise not
> editing the installed one (unless you never intend to compile Ada for
> the Pi natively!).
> 
> I've been playing around with my own native system.ads and I can't see
> what needs to be tweaked. However, if I create a minimal runtime system
> using one of the AdaCore-supplied ARM system.ads's
> (ravenscar-sfp-stm32f4/arch, to be exact) the offending asm constructs
> don't appear.
> 
> To create this minimal RTS you need
> * a directory, say rts/
> * containing an empty directory adalib/
> * and a directory adainclude/ containing the system.ads to be used.
> 
> Then compile with this RTS:
> 
>  $ gcc --RTS=rts -c -u -f -mcpu=cortex-m0 -mthumb -mfloat-abi=soft program.adb
> 
> I've put a copy of the RTS I used at
> https://www.dropbox.com/s/iyff5ir5bl41hpd/rts.tar.gz?dl=0
> 
> Hope this works for you!

That got me quite a bit further to getting it running.  I did have to comment out a line:

pragma Restrictions (No_Task_At_Interrupt_Priority);

in order to get it to compile, it causes an error:

fatal error: system.ads is incorrectly formatted
unrecognized or incorrect restrictions pragma: No_Task_At_Interrupt_Priority
compilation abandoned

If I comment the line out, it compiles and links fine (but I can not get openOCD to load the firmware to the Nucleo32).

In openocd I get a warning saying that there are no flash banks found for addresses 10000000 and 10000100 and it says it writes 0 bytes from file program.bin and resets the target.  The Nucleo32 then starts running the same firmware that it shipped with.

Thank you very much for all your help, Simon.


  reply	other threads:[~2016-07-25  4:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23  5:23 Inspirels Ada on cortex tutorial linker issue Devin
2016-07-23  6:57 ` Simon Wright
2016-07-23  7:34   ` Devin
2016-07-23  8:07     ` Devin
2016-07-23 16:32       ` Simon Wright
2016-07-24  2:32         ` Devin
2016-07-24  7:41           ` Simon Wright
2016-07-25  4:35             ` Devin [this message]
2016-07-25  8:07               ` Simon Wright
2016-08-20 22:09 ` Maciej Sobczak
2016-08-21  1:30   ` Devin
2016-08-21  1:37     ` Devin
2016-08-21 14:38       ` Maciej Sobczak
2016-08-22  4:00         ` Devin
2016-08-22 11:37           ` Brian Drummond
2016-08-29 17:49             ` Nicholas Colin Paul de Gloucester
2016-08-29 21:51               ` rieachus
2016-08-30 14:55                 ` Nicolas Colin Paul de Gloucester
2016-08-31  0:01                   ` Dennis Lee Bieber
2016-08-31 10:15                     ` Simon Wright
2016-08-31 12:42                 ` Maciej Sobczak
2016-09-01  9:15                   ` Alejandro R. Mosteo
2016-09-01 16:33                   ` AdaMagica
2016-09-02  0:36                     ` Jeffrey R. Carter
2016-09-02 12:05                       ` Maciej Sobczak
2016-09-02 12:53                         ` Dmitry A. Kazakov
2016-09-02 15:24                           ` G.B.
2016-09-02 21:33                             ` Maciej Sobczak
2016-09-03  9:20                               ` G.B.
2016-09-03 13:33                                 ` Alejandro R. Mosteo
2016-09-04 15:08                                 ` Maciej Sobczak
2016-09-02 13:40                         ` AdaMagica
2016-09-03 11:58                           ` Brian Drummond
2016-09-03 12:12                             ` Björn Lundin
2016-08-30 12:33               ` Brian Drummond
2016-08-30 13:01                 ` Simon Wright
2016-08-30 15:06                 ` Nicolas Colin Paul de Gloucester
2016-08-31 10:34                   ` Brian Drummond
2016-08-31 20:58                     ` Simon Wright
2016-09-01 11:08                       ` Brian Drummond
2016-08-31 12:47                 ` Maciej Sobczak
2016-09-01  0:02                   ` Dennis Lee Bieber
2016-09-01  9:03                     ` Alejandro R. Mosteo
replies disabled

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