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

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