RTEMS on Virtex 4

Joel Sherrill joel.sherrill at OARcorp.com
Fri May 31 16:09:01 UTC 2013


On 5/31/2013 8:14 AM, Sebastian Huber wrote:
> Hello Stefan,
>
> On 05/31/2013 12:57 PM, Gempeler Stefan wrote:
>> Hi,
>>
>> First I would like to introduce myself: the last couple of years I developed
>> software for PCs and embedded systems (always worked on "bare metal" ARM etc.
>> or on a runnung "big" OS). Therefore I never had to use and set up an OS on an
>> embedded system. Now I have to evaluate one for a space project which should
>> run on the following hardware:
>>
>> - Xilinx Virtex4, PowerPC405
>>
>> - Evaluationboard: ML410
>>
>> - final design: RAM: max. 192 kB for program and data
>>
>> Our system should support (estimation):
>>
>> - 5 threads
>>
>> - accurate system time
>>
>> - around 5 interrupts: peripheral (UARTs + IO)
>>
>> - around 5 mutex
>>
>> - around 5 semaphores
>>
>> - …
> you execute the program out of the RAM?
>
>> I came across the RTEMS project which seems to be very interesting. Since I'm
>> quite unexperienced in setting up such a system, I went through the
>> documentation and some websites which made me build a "running" system:
>>
>> - built the rtems system with the system builder:
>>
>>   >
>> http://www.rtems.org/ftp/pub/rtems/people/chrisj/source-builder/source-builder.html
>>
>> - set up eclipse inspired by
>>
>>   > http://www.rtems.org/pipermail/rtems-users/2012-February/009439.html
>>
>> - working on RTEMS commit e67025e3900f23e1b9a25b939d7bff37a9c5e9f0
>>
>> - made some changes on BSP "virtex"
>>
>> - took the init.c from examples-v2/hello (tested all 3: Classic, POSIX,
>> Classic+POSIX)
>>
>> -> now I've got a "Hello World" application running on the evaluation board
>> using an UART as stdio J
>>
>> So far so good, now my Questions:
>>
>> 1. When I try to add some code the system, it does not work anymore. Well, I'm
>> not surprised when I consider my tinkering ;-)
>>
>> 2. The test program is only a simple "Hello World" and it already consumes 2/3
>> of our memory, which is a no-go:
>>
>> text       data        bss         dec        hex    filename
>>
>> 126520    1724      4004   132248   20498  o-optimize/rtems-app.exe
>>
>>      Ok, I'm sure that the system I put together is not optimized at all, but
>> I'm still quite surprised...
> printf() and the Termios interface (do you need it?) needs a lot of code space
> and the PowerPC code itself is not very dense.  It is possible to strip down a
> RTEMS system, but in general RTEMS is not a ultra low code size system.
Right. I have also seen getting the time of day to print it add 10-20K 
of code.

Can you post your hello world version? And how you configured RTEMS.

FWIW -Os instead of -O2 on gcc will reduce ~10% code space.  And I have 
experimented
with using gcc function sections which reduced the test executables by 
about 50% on
average.

And sometimes BSPs accidentally include references that increase the 
minimum footprint.
I fixed a Makefile bug on one BSP that knocked 40K off the minimum 
executable.

And to add one final note.. my recollection is that the head is using a 
newlib
version that requires POSIX to be enabled. This increases the footprint 
also.
Sebastian.. do you remember the details on this? We need to address it.

>> 3. I also got stuck (and confused) using interrupts: rtems_interrupt_catch() as
>> mentioned in the RTEMS C User’s Guide seems to be deprecated. Tried the
>> BSP_install_rtems_irq_handler(), but didn't succeed either...
> The PowerPC BSPs should provide this interface:
>
> http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__rtems__interrupt__extension.html
>
> In case this doesn't work with the virtex4 BSP, then we should fix this.
RTEMS has two interrupt models -- Simple Vectored and Programmable Interrupt
Controller model. The choice is target architecture dependent based on 
whether
the target processor normally includes a PIC or not.

rtems_interrupt_catch() is only for Simple Vectored architectures and the
documentation doesn't reflect that yet.

The PowerPC, x86, ARM, and MIPS use the PIC model interface pointed to
by Sebastian. This allows the BSP to integrate board specific code to vector
interrupts.
>> 4. Most important: To have a good feeling about the correct setup of the
>> system, I would appreciate to get in touch with an expert who helps me to move
>> on setting up for evaluating RTEMS. Where can I get such additional support for
>> our system (http://support.rtems.com/ and http://www.rtems.com/support.html
>> seems to be down)?
> Oh, these links are broken.
>
It looks like the web server needs attention after an upgrade. It will be
up for a few minutes and then die.

If you have questions, feel free to ask me privately.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985




More information about the users mailing list