Re: Help with RTEMS C User’s Guide

Joel Sherrill joel at rtems.org
Tue Jan 24 13:43:40 UTC 2017


On Jan 24, 2017 12:55 AM, "Tanu Hari Dixit" <tokencolour at gmail.com> wrote:

Hello Devs,

I have been trying to setup a makefile so as to execute the various code
snippets given in the C User's guide for RTEMS (
https://docs.rtems.org/doc-current/share/rtems/html/c_user/
index.html#SEC_Contents) and have failed miserably. Can you please help me
with this?

I have made a file with the first example of printing object names (
https://docs.rtems.org/doc-current/share/rtems/html/c_user/
Key-Concepts-Object-Names.html#Key-Concepts-Object-Names) and i use the
following command to use sparc-rtems4.12-gcc to compile this program

sparc-rtems4.12-gcc --pipe -B/home/thd/development/rtems/
src/builds/erc32_1/sparc-rtems4.12/erc32/lib -specs bsp_specs -qrtems -Wall
-g -O2 -o rtems_object_try rtems_object_try.c

but when i do ./rtems_object_try I get:

./rtems_object_try: Invalid argument


The error is correct if the I'd passed into the method doesn't correspond
to an object that has been created. This is an example of a helper function
and would normally be part of a larger application.

If you called it during the initialization of ticker and passed in a task
ID, it should work.


I narrowed in on the above compiler command by reading the makefile as
given here(https://github.com/alanc98/rki/blob/master/Makefile).

What is it that I am missing?

Also is it necessary to use sparc-rtems4.12-gcc and not the gcc available
to me normally on my machine. When I use gcc,
I get the following error:


thd at thd-Inspiron-5537:~/development/rtems/src/programs/rtems_object$ gcc
--pipe -B/home/thd/development/rtems/src/builds/erc32_1/sparc-rtems4.12/erc32/lib
-specs bsp_specs -qrtems -Wall -g -O2 -o rtems_object_try
rtems_object_try.c
In file included from /home/thd/development/rtems/sr
c/builds/erc32_1/sparc-rtems4.12/erc32/lib/include/rtems/
score/object.h:26:0,
                 from /home/thd/development/rtems/sr
c/builds/erc32_1/sparc-rtems4.12/erc32/lib/include/rtems/score/thread.h:30,
                 from /home/thd/development/rtems/sr
c/builds/erc32_1/sparc-rtems4.12/erc32/lib/include/rtems/score/heap.h:22,
                 from /home/thd/development/rtems/sr
c/builds/erc32_1/sparc-rtems4.12/erc32/lib/include/rtems/rtems/types.h:26,
                 from /home/thd/development/rtems/sr
c/builds/erc32_1/sparc-rtems4.12/erc32/lib/include/rtems.h:31,
                 from rtems_object_try.c:1:
/home/thd/development/rtems/src/builds/erc32_1/sparc-rtems4.
12/erc32/lib/include/rtems/score/rbtree.h:21:22: fatal error: sys/tree.h:
No such file or directory
 #include <sys/tree.h>
                      ^
compilation terminated.


You can't use the native compiler on RTEMS examples except for some POSIX
API examples and tests which are constructed to run both on RTEMS and the
native host. But they aren't tested often. In the native mode.



I am not able to understand what is wrong. It would be great if you could
point that out.
Thank you,
Tanu Hari Dixit.

_______________________________________________
devel mailing list
devel at rtems.org
http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170124/5840b0d1/attachment-0001.html>


More information about the devel mailing list