comp.lang.ada
 help / color / mirror / Atom feed
* GNAT GPL 2015 Troubles
@ 2015-06-20 18:38 RasikaSrinivasan
  2015-06-20 19:31 ` Simon Wright
  0 siblings, 1 reply; 13+ messages in thread
From: RasikaSrinivasan @ 2015-06-20 18:38 UTC (permalink / raw)


all

I upgrade my gnat to GPL 2015 on windows. I use both the Windows native version as well as the ARM elf hosted on Windows. gnat GPL 2014 worked just fine in this configuration except for some minor issues. 

Several things are no longer working for me and I am at a loss to find the best way to fix it:

a. Used to be able to ask GPS for help with predefined packages like so :

   From GPS, Help \ GNAT runtime \ Ada \ Text_io 

     - this would give me the spec for the package and I could browse the spec

   I am no longer able to do this. In particular this is a problem for
   packages like Ada.Interrupts.Names 

b. It would appear that intellisense for predefined packages don't work anymore.

c. I don't have to specify the location of the profile for ARM targets (this is great) but I am not sure which profile the system is using. browsing the directories there appear to be 2 ravenscar profiles being installed.

Seeking some pointers on any of the above.

thanks, srini


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-20 18:38 GNAT GPL 2015 Troubles RasikaSrinivasan
@ 2015-06-20 19:31 ` Simon Wright
  2015-06-21  9:55   ` Stephen Leake
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Wright @ 2015-06-20 19:31 UTC (permalink / raw)


"RasikaSrinivasan@gmail.com" <RasikaSrinivasan@gmail.com> writes:

> c. I don't have to specify the location of the profile for ARM targets
> (this is great) but I am not sure which profile the system is
> using. browsing the directories there appear to be 2 ravenscar
> profiles being installed.

I don't know the Windows setup, but - there are 2 Ravenscar profiles, as
you say.

In your project's GPR (you need to be using GNAT Projects), you should
be able to say

   for Runtime ("ada") use "ravenscar-sfp-stm32f4";

for the small-footprint profile, and

   for Runtime ("ada") use "ravenscar-full-stm32f4";

for the profile that allows exception propagation, has the containers
etc etc (but of course still restricted tasking!)

Check out $prefix/arm-eabi/lib/gnat (/ => \, of course).

It looks as though you can use the scenario variable BOARD, possible
values STM32F4-DISCO, STM32F429-DISCO, or STM32F7-EVAL to select the
board you're using.

One thing that puzzled me is how setup_pll.adb knows which board it's on
(I know the max clock frequency is different for STM32F4-DISCO and
STM32F429-DISCO, no idea about STM32F7-EVAL).

It would be a lot easier to navigate this IF ADACORE WOULD STOP USING
"use"!!! It would be far simpler to understand

   procedure Initialize_Clocks is

      HSECLK    : constant Integer := Integer (HSE_Clock (MCU_ID.DEV_ID));
      MCU_ID_Cp : constant MCU_ID_Register := MCU_ID;

if they hadn't said

with System.STM32F4; use System.STM32F4;             << MCU_ID
with System.STM32F4.RCC;
with System.BB.Parameters; use System.BB.Parameters; << HSE_Clock 

It turns out they're using the MCU device ID code, para 38.6.1 of ST's
document 018909 rev 7 (page 1667!)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-20 19:31 ` Simon Wright
@ 2015-06-21  9:55   ` Stephen Leake
  2015-06-21 11:13     ` Simon Wright
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Leake @ 2015-06-21  9:55 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> It would be a lot easier to navigate this IF ADACORE WOULD STOP USING
> "use"!!! It would be far simpler to understand
>
>    procedure Initialize_Clocks is
>
>       HSECLK    : constant Integer := Integer (HSE_Clock (MCU_ID.DEV_ID));
>       MCU_ID_Cp : constant MCU_ID_Register := MCU_ID;
>
> if they hadn't said
>
> with System.STM32F4; use System.STM32F4;             << MCU_ID
> with System.STM32F4.RCC;
> with System.BB.Parameters; use System.BB.Parameters; << HSE_Clock 

Does ada-mode navigation help here? Since these are pre-compiled files,
C-c C-d should always show the declaration of these identifiers, even if
your full project does not yet compile.

-- 
-- Stephe

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-21  9:55   ` Stephen Leake
@ 2015-06-21 11:13     ` Simon Wright
  2015-06-21 16:00       ` RasikaSrinivasan
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Wright @ 2015-06-21 11:13 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Does ada-mode navigation help here? Since these are pre-compiled
> files, C-c C-d should always show the declaration of these
> identifiers, even if your full project does not yet compile.

It certainly would if I was trying to build with them rather than just
poking about! Good point, though I'd still prefer not to see 'use' (I
make an exception for Ada.Text_IO, though :-)

I seem to remember that you need to keep .ali's even after a failed
compilation for this to work - -gnatqQ


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-21 11:13     ` Simon Wright
@ 2015-06-21 16:00       ` RasikaSrinivasan
  2015-06-21 16:21         ` Simon Wright
  2015-06-23 13:35         ` Stephen Leake
  0 siblings, 2 replies; 13+ messages in thread
From: RasikaSrinivasan @ 2015-06-21 16:00 UTC (permalink / raw)


On Sunday, June 21, 2015 at 7:13:16 AM UTC-4, Simon Wright wrote:
> Stephen Leake <stephen_leake@stephe-leake.org> writes:
> 
> > Does ada-mode navigation help here? Since these are pre-compiled
> > files, C-c C-d should always show the declaration of these
> > identifiers, even if your full project does not yet compile.
> 
> It certainly would if I was trying to build with them rather than just
> poking about! Good point, though I'd still prefer not to see 'use' (I
> make an exception for Ada.Text_IO, though :-)
> 
> I seem to remember that you need to keep .ali's even after a failed
> compilation for this to work - -gnatqQ

navigation did not work for me. i browsed and found the files but it is not ideal. A strong vote for your point about use clauses as well.

Simon Another question - do you have any examples that work with AHB2? i am not able get the AHB2 peripherals to work at all.

also - is there a way you can write up the process of setting up a zfp for say TMSC123 or some other such Cortex core?

cheers, siren

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-21 16:00       ` RasikaSrinivasan
@ 2015-06-21 16:21         ` Simon Wright
  2015-06-23 14:07           ` Stephen Leake
  2015-06-23 13:35         ` Stephen Leake
  1 sibling, 1 reply; 13+ messages in thread
From: Simon Wright @ 2015-06-21 16:21 UTC (permalink / raw)


"RasikaSrinivasan@gmail.com" <RasikaSrinivasan@gmail.com> writes:

> navigation did not work for me. i browsed and found the files but it
> is not ideal. A strong vote for your point about use clauses as well.

For RTS components (e.g. Ada.Interrupts.Names.EXTI0_IRQ) I end up in the
native RTS. In spite of having the correct GPR loaded.

> Simon Another question - do you have any examples that work with AHB2?
> i am not able get the AHB2 peripherals to work at all.

No, only AHB1, sorry. Aside from RCC, that is, and I'm only using the
STM32Cube interface for that.

> also - is there a way you can write up the process of setting up a zfp
> for say TMSC123 or some other such Cortex core?

ZFP should be easy enough per se, the problem would be the board setup
and clock configuration; the clock configuration seems to be
manufacturer-specific?

Would Maciej's book help?

http://www.lulu.com/shop/maciej-sobczak/ada-and-spark-on-arm-cortex-m/paperback/product-22195745.html
http://inspirel.com/articles/Ada_On_Cortex.html


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-21 16:00       ` RasikaSrinivasan
  2015-06-21 16:21         ` Simon Wright
@ 2015-06-23 13:35         ` Stephen Leake
  1 sibling, 0 replies; 13+ messages in thread
From: Stephen Leake @ 2015-06-23 13:35 UTC (permalink / raw)


"RasikaSrinivasan@gmail.com" <RasikaSrinivasan@gmail.com> writes:

> On Sunday, June 21, 2015 at 7:13:16 AM UTC-4, Simon Wright wrote:
>> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>> 
>> > Does ada-mode navigation help here? Since these are pre-compiled
>> > files, C-c C-d should always show the declaration of these
>> > identifiers, even if your full project does not yet compile.
>> 
>> It certainly would if I was trying to build with them rather than just
>> poking about! Good point, though I'd still prefer not to see 'use' (I
>> make an exception for Ada.Text_IO, though :-)
>> 
>> I seem to remember that you need to keep .ali's even after a failed
>> compilation for this to work - -gnatqQ
>
> navigation did not work for me. 

Can you say why, or show the commands you used to test? I'd like to
improve this.

-- 
-- Stephe


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-21 16:21         ` Simon Wright
@ 2015-06-23 14:07           ` Stephen Leake
  2015-06-23 17:07             ` Simon Wright
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Leake @ 2015-06-23 14:07 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> "RasikaSrinivasan@gmail.com" <RasikaSrinivasan@gmail.com> writes:
>
>> navigation did not work for me. i browsed and found the files but it
>> is not ideal. A strong vote for your point about use clauses as well.
>
> For RTS components (e.g. Ada.Interrupts.Names.EXTI0_IRQ) I end up in the
> native RTS. In spite of having the correct GPR loaded.

"gnat list" is used to get the system library; testing with GNAT GPL
2014:

with a project file foo.gpr containing

   package Builder is
      for Default_Switches ("ada") use ("--RTS=sjlj");
   end Builder;

'gnat list -v -P foo.gpr' returns the wrong system library.

'gnat list -v --RTS=sjlj' returns the correct system library.

So the solution is to change gnat-core.el gnat-get-paths-1 to pass
--RTS=... to 'gnat list', but in a general way.

We could add a project variable 'runtime' (or 'rts'?), with default
value "zcx".

The gnat tools don't accept --RTS=zcx (at least not with a default
install), so we have to check for that special case at each use.


-- 
-- Stephe

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-23 14:07           ` Stephen Leake
@ 2015-06-23 17:07             ` Simon Wright
  2015-06-23 19:09               ` Simon Wright
  2015-06-23 23:25               ` RasikaSrinivasan
  0 siblings, 2 replies; 13+ messages in thread
From: Simon Wright @ 2015-06-23 17:07 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Simon Wright <simon@pushface.org> writes:
>
>> "RasikaSrinivasan@gmail.com" <RasikaSrinivasan@gmail.com> writes:
>>
>>> navigation did not work for me. i browsed and found the files but it
>>> is not ideal. A strong vote for your point about use clauses as well.
>>
>> For RTS components (e.g. Ada.Interrupts.Names.EXTI0_IRQ) I end up in the
>> native RTS. In spite of having the correct GPR loaded.
>
> "gnat list" is used to get the system library; testing with GNAT GPL
> 2014:
>
> with a project file foo.gpr containing
>
>    package Builder is
>       for Default_Switches ("ada") use ("--RTS=sjlj");
>    end Builder;
>
> 'gnat list -v -P foo.gpr' returns the wrong system library.
>
> 'gnat list -v --RTS=sjlj' returns the correct system library.
>
> So the solution is to change gnat-core.el gnat-get-paths-1 to pass
> --RTS=... to 'gnat list', but in a general way.
>
> We could add a project variable 'runtime' (or 'rts'?), with default
> value "zcx".
>
> The gnat tools don't accept --RTS=zcx (at least not with a default
> install), so we have to check for that special case at each use.

Given AdaCore's intention to stop gnat make supporting projects, I
suppose it's hardly surprising that gnat list doesn't understand the
full syntax of projects.

GCC 5.1.0 and GNAT GPL 2015 behave the same way as you report.

I'd prefer 'runtime' (or 'rts') to have default value nil. Or am I
thinking of the corresponding elisp custom setting?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-23 17:07             ` Simon Wright
@ 2015-06-23 19:09               ` Simon Wright
  2015-06-23 23:25               ` RasikaSrinivasan
  1 sibling, 0 replies; 13+ messages in thread
From: Simon Wright @ 2015-06-23 19:09 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> I'd prefer 'runtime' (or 'rts') to have default value nil

and then don't tell gnat list anything.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-23 17:07             ` Simon Wright
  2015-06-23 19:09               ` Simon Wright
@ 2015-06-23 23:25               ` RasikaSrinivasan
  2015-06-24  5:14                 ` Pascal Obry
  1 sibling, 1 reply; 13+ messages in thread
From: RasikaSrinivasan @ 2015-06-23 23:25 UTC (permalink / raw)



> 
> Given AdaCore's intention to stop gnat make supporting projects, I
> suppose it's hardly surprising that gnat list doesn't understand the
> full syntax of projects.
> 

Is this in favor of gprbuild? 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-23 23:25               ` RasikaSrinivasan
@ 2015-06-24  5:14                 ` Pascal Obry
  2015-06-24 11:34                   ` David Botton
  0 siblings, 1 reply; 13+ messages in thread
From: Pascal Obry @ 2015-06-24  5:14 UTC (permalink / raw)


Le mardi 23 juin 2015 à 16:25 -0700, RasikaSrinivasan@gmail.com a écrit
 :
> Is this in favor of gprbuild? 

Yes.

-- 
  Pascal Obry /  Magny Les Hameaux (78)

  The best way to travel is by means of imagination

  http://v2p.fr.eu.org
  http://www.obry.net

  gpg --keyserver keys.gnupg.net --recv-key F949BD3B

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: GNAT GPL 2015 Troubles
  2015-06-24  5:14                 ` Pascal Obry
@ 2015-06-24 11:34                   ` David Botton
  0 siblings, 0 replies; 13+ messages in thread
From: David Botton @ 2015-06-24 11:34 UTC (permalink / raw)


> > Is this in favor of gprbuild? 
> 
> Yes.

Does that mean that gprbuild will be upstreamed to the FSF along with its dependencies?

David Botton

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-06-24 11:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-20 18:38 GNAT GPL 2015 Troubles RasikaSrinivasan
2015-06-20 19:31 ` Simon Wright
2015-06-21  9:55   ` Stephen Leake
2015-06-21 11:13     ` Simon Wright
2015-06-21 16:00       ` RasikaSrinivasan
2015-06-21 16:21         ` Simon Wright
2015-06-23 14:07           ` Stephen Leake
2015-06-23 17:07             ` Simon Wright
2015-06-23 19:09               ` Simon Wright
2015-06-23 23:25               ` RasikaSrinivasan
2015-06-24  5:14                 ` Pascal Obry
2015-06-24 11:34                   ` David Botton
2015-06-23 13:35         ` Stephen Leake

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