comp.lang.ada
 help / color / mirror / Atom feed
* Tasking on GNATAVR
@ 2012-04-30  3:17 Rego, P.
  2012-04-30 22:07 ` mjsilva
  0 siblings, 1 reply; 8+ messages in thread
From: Rego, P. @ 2012-04-30  3:17 UTC (permalink / raw)


Ok, now I got to build and burn the .hex in an Arduino Duemilanove atmega328p totally in Ada using GPL GNATAVR in GPS, following 
http://student.agh.edu.pl/~mkucia/wiki/doku.php?id=avrada
and much help from you guys. 

In short it consists of:
1) Converting a .xml (from AVR Studio) to the atmega328p package spec, which maps all the memory addresses of the chip (so I don't have to do it)
2) Using this spec package from a main file
3) GPS builds the .elf linking with a WinAVR object library
4) From command-line, convert the .elf in .hex and burn it into the chip using avrdude.

Now a simple blink program runs quite well, so runs accordingly as I burn it and start the chip.

At this point, we achieve the same coding paradigm than AVR Studio, but in Ada from GPS, not in C anymore.

But now I want to include tasking on the code, and I did not find so many resources in documentation (actually I just found http://docs.adacore.com/gnat-cross-docs/html/gnat_ugx_12.html). Anyway, I included 

   task My_Useless_Task;
   task body My_Useless_Task is
   begin
      null;
   end My_Useless_Task;

and when I tried to build, builder returned me

main.adb:13:04: construct not allowed in configurable run-time mode
main.adb:13:04: file s-parame.ads not found
main.adb:13:04: entity "System.Parameters.Unspecified_Size" not available
main.adb:13:04: violation of restriction "No_Tasking" at system.ads:52

I also tried to look inside system.ads (c:\gnat\2011\lib\avr\4.5.3\rts-ztp\adainclude\system.ads, which is installed with GNATAVR package), and there is plenty of pragma restrictions, including pragma Restrictions (No_Tasking). I commented this pragma Restrictions (No_Tasking), but just the 4th error line vanished.

So, what should I do to make the tasks work?



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

* Re: Tasking on GNATAVR
  2012-04-30  3:17 Tasking on GNATAVR Rego, P.
@ 2012-04-30 22:07 ` mjsilva
  2012-05-01  8:27   ` Brian Drummond
  2012-05-01 15:08   ` Tasking on GNATAVR Rego, P.
  0 siblings, 2 replies; 8+ messages in thread
From: mjsilva @ 2012-04-30 22:07 UTC (permalink / raw)


On Sunday, April 29, 2012 8:17:57 PM UTC-7, Rego, P. wrote:
> Ok, now I got to build and burn the .hex in an Arduino Duemilanove atmega328p totally in Ada using GPL GNATAVR in GPS, following 
> http://student.agh.edu.pl/~mkucia/wiki/doku.php?id=avrada
> and much help from you guys. 
> 
> In short it consists of:
> 1) Converting a .xml (from AVR Studio) to the atmega328p package spec, which maps all the memory addresses of the chip (so I don't have to do it)
> 2) Using this spec package from a main file
> 3) GPS builds the .elf linking with a WinAVR object library
> 4) From command-line, convert the .elf in .hex and burn it into the chip using avrdude.
> 
> Now a simple blink program runs quite well, so runs accordingly as I burn it and start the chip.
> 
> At this point, we achieve the same coding paradigm than AVR Studio, but in Ada from GPS, not in C anymore.
> 
> But now I want to include tasking on the code, and I did not find so many resources in documentation (actually I just found http://docs.adacore.com/gnat-cross-docs/html/gnat_ugx_12.html). Anyway, I included 
> 
>    task My_Useless_Task;
>    task body My_Useless_Task is
>    begin
>       null;
>    end My_Useless_Task;
> 
> and when I tried to build, builder returned me
> 
> main.adb:13:04: construct not allowed in configurable run-time mode
> main.adb:13:04: file s-parame.ads not found
> main.adb:13:04: entity "System.Parameters.Unspecified_Size" not available
> main.adb:13:04: violation of restriction "No_Tasking" at system.ads:52
> 
> I also tried to look inside system.ads (c:\gnat\2011\lib\avr\4.5.3\rts-ztp\adainclude\system.ads, which is installed with GNATAVR package), and there is plenty of pragma restrictions, including pragma Restrictions (No_Tasking). I commented this pragma Restrictions (No_Tasking), but just the 4th error line vanished.
> 
> So, what should I do to make the tasks work?

AFAIK, there is no AVR Ada runtime, so it would have to be written.  I have no idea how much work that would be.



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

* Re: Tasking on GNATAVR
  2012-04-30 22:07 ` mjsilva
@ 2012-05-01  8:27   ` Brian Drummond
  2012-05-01 15:44     ` Rego, P.
  2012-05-01 15:08   ` Tasking on GNATAVR Rego, P.
  1 sibling, 1 reply; 8+ messages in thread
From: Brian Drummond @ 2012-05-01  8:27 UTC (permalink / raw)


On Mon, 30 Apr 2012 15:07:53 -0700, mjsilva wrote:

> On Sunday, April 29, 2012 8:17:57 PM UTC-7, Rego, P. wrote:
>> Ok, now I got to build and burn the .hex in an Arduino Duemilanove
>> atmega328p totally in Ada using GPL GNATAVR in GPS, following
>> http://student.agh.edu.pl/~mkucia/wiki/doku.php?id=avrada and much help
>> from you guys.
>> 
>> In short it consists of:
>> 1) Converting a .xml (from AVR Studio) to the atmega328p package spec,
>> which maps all the memory addresses of the chip (so I don't have to do
>> it)
>> 2) Using this spec package from a main file 3) GPS builds the .elf
>> linking with a WinAVR object library 4) From command-line, convert the
>> .elf in .hex and burn it into the chip using avrdude.
>> 
>> Now a simple blink program runs quite well, so runs accordingly as I
>> burn it and start the chip.
>> 
>> At this point, we achieve the same coding paradigm than AVR Studio, but
>> in Ada from GPS, not in C anymore.
>> 
>> But now I want to include tasking on the code, and I did not find so
>> many resources in documentation (actually I just found
>> http://docs.adacore.com/gnat-cross-docs/html/gnat_ugx_12.html). Anyway,
>> I included
>> 
>>    task My_Useless_Task;
>>    task body My_Useless_Task is begin
>>       null;
>>    end My_Useless_Task;
>> 
>> and when I tried to build, builder returned me
>> 
>> violation of restriction "No_Tasking" at system.ads:52
>
>> So, what should I do to make the tasks work?
> 
> AFAIK, there is no AVR Ada runtime, so it would have to be written.  I
> have no idea how much work that would be.

Warren Gay reported success with experimental tasking on AVR some time 
ago, (about a year?) using the open source AVR-Ada toolchain (from 
Sourceforge). It was intended to be included in AVR-Ada 1.2 which is 
scheduled for release very soon, but I don't know if it's still included.

Search for Warren's AVR-Ada posts for some more information, and keep 
eyes open for AVR-Ada 1.2. 

I haven't tried the Adacore version so I don't know how/if they inter-
operate.

- Brian




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

* Re: Tasking on GNATAVR
  2012-04-30 22:07 ` mjsilva
  2012-05-01  8:27   ` Brian Drummond
@ 2012-05-01 15:08   ` Rego, P.
  2012-05-04  8:52     ` Brian Drummond
  1 sibling, 1 reply; 8+ messages in thread
From: Rego, P. @ 2012-05-01 15:08 UTC (permalink / raw)


> AFAIK, there is no AVR Ada runtime, so it would have to be written.  I have no idea how much work that would be.

Do you know where could I start from? 




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

* Re: Tasking on GNATAVR
  2012-05-01  8:27   ` Brian Drummond
@ 2012-05-01 15:44     ` Rego, P.
  2012-05-04  4:08       ` Building an RTS for my AVR Rego, P.
  0 siblings, 1 reply; 8+ messages in thread
From: Rego, P. @ 2012-05-01 15:44 UTC (permalink / raw)


> Warren Gay reported success with experimental tasking on AVR some time 
> ago, (about a year?) using the open source AVR-Ada toolchain (from 
> Sourceforge). It was intended to be included in AVR-Ada 1.2 which is 
> scheduled for release very soon, but I don't know if it's still included.

Do you remember where did he reported the success? (maybe there's info on how he did it).

> Search for Warren's AVR-Ada posts for some more information, and keep 
> eyes open for AVR-Ada 1.2. 
> I haven't tried the Adacore version so I don't know how/if they inter-
> operate.

I looked for his posts here and on google, but got no real success (at least not for tasking). When I tried avr-ada first time found very interesting, but the tasking feature was not present, so I began to look for other approaches, even some RTOSes. 

The AVR-Ada version 1.2 was not released yet, but in the status site http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Status it's said they "intend to release it sometime in early 2012", and this could be today, or 2012 dec. 31, which is so far, and could be for some years (since they just "intend") :p . Well, I would like to task on my arduinos now :-)



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

* Building an RTS for my AVR
  2012-05-01 15:44     ` Rego, P.
@ 2012-05-04  4:08       ` Rego, P.
  0 siblings, 0 replies; 8+ messages in thread
From: Rego, P. @ 2012-05-04  4:08 UTC (permalink / raw)


On Tuesday, May 1, 2012 12:08:30 PM UTC-3, Rego, P. wrote: 
> > AFAIK, there is no AVR Ada runtime, so it would have to be written.  I have no idea how much work that would be. 
> 
> Do you know where could I start from? 

Well, I'm trying to modify the RTS-ZFP putting the two folders 
c:\GNAT\2011\lib\gcc\avr\4.5.3\rts-zfp\adainclude\ 
c:\GNAT\2011\lib\gcc\i686-pc-mingw32\4.5.3\rts-sjlj\adainclude\ (from Windows RTS) 

side by side and try to resolve all the dependencies. But I'm sure there is a more clever way to do this, just don't know yet. So the question that remains is ... How can I construct by own AVR 8-bit RTS from stratch (for Dummies)? :p 



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

* Re: Tasking on GNATAVR
  2012-05-01 15:08   ` Tasking on GNATAVR Rego, P.
@ 2012-05-04  8:52     ` Brian Drummond
  2012-05-04 17:08       ` Rego, P.
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Drummond @ 2012-05-04  8:52 UTC (permalink / raw)


On Tue, 01 May 2012 08:08:30 -0700, Rego, P. wrote:

>> AFAIK, there is no AVR Ada runtime, so it would have to be written.  I
>> have no idea how much work that would be.
> 
> Do you know where could I start from?

Jacob said in another thread:
You might want to follow the AVR-Ada mailing list/newsgroup
(nntp+news.gmane.org:gmane.comp.hardware.avr.ada), even if your primary
embedded platform is a different one.

I had to add "news.gmane.org" to the newsservers list in my newsreader 
(Pan), then gmane.comp...ada appeared in the list of newsgroups.
There are references to Warren's work with threads, so possibly not full 
tasking, and to building an RTS. Lots of reading...

- Brian



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

* Re: Tasking on GNATAVR
  2012-05-04  8:52     ` Brian Drummond
@ 2012-05-04 17:08       ` Rego, P.
  0 siblings, 0 replies; 8+ messages in thread
From: Rego, P. @ 2012-05-04 17:08 UTC (permalink / raw)


> Jacob said in another thread:
> You might want to follow the AVR-Ada mailing list/newsgroup
> (nntp+news.gmane.org:gmane.comp.hardware.avr.ada), even if your primary
> embedded platform is a different one.

Great! I will add the group to my newsreader.

> I had to add "news.gmane.org" to the newsservers list in my newsreader 
> (Pan), then gmane.comp...ada appeared in the list of newsgroups.
> There are references to Warren's work with threads, so possibly not full 
> tasking, and to building an RTS. Lots of reading...

It worths reading :-)
Thanks.



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

end of thread, other threads:[~2012-05-04 17:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30  3:17 Tasking on GNATAVR Rego, P.
2012-04-30 22:07 ` mjsilva
2012-05-01  8:27   ` Brian Drummond
2012-05-01 15:44     ` Rego, P.
2012-05-04  4:08       ` Building an RTS for my AVR Rego, P.
2012-05-01 15:08   ` Tasking on GNATAVR Rego, P.
2012-05-04  8:52     ` Brian Drummond
2012-05-04 17:08       ` Rego, P.

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