Ada multitasking RTOS supported with opensource cross-compilers
Asked Answered
V

4

9

Which RTOSes do Ada have opensource/free cross-compilers available, with support for multitasking/multithreading?

I have an Atmel AT90USB162 chip which I want to program using Ada. My first option was to use AVR-Ada for programming it, but since it has no tasking support it's out of choice (and at now I don't have any clue on how turning it tasking supported). So I need a stronger approach. I thought about using QNX, but it's far more complex than my chip stands.

I got the info that AVR chip supports uC/OS-II and FreeRTOS. Are there free Ada cross-compilers for FreeRTOS or uC/OS-II?

Thanks.

Vaginectomy answered 25/10, 2011 at 11:55 Comment(0)
K
7

RTEMS supports GNAT at least for some architectures. However, since you mentioned Atmel AVR architecture, this is probably not supported due to architectural constraints (available memory mostly). RTEMS is very mature (it was open source before Linux was invented), and has been proven extremely useable in many projects.

Another option is MarteOS, which supports at Ada. However, the support of architectures has been very limited (initially x86 only).

So, depending on your project constraints you most likely have three options:

  1. Stay with AVR, and write your own runtime supporting tasking for Ada;
  2. Re-consider if you really need the run-time support for tasking; or
  3. Upgrade your architecture to one which is supported by an RTOS which supports Ada.

(I have first used RTEMS with GNAT Ada for a proprietary project based on ARM9TDMI core in around 2004-2005.)

Kickback answered 25/10, 2011 at 13:29 Comment(4)
Hi Schedler. I checked in README.configure documentation of RTEMS, AVR is also supported. So I shall read the documentation in more detail now, but I guess it's very promissing for using in my project. Thank you.Vaginectomy
The office suite that the company that developed RTEMS, OAR Corporation, is located in is adjacent to the building where I'm working right now. I take a walk around the park at lunch every day and go right past the big OAR sign.Denton
@MarcC - You don't wanna be up a creek without them! ;-)Pekin
RTEMS looks to be very powerful, and it's been updated since 1988 to 2011.Vaginectomy
P
6

Well, the only Ada compiler I know of that is Free Software is Gnat. So that reduces your question to "What RTOSes does Gnat support with tasking?"

ACT keeps a list of supported platforms here. The column on the right looks like mostly RTOSes or pseudo RTOSes. FreeRTOS and uC/OS-II don't seem to be on the list.

I do notice way down on the bottom of their list under "bare boards" an entry reading "AVR microcontroller ELF format (hosted on Windows)". That may be what you are looking for. However, I'd say there's a good chance their bare board ports don't support tasking either. In fact, thinking about it, that might be ACT's name for AVR-Ada. You'd have to check with ACT.

Also, it should be noted that it is very hard to find "gratis" binaries for many of the more esoteric gcc targets. This means you may either be forced to build the compiler yourself from sources (not even remotely for the faint of heart), or actually go buy a support package from ACT to get it.

Pekin answered 25/10, 2011 at 13:4 Comment(0)
M
6

I'm one of the original RTEMS developers and been the RTEMS Project lead since it transitioned from an Army research program to a traditional free software project. We try very hard to keep RTEMS as a high quality product with a great community.

The AVR is a quite small target and the RTEMS port is incomplete. Even if the RTEMS port were complete, I do not think there is an AVR with enough address space to support GNAT/RTEMS. GNAT maps each Ada task to a POSIX thread just as on GNU/Linux and the run-time footprint for a "real Ada" environment is large. I recall minimum executables in the 400K code range on a PowerPC. In comparison, the RTEMS minimum C executable is probably in the 32-40k range on that same target.

I am not that familiar with AVR-Ada but I would agree that it is highly unlikely to give you a full Ada environment.

The RTEMS Project has scripts which we use to build the GNU tools and test them. If you are interested in building tools for your own odd target, they can be a good guide. The procedure doesn't vary a lot for embedded targets.

Marc C.. since you are in Huntsville, we will have to get together for lunch sometimes. Our office is roughly across from Bridge Street. I really don't get to meet many RTEMS users. :(

Milliemillieme answered 9/2, 2012 at 21:21 Comment(3)
Very clarifying your response, @, thank you. I had taken a look in RTEMS documentation, when @Kickback talked about it (and I had not known about RTEMS till then). And despite of not having a complete port, I found it very interesting to use with AVR, even with all limitations. At least for learningship purposes. Most of AVR chips are very limited if you compare them to some Power PC or SPARC architectures. I developed some applications in Power PC on VxWorks, and simply they have programming paradigms totally different.Vaginectomy
But AVR users are normally used to these limitations, and the applications which use it normally do not require deep real-time constraints. In RTEMS document RTEMS CPU Architecture Supplement I found quite interesting the features which are available for using with AVR, so I suggested some my MSc students to work on the possibility to implement some features in AVR using RTEMS as a challenge.Vaginectomy
AVR-Ada is a fantastic open-source project, but now it's not complete. And I would choose to use this if I could, because it's implemented in a very intuitive way. The aim was to implement a 8-bit windows cross-compiler for some microcontrollers, but it lacks yet several good Ada features, that ones which are the good tastes of using Ada. For example, it does not support tasking, neither exceptions. It looks that will be a new release yet this year, but unfortunatelly the current state-of-art is not possible to use for preemptive applications. I hope next release fix this.Vaginectomy
M
3

We would love to see the AVR port become more complete! Encourage your students to join our development mailing list and ask questions.

RTEMS is in the same class of RTOS as VxWorks. That gives it a rich feature set that has to be trimmed to fit on smaller 8 and (some) 16 bit CPUs. Our challenge has been in identifying a "Tiny/RTEMS" feature profile to aim for. RTEMS is really very scalable but when you don't know what feature set would be meaningful on that class CPU, it leaves us with no concrete goal. Please help define the user requirements and a goal.

Also we really like to have a BSP that runs on a free simulator for every target architecture. SimulAVR was what I was using when I was actively working on the port. AdaCore used something called avrtest but it was more limited -- useful but limited.

Milliemillieme answered 13/2, 2012 at 22:28 Comment(1)
Thank you. I will suggest them to join the list. I guess it's a good opportunity for them to learn.Vaginectomy

© 2022 - 2024 — McMap. All rights reserved.