Skip to contentSkip to conversation

Problem to cross-compile Xenomai user-space support

Xenomai-help Chtourou Sonda 4 participants 14 messages Mar 25, 2010 – Mar 30, 2010

lore
Share & tools
lore
#0 lore raw

Dears,

I built the uClinux kernel for NIOS II and it run well on the target board. I followed the typical actions available here : http://www.nioswiki.com/

Now, I want to add a co-scheduler xenomai to the kernel (uclinux) to reduce its latency. I followed these steps: (http://www.xenomai.org/documentation/xenomai-2.5/README.INSTALL)

$ $xenomai-2.5.1/scripts/prepare-kernel.sh --arch=nios2 --adeos=$xenomai-2.5.1/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch
  --linux=$linux_tree
$ $xenomai-2.5.1/configure --host=nios2-linux
$ make install DESTDIR=$uClinux-dist/romfs

But, in this step, I got this error:

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o  ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

what can I do? Please help
Regards,

#1 lore raw
Quoted 3 lines · Chtourou Sonda

Dears,

Hi,

Quoted 5 lines

I built the uClinux kernel for NIOS II and it run well on the target board. I followed the typical actions available here : http://www.nioswiki.com/

Now, I want to add a co-scheduler xenomai to the kernel (uclinux) to reduce its latency. I followed these steps: (http://www.xenomai.org/documentation/xenomai-2.5/README.INSTALL)

I've tried to reproduce your compilation error but without success.

For using Xenomai on NIOS II processor with uClinux, you must add extra hardware in your SoPC design as explained in this tutorial (http://uuu.enseirb.fr/~kadionik/nios2-xenomai/Xenomai%20on%20NIOS%20II%20Softcore%20Processor%20Guide-v1.1.pdf).

It is OK on my Altera 1S10 board with Xenomai v2.5.1 (see traces).

Sincerely;

Patrice
========================================

Uncompressing Linux... Ok, booting the kernel.
Linux version 2.6.30 ([email protected]) (gcc version 3.4.6) #4 PREEMPT Sun Mar 0

uClinux/Nios II
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064 Kernel command line:
NR_IRQS:32
PID hash table entries: 64 (order: 6, 256 bytes)
I-pipe 1.1-00: pipeline enabled.
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory available: 12108k/3990k RAM, 0k/0k ROM (1931k kernel code, 2059k data) Calibrating delay loop... 24.06 BogoMIPS (lpj=120320)
Mount-cache hash table entries: 512
net_namespace: 264 bytes
NET: Registered protocol family 16
init_BSP(): registering device resources
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
I-pipe: Domain Xenomai registered.
Xenomai: hal/nios2 started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.5.1 (Speed Of Light) loaded.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.
io scheduler noop registered
io scheduler deadline registered (default)
ttyS0 at MMIO 0x810840 (irq = 5) is a Altera UART
console [ttyS0] enabled

Quoted 36 lines
$ $xenomai-2.5.1/scripts/prepare-kernel.sh --arch=nios2 
--adeos=$xenomai-2.5.1/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch
  --linux=$linux_tree
$ $xenomai-2.5.1/configure --host=nios2-linux
$ make install DESTDIR=$uClinux-dist/romfs

But, in this step, I got this error:

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc
-Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit » make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite » make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

what can I do? Please help

Regards,

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 13 lines
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
#2 lore raw

Hi Patrice,

Many thanks for the tutorial, Now I am able to run xenomai patched uclinux on my DE2-70 board. But the kernel doesn't boot unless I modified one file :linux-2.6/arch/nios2/kernel/time.c

na_timer0 -> na_sys_clock_timer which I guess is the clock timer used by Linux. Did you manually patch this file? The adeos patch doesn't seem to change this part.

currently my timer settings are

/proc/xenomai>cat timer status=on+watchdog:setup=1030:clock=1638046732:timerdev=hrtimer:clockdev=hrclock Does it looks all right?

Best Regards,
Huan
________________________________________
From: [email protected] [[email protected]] On Behalf Of Patrice Kadionik [[email protected]]
Sent: 28 March 2010 15:26
To: Chtourou Sonda
Cc: [email protected]
Subject: Re: [Xenomai-help] Problem to cross-compile Xenomai user-space support

Le 20:59, Chtourou Sonda a écrit :
Dears,
Hi,

I built the uClinux kernel for NIOS II and it run well on the target board. I followed the typical actions available here : http://www.nioswiki.com/

Now, I want to add a co-scheduler xenomai to the kernel (uclinux) to reduce its latency. I followed these steps: (http://www.xenomai.org/documentation/xenomai-2.5/README.INSTALL)
I've tried to reproduce your compilation error but without success.

For using Xenomai on NIOS II processor with uClinux, you must add extra hardware in your SoPC design as explained in this tutorial (http://uuu.enseirb.fr/~kadionik/nios2-xenomai/Xenomai%20on%20NIOS%20II%20Softcore%20Processor%20Guide-v1.1.pdf).

It is OK on my Altera 1S10 board with Xenomai v2.5.1 (see traces).

Sincerely;

Patrice
========================================

Uncompressing Linux... Ok, booting the kernel.
Linux version 2.6.30 ([email protected]) (gcc version 3.4.6) #4 PREEMPT Sun Mar 0

uClinux/Nios II
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064 Kernel command line:
NR_IRQS:32
PID hash table entries: 64 (order: 6, 256 bytes)
I-pipe 1.1-00: pipeline enabled.
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory available: 12108k/3990k RAM, 0k/0k ROM (1931k kernel code, 2059k data) Calibrating delay loop... 24.06 BogoMIPS (lpj=120320)
Mount-cache hash table entries: 512
net_namespace: 264 bytes
NET: Registered protocol family 16
init_BSP(): registering device resources
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
I-pipe: Domain Xenomai registered.
Xenomai: hal/nios2 started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.5.1 (Speed Of Light) loaded.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.
io scheduler noop registered
io scheduler deadline registered (default)
ttyS0 at MMIO 0x810840 (irq = 5) is a Altera UART
console [ttyS0] enabled

$ $xenomai-2.5.1/scripts/prepare-kernel.sh --arch=nios2 --adeos=$xenomai-2.5.1/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch
  --linux=$linux_tree
$ $xenomai-2.5.1/configure --host=nios2-linux
$ make install DESTDIR=$uClinux-dist/romfs

But, in this step, I got this error:

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

what can I do? Please help
Regards,

_______________________________________________
Xenomai-help mailing list [email protected]<mailto:[email protected]>
https://mail.gna.org/listinfo/xenomai-help

--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +

+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
#3 lore raw
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 1 line

what can I do? Please help

Please try xenomai 2.5.2

Signature · 1 line
					    Gilles.
#4 lore raw
Quoted 17 lines · Gilles Chanteperdrix
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 6 lines
Quoted 2 lines

what can I do? Please help

Please try xenomai 2.5.2

Hi Gilles,

I've done this with the 2.5.2 version and I have had the same problem. It is the consequence of another one earlier in the compilation process. After the xenomai configuration for NIOS II:

$ ./configure --host=nios2-linux

the generated src/include/xeno_config.h configuration file has CONFIG_XENO_FASTSYNCH not configured:
...
/* config */
/* #undef CONFIG_XENO_FASTSYNCH */
...

If you make the compilation, it fails on the src/skins/common/sem_heap.c compilation. You have in this files 2 similar functions
line 100: static void xeno_init_sem_heaps_inner(void)
and
line 118: void xeno_init_sem_heaps(void)

There is a mismatch in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration).
In this case it conflits with the macro #define xeno_init_sem_heaps() line 9 in the src/skins/common/sem_heap.h file and the void xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c

I don't know what in the right correction to do in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition.

If I suppress the line 9 (#define ...) in the src/skins/common/sem_heap.h file, it compiles until problems for src/testsuite/unit tool:
cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here).
check-vdso.c compilation: in the src/testsuite/unit/Makefile.in file, the @CONFIG_XENO_FASTSYNCH_TRUE@ controls the check-vdso compilation. it is not completely inhibited when CONFIG_XENO_FASTSYNCH is not configured (the case here).

I have corrected by hand these 2 problems and Xenomai v2.5.2 is OK on my NIOS II board.

Gilles, what is the right modification to make on the src/skins/common/sem_heap.h file when CONFIG_XENO_FASTSYNCH is not defined during Xenomai configration?

Cheers;

Patrice

--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +

+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
#5 lore raw
Quoted 65 lines · Patrice Kadionik
Quoted 17 lines · Gilles Chanteperdrix
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 6 lines
Quoted 2 lines

what can I do? Please help

Please try xenomai 2.5.2

Hi Gilles,

I've done this with the 2.5.2 version and I have had the same problem. It is the consequence of another one earlier in the compilation process. After the xenomai configuration for NIOS II:

$ ./configure --host=nios2-linux

the generated src/include/xeno_config.h configuration file has CONFIG_XENO_FASTSYNCH not configured:
...
/* config */
/* #undef CONFIG_XENO_FASTSYNCH */
...

If you make the compilation, it fails on the src/skins/common/sem_heap.c compilation.
You have in this files 2 similar functions
line 100: static void xeno_init_sem_heaps_inner(void)
and
line 118: void xeno_init_sem_heaps(void)

There is a mismatch in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration). In this case it conflits with the macro #define xeno_init_sem_heaps() line 9 in the src/skins/common/sem_heap.h file and the void xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c

I don't know what in the right correction to do in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition.

If I suppress the line 9 (#define ...) in the src/skins/common/sem_heap.h file, it compiles until problems for src/testsuite/unit tool:
cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here). check-vdso.c compilation: in the src/testsuite/unit/Makefile.in file, the @CONFIG_XENO_FASTSYNCH_TRUE@ controls the check-vdso compilation. it is not completely inhibited when CONFIG_XENO_FASTSYNCH is not configured (the case here).

Quoted 6 lines

I have corrected by hand these 2 problems and Xenomai v2.5.2 is OK on my NIOS II board.

Gilles, what is the right modification to make on the src/skins/common/sem_heap.h file when CONFIG_XENO_FASTSYNCH is not defined during Xenomai configration?

We want everything to be compiled even without FASTSYNCH. So, please try the following patch:

src/skins/common/sem_heap.h +0 -4
index d799a37..16dedda 100644
@@ -3,10 +3,6 @@
 
 #include <xeno_config.h>
 
-#ifdef CONFIG_XENO_FASTSYNCH
 void xeno_init_sem_heaps(void);
-#else /* !CONFIG_XENO_FASTSYNCH */
-#define xeno_init_sem_heaps()
-#endif /* !CONFIG_XENO_FASTSYNCH */
 
 #endif /* XENO_SEM_HEAP_H */
src/testsuite/unit/Makefile.am +0 -4
index d94e53f..8966883 100644
@@ -92,8 +92,6 @@ cond_torture_native_LDADD = \
 	../../skins/common/libxenomai.la \
 	-lpthread -lm
 
-if CONFIG_XENO_FASTSYNCH
-
 check_vdso_SOURCES = check-vdso.c
 
 check_vdso_CPPFLAGS = \
@@ -107,8 +105,6 @@ check_vdso_LDADD = \
 	../../skins/common/libxenomai.la \
 	-lpthread -lm
 
-endif
-
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(rundir)
 	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in >

$(DESTDIR)$(rundir)/.runinfo

src/testsuite/unit/Makefile.in +13 -16
index 3d536a8..5125678 100644
@@ -64,13 +64,10 @@ arith_DEPENDENCIES = ../../skins/native/libnative.la \
 arith_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(arith_LDFLAGS) \
 	$(LDFLAGS) -o $@
-am__check_vdso_SOURCES_DIST = check-vdso.c
[email protected] =  \
[email protected]@	check_vdso-check-vdso.$(OBJEXT)
+am_check_vdso_OBJECTS = check_vdso-check-vdso.$(OBJEXT)
 check_vdso_OBJECTS = $(am_check_vdso_OBJECTS)
[email protected] =  \
[email protected]@	../../skins/native/libnative.la \
[email protected]@	../../skins/common/libxenomai.la
+check_vdso_DEPENDENCIES = ../../skins/native/libnative.la \
+	../../skins/common/libxenomai.la
 check_vdso_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(check_vdso_LDFLAGS) $(LDFLAGS) -o $@
@@ -130,7 +127,7 @@ SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \
 	$(cond_torture_native_SOURCES) $(cond_torture_posix_SOURCES) \
 	$(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \
 	$(wakeup_time_SOURCES)
-DIST_SOURCES = $(arith_SOURCES) $(am__check_vdso_SOURCES_DIST) \
+DIST_SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \
 	$(cond_torture_native_SOURCES) $(cond_torture_posix_SOURCES) \
 	$(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \
 	$(wakeup_time_SOURCES)
@@ -368,16 +365,16 @@ cond_torture_native_LDADD = \
 	../../skins/common/libxenomai.la \
 	-lpthread -lm
 
[email protected] = check-vdso.c
[email protected] = \
[email protected]@	@XENO_USER_CFLAGS@ \
[email protected]@	-I$(top_srcdir)/include
+check_vdso_SOURCES = check-vdso.c
+check_vdso_CPPFLAGS = \
+	@XENO_USER_CFLAGS@ \
+	-I$(top_srcdir)/include
 
[email protected] = @XENO_USER_LDFLAGS@
[email protected] = \
[email protected]@	../../skins/native/libnative.la \
[email protected]@	../../skins/common/libxenomai.la \
[email protected]@	-lpthread -lm
+check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@
+check_vdso_LDADD = \
+	../../skins/native/libnative.la \
+	../../skins/common/libxenomai.la \
+	-lpthread -lm
 
 EXTRA_DIST = runinfo.in
 all: all-am
Signature · 1 line
					    Gilles.
#6 lore raw
Quoted 74 lines · Gilles Chanteperdrix
Quoted 72 lines · Patrice Kadionik
Quoted 18 lines · Gilles Chanteperdrix
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 8 lines
Quoted 3 lines

what can I do? Please help

Please try xenomai 2.5.2

Hi Gilles,

I've done this with the 2.5.2 version and I have had the same problem. It is the consequence of another one earlier in the compilation process. After the xenomai configuration for NIOS II:

$ ./configure --host=nios2-linux

the generated src/include/xeno_config.h configuration file has CONFIG_XENO_FASTSYNCH not configured:
...
/* config */
/* #undef CONFIG_XENO_FASTSYNCH */
...

If you make the compilation, it fails on the src/skins/common/sem_heap.c compilation.
You have in this files 2 similar functions
line 100: static void xeno_init_sem_heaps_inner(void)
and
line 118: void xeno_init_sem_heaps(void)

There is a mismatch in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration). In this case it conflits with the macro #define xeno_init_sem_heaps() line 9 in the src/skins/common/sem_heap.h file and the void xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c

I don't know what in the right correction to do in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition.

If I suppress the line 9 (#define ...) in the src/skins/common/sem_heap.h file, it compiles until problems for src/testsuite/unit tool:
cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here). check-vdso.c compilation: in the src/testsuite/unit/Makefile.in file, the @CONFIG_XENO_FASTSYNCH_TRUE@ controls the check-vdso compilation. it is not completely inhibited when CONFIG_XENO_FASTSYNCH is not configured (the case here).

I have corrected by hand these 2 problems and Xenomai v2.5.2 is OK on my NIOS II board.

Quoted 7 lines
Quoted 4 lines

Gilles, what is the right modification to make on the src/skins/common/sem_heap.h file when CONFIG_XENO_FASTSYNCH is not defined during Xenomai configration?

We want everything to be compiled even without FASTSYNCH. So, please try the following patch:

Gilles,

The patch is OK.
There is a last error on the src/testsuite/unit/cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here):

        if (pi != 0)

#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
pthread_mutexattr_setprotocol(&mattr,
PTHREAD_PRIO_INHERIT);

        err = pthread_mutex_init(mutex, &mattr);
#else
        else {
                err = ENOSYS;
                goto out;
        }
        err = pthread_mutex_init(mutex, &mattr);

out:

#endif
        pthread_mutexattr_destroy(&mattr);

Patrice

~

Quoted 97 lines
src/skins/common/sem_heap.h +0 -4
index d799a37..16dedda 100644
@@ -3,10 +3,6 @@
 
  #include<xeno_config.h>
 
-#ifdef CONFIG_XENO_FASTSYNCH
  void xeno_init_sem_heaps(void);
-#else /* !CONFIG_XENO_FASTSYNCH */
-#define xeno_init_sem_heaps()
-#endif /* !CONFIG_XENO_FASTSYNCH */
 
  #endif /* XENO_SEM_HEAP_H */
src/testsuite/unit/Makefile.am +0 -4
index d94e53f..8966883 100644
@@ -92,8 +92,6 @@ cond_torture_native_LDADD = \
  	../../skins/common/libxenomai.la \
  	-lpthread -lm
 
-if CONFIG_XENO_FASTSYNCH
-
  check_vdso_SOURCES = check-vdso.c
 
  check_vdso_CPPFLAGS = \
@@ -107,8 +105,6 @@ check_vdso_LDADD = \
  	../../skins/common/libxenomai.la \
  	-lpthread -lm
 
-endif
-
  install-data-local:
  	$(mkinstalldirs) $(DESTDIR)$(rundir)
  	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in>

$(DESTDIR)$(rundir)/.runinfo

src/testsuite/unit/Makefile.in +13 -16
index 3d536a8..5125678 100644
@@ -64,13 +64,10 @@ arith_DEPENDENCIES = ../../skins/native/libnative.la \
  arith_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(arith_LDFLAGS) \
  	$(LDFLAGS) -o $@
-am__check_vdso_SOURCES_DIST = check-vdso.c
[email protected] =  \
[email protected]@	check_vdso-check-vdso.$(OBJEXT)
+am_check_vdso_OBJECTS = check_vdso-check-vdso.$(OBJEXT)
  check_vdso_OBJECTS = $(am_check_vdso_OBJECTS)
[email protected] =  \
[email protected]@	../../skins/native/libnative.la \
[email protected]@	../../skins/common/libxenomai.la
+check_vdso_DEPENDENCIES = ../../skins/native/libnative.la \
+	../../skins/common/libxenomai.la
  check_vdso_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
  	$(check_vdso_LDFLAGS) $(LDFLAGS) -o $@
@@ -130,7 +127,7 @@ SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \
  	$(cond_torture_native_SOURCES) $(cond_torture_posix_SOURCES) \
  	$(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \
  	$(wakeup_time_SOURCES)
-DIST_SOURCES = $(arith_SOURCES) $(am__check_vdso_SOURCES_DIST) \
+DIST_SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \
  	$(cond_torture_native_SOURCES) $(cond_torture_posix_SOURCES) \
  	$(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \
  	$(wakeup_time_SOURCES)
@@ -368,16 +365,16 @@ cond_torture_native_LDADD = \
  	../../skins/common/libxenomai.la \
  	-lpthread -lm
 
[email protected] = check-vdso.c
[email protected] = \
[email protected]@	@XENO_USER_CFLAGS@ \
[email protected]@	-I$(top_srcdir)/include
+check_vdso_SOURCES = check-vdso.c
+check_vdso_CPPFLAGS = \
+	@XENO_USER_CFLAGS@ \
+	-I$(top_srcdir)/include
 
[email protected] = @XENO_USER_LDFLAGS@
[email protected] = \
[email protected]@	../../skins/native/libnative.la \
[email protected]@	../../skins/common/libxenomai.la \
[email protected]@	-lpthread -lm
+check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@
+check_vdso_LDADD = \
+	../../skins/native/libnative.la \
+	../../skins/common/libxenomai.la \
+	-lpthread -lm
 
  EXTRA_DIST = runinfo.in
  all: all-am
Signature · 14 lines
--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
#7 lore raw
In reply to Patrice Kadionik
Quoted 55 lines · Patrice Kadionik
Quoted 17 lines · Gilles Chanteperdrix
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 6 lines
Quoted 2 lines

what can I do? Please help

Please try xenomai 2.5.2

Hi Gilles,

I've done this with the 2.5.2 version and I have had the same problem. It is the consequence of another one earlier in the compilation process. After the xenomai configuration for NIOS II:

$ ./configure --host=nios2-linux

the generated src/include/xeno_config.h configuration file has CONFIG_XENO_FASTSYNCH not configured:
...
/* config */
/* #undef CONFIG_XENO_FASTSYNCH */
...

If you make the compilation, it fails on the src/skins/common/sem_heap.c compilation.
You have in this files 2 similar functions
line 100: static void xeno_init_sem_heaps_inner(void)
and
line 118: void xeno_init_sem_heaps(void)

There is a mismatch in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration). In this case it conflits with the macro #define xeno_init_sem_heaps() line 9 in the src/skins/common/sem_heap.h file and the void xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c

I don't know what in the right correction to do in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition.

Quoted 5 lines

If I suppress the line 9 (#define ...) in the src/skins/common/sem_heap.h file, it compiles until problems for src/testsuite/unit tool:
cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here).

Could you show me the compilation log? I think the "else" is simply wrong.

Signature · 1 line
					    Gilles.
#8 lore raw
Quoted 61 lines · Gilles Chanteperdrix
Quoted 59 lines · Patrice Kadionik
Quoted 18 lines · Gilles Chanteperdrix
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 8 lines
Quoted 3 lines

what can I do? Please help

Please try xenomai 2.5.2

Hi Gilles,

I've done this with the 2.5.2 version and I have had the same problem. It is the consequence of another one earlier in the compilation process. After the xenomai configuration for NIOS II:

$ ./configure --host=nios2-linux

the generated src/include/xeno_config.h configuration file has CONFIG_XENO_FASTSYNCH not configured:
...
/* config */
/* #undef CONFIG_XENO_FASTSYNCH */
...

If you make the compilation, it fails on the src/skins/common/sem_heap.c compilation.
You have in this files 2 similar functions
line 100: static void xeno_init_sem_heaps_inner(void)
and
line 118: void xeno_init_sem_heaps(void)

There is a mismatch in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration). In this case it conflits with the macro #define xeno_init_sem_heaps() line 9 in the src/skins/common/sem_heap.h file and the void xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c

I don't know what in the right correction to do in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition.

Quoted 9 lines
Quoted 6 lines

If I suppress the line 9 (#define ...) in the src/skins/common/sem_heap.h file, it compiles until problems for src/testsuite/unit tool:
cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here).

Could you show me the compilation log? I think the "else" is simply wrong.

That is:
nios2-linux-gcc -DHAVE_CONFIG_H -I. -I../../../src/include -I../../../include/posix -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -g -DXENO_POSIX -I../../../include -MT cond_torture_posix-cond-torture.o -MD -MP -MF .deps/cond_torture_posix-cond-torture.Tpo -c -o cond_torture_posix-cond-torture.o test -f 'cond-torture.c' || echo './'cond-torture.c
cond-torture.c: In function `mutex_init':
cond-torture.c:56: error: syntax error before "else"
make[3]: *** [cond_torture_posix-cond-torture.o] Erreur 1
make[3]: quittant le répertoire « /home/kadionik/Altera/nios2-xenomai/tests/xenomai-2.5.2/src/testsuite/unit »

yes the #else is wrong...

Patrice

Signature · 14 lines
--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
#9 lore raw
Quoted 85 lines · Patrice Kadionik
Quoted 61 lines · Gilles Chanteperdrix
Quoted 59 lines · Patrice Kadionik
Quoted 18 lines · Gilles Chanteperdrix
Quoted 15 lines · Huan Fang

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

Quoted 8 lines
Quoted 3 lines

what can I do? Please help

Please try xenomai 2.5.2

Hi Gilles,

I've done this with the 2.5.2 version and I have had the same problem. It is the consequence of another one earlier in the compilation process. After the xenomai configuration for NIOS II:

$ ./configure --host=nios2-linux

the generated src/include/xeno_config.h configuration file has CONFIG_XENO_FASTSYNCH not configured:
...
/* config */
/* #undef CONFIG_XENO_FASTSYNCH */
...

If you make the compilation, it fails on the src/skins/common/sem_heap.c compilation.
You have in this files 2 similar functions
line 100: static void xeno_init_sem_heaps_inner(void)
and
line 118: void xeno_init_sem_heaps(void)

There is a mismatch in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition (during Xenomai configuration). In this case it conflits with the macro #define xeno_init_sem_heaps() line 9 in the src/skins/common/sem_heap.h file and the void xeno_init_sem_heaps(void) in the src/skins/common/sem_heap.c

I don't know what in the right correction to do in the src/skins/common/sem_heap.h file according to the CONFIG_XENO_FASTSYNCH definition.

Quoted 9 lines
Quoted 6 lines

If I suppress the line 9 (#define ...) in the src/skins/common/sem_heap.h file, it compiles until problems for src/testsuite/unit tool:
cond-torture.c file. Line 56: problem with the "if else" structure when HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL is not defined (the case here).

Could you show me the compilation log? I think the "else" is simply wrong.

That is:
nios2-linux-gcc -DHAVE_CONFIG_H -I. -I../../../src/include

(quoted diff) +0 -3
-I../../../include/posix -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe 
-D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -g -DXENO_POSIX 
-I../../../include    -MT cond_torture_posix-cond-torture.o -MD -MP -MF 

.deps/cond_torture_posix-cond-torture.Tpo -c -o cond_torture_posix-cond-torture.o test -f 'cond-torture.c' || echo './'cond-torture.c
cond-torture.c: In function `mutex_init':
cond-torture.c:56: error: syntax error before "else"
make[3]: *** [cond_torture_posix-cond-torture.o] Erreur 1 make[3]: quittant le répertoire « /home/kadionik/Altera/nios2-xenomai/tests/xenomai-2.5.2/src/testsuite/unit »

Quoted 1 line

yes the #else is wrong...

Could you check the following patch?

(quoted diff) +0 -0

b/src/testsuite/unit/cond-torture.c
index a20e12f..2d40a29 100644

src/testsuite/unit/cond-torture.c +2 -2
@@ -47,13 +47,13 @@ int mutex_init(mutex_t *mutex, int type, int pi)
 
        pthread_mutexattr_init(&mattr);
        pthread_mutexattr_settype(&mattr, type);
-       if (pi != 0)
 #ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
+       if (pi != 0)
                pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT);
 
        err = pthread_mutex_init(mutex, &mattr);
 #else
-       else {
+       if (pi != 0) {
                err = ENOSYS;
                goto out;
        }
Signature · 1 line
					    Gilles.
#10 lore raw
Quoted 12 lines · Gilles Chanteperdrix
src/testsuite/unit/cond-torture.c +0 -1
index a20e12f..2d40a29 100644
@@ -47,13 +47,13 @@ int mutex_init(mutex_t *mutex, int type, int pi)
 
         pthread_mutexattr_init(&mattr);
         pthread_mutexattr_settype(&mattr, type);
-       if (pi != 0)
  #ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL

src/testsuite/unit/cond-torture.c int mutex_init(mutex_t *mutex, int type, int pi) · line 59

Quoted 10 lines
src/testsuite/unit/cond-torture.c +2 -1
+       if (pi != 0)
                 pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT);
 
         err = pthread_mutex_init(mutex,&mattr);
  #else
-       else {
+       if (pi != 0) {
                 err = ENOSYS;
                 goto out;
         }

The patch is OK. Everything compiles now. It runs on my NIOS II board. Thanks Gilles.

Please find a patch for updating the Xenomai README file concerning NIOS II.

Cheers;
Patrice

Signature · 58 lines
--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+

=============================================================================
--- xenomai-2.5.2/README.INSTALL	2010-01-16 01:09:31.000000000 +0100
+++ xenomai-2.5.2.new/README.INSTALL	2010-03-30 16:48:54.000000000 +0200
@@ -451,8 +451,8 @@
 Note in Linux, IRQ 0 means auto-detected, so you must not use IRQ 0 for ANY devices.

 The Xenomai port for NIOS II uses extra hardware that you have to add in SOPC builder:
-- A  full featured 32-bit Timer named hrtimer with a 1 µs period.
-- A  full featured High Resolution 64-bit Timer named hrclock used for time stamping (1 µs period for example).
+- A full featured 32-bit Timer named hrtimer with a 1 us period.
+- A full featured High Resolution 64-bit Timer named hrclock used for time stamping (1 us period for example).

 PLEASE RESPECT hrtimer, hrclock names because the Xenomai port is based on them!

@@ -465,9 +465,10 @@

 You should first verify that uClinux without Xenomai can run on the target board.
 The typical actions for building the uClinux kernel for NIOS II (available here: http://www.nioswiki.com/) are:
-If $uClinux-dist is the path of NIOS II uClinux release, for example: /home/test/nios2-linux/uClinux-dist
+- If $linux_tree is the path of the NIOS II uClinux kernel source directory, for example: /home/test/nios2-linux/linux-2.6
+- If $uclinux is the path of the NIOS II uClinux distribution, for example: /home/test/nios2-linux/uClinux-dist

-$ cd $uClinux-dist
+$ cd $uclinux
 $ make menuconfig
 $ make vendor_hwselect SYSPTF=<path to your system ptf>
 $ make
@@ -475,11 +476,12 @@
 If the NIOS II cross-compiler is called nios2-linux-gcc, a typical compilation will look like:

 $ $xenomai_root/scripts/prepare-kernel.sh --arch=nios2 \
-  --adeos=$xenomai_root/ksrc/arch/nios2/patches/adeos-ipipe-2.6.26-rc6-nios2-* \
+  --adeos=$xenomai_root/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-* \
   --linux=$linux_tree
+
 $ $xenomai_root/configure --host=nios2-linux
-$ make install DESTDIR=$uClinux-dist/romf
-$ cd $uClinux-dist
+$ make install DESTDIR=$uclinux/romf
+$ cd $uclinux
 $ make

 2.6 Building with the --enable-linux-build option
#11 lore raw
In reply to Huan Fang
Quoted 2 lines · Huan Fang

Hi Patrice,

Hi Huan,

Have you really used uClinux with NIOS2 without MMU in your Quartus II design? Have you synchronized the µClinux kernel file version with the NIOS2 ipipe version?

Quoted 6 lines

Many thanks for the tutorial, Now I am able to run xenomai patched uclinux on my DE2-70 board. But the kernel doesn't boot unless I modified one file :linux-2.6/arch/nios2/kernel/time.c

na_timer0 -> na_sys_clock_timer which I guess is the clock timer used by Linux. Did you manually patch this file? The adeos patch doesn't seem to change this part.

Not at all.

If you have done this:

$ make vendor_hwselect SYSPTF=my_design.ptf
it generates a nios2.h under uClinux-dist/linux-2.6.x/include/asm-nios2
in which you have na_sys_clk_timer redefined as na_timer0.
For example, in my nios2.h generated file, I have:
/* Executing ...scripts/nios2.h/altera_avalon_timer.pm */

/* system timer input clock frequency */
#define nasys_clock_freq 50000000
#define nasys_clock_freq_1000 50000

/* Redefining sys_clk_timer -> timer0 */
#undef na_sys_clk_timer
#undef na_sys_clk_timer_irq

#define na_timer0 ((void *) 0x00810800)

Please send me in a private email your nios2.h file.

Patrice

Quoted 132 lines

currently my timer settings are

/proc/xenomai>cat timer status=on+watchdog:setup=1030:clock=1638046732:timerdev=hrtimer:clockdev=hrclock Does it looks all right?

Best Regards,
Huan
________________________________________
From: [email protected] [[email protected]] On Behalf Of Patrice Kadionik [[email protected]]
Sent: 28 March 2010 15:26
To: Chtourou Sonda
Cc: [email protected]
Subject: Re: [Xenomai-help] Problem to cross-compile Xenomai user-space support

Le 20:59, Chtourou Sonda a écrit :
Dears,
Hi,

I built the uClinux kernel for NIOS II and it run well on the target board. I followed the typical actions available here : http://www.nioswiki.com/

Now, I want to add a co-scheduler xenomai to the kernel (uclinux) to reduce its latency. I followed these steps: (http://www.xenomai.org/documentation/xenomai-2.5/README.INSTALL)
I've tried to reproduce your compilation error but without success.

For using Xenomai on NIOS II processor with uClinux, you must add extra hardware in your SoPC design as explained in this tutorial (http://uuu.enseirb.fr/~kadionik/nios2-xenomai/Xenomai%20on%20NIOS%20II%20Softcore%20Processor%20Guide-v1.1.pdf).

It is OK on my Altera 1S10 board with Xenomai v2.5.1 (see traces).

Sincerely;

Patrice
========================================

Uncompressing Linux... Ok, booting the kernel.
Linux version 2.6.30 ([email protected]) (gcc version 3.4.6) #4 PREEMPT Sun Mar 0

uClinux/Nios II
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064 Kernel command line:
NR_IRQS:32
PID hash table entries: 64 (order: 6, 256 bytes)
I-pipe 1.1-00: pipeline enabled.
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory available: 12108k/3990k RAM, 0k/0k ROM (1931k kernel code, 2059k data) Calibrating delay loop... 24.06 BogoMIPS (lpj=120320)
Mount-cache hash table entries: 512
net_namespace: 264 bytes
NET: Registered protocol family 16
init_BSP(): registering device resources
bio: create slab<bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
I-pipe: Domain Xenomai registered.
Xenomai: hal/nios2 started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.5.1 (Speed Of Light) loaded.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.
io scheduler noop registered
io scheduler deadline registered (default)
ttyS0 at MMIO 0x810840 (irq = 5) is a Altera UART
console [ttyS0] enabled

$ $xenomai-2.5.1/scripts/prepare-kernel.sh --arch=nios2 --adeos=$xenomai-2.5.1/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch
   --linux=$linux_tree
$ $xenomai-2.5.1/configure --host=nios2-linux
$ make install DESTDIR=$uClinux-dist/romfs

But, in this step, I got this error:

eck_vdso-check-vdso.o ../../skins/native/libnative.la -lpthread -lm
libtool: link: ../../../scripts/wrap-link.sh nios2-linux-gcc -Wl,-elf2flt -o check-vdso check_vdso-check-vdso.o ../../skins/native/.libs/libnative.a -lpthread -lm check-vdso.elf2flt(.text+0x16c): In function `main':
: undefined reference to `xeno_sem_heap'
check-vdso.elf2flt(.text+0x170): In function `main':
: undefined reference to `xeno_sem_heap'
collect2: ld returned 1 exit status
make[3]: *** [check-vdso] Erreur 1
make[3]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite/unit »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src/testsuite »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/sonda/Desktop/xenomai-2.5.1/src »
make: *** [all-recursive] Erreur 1

what can I do? Please help
Regards,

_______________________________________________
Xenomai-help mailing list [email protected]<mailto:[email protected]>
https://mail.gna.org/listinfo/xenomai-help

--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +

+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
Signature · 14 lines
--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+
#12 lore raw

Hi Patrice,

I probably know why it fails the first time.

before modification, my nios2.h has

/* system timer input clock frequency */
#define nasys_clock_freq 100000000
#define nasys_clock_freq_1000 100000

/* Redefining hrtimer -> timer0 */
#undef na_hrtimer
#undef na_hrtimer_irq

#define na_timer0 ((void *) 0x09609080)
#define na_timer0_irq 1

The script altera_avalon_timer.pm will redefine the first timer (by the order of address?) to timer_0. In your case, sys_clk_timer is your first timer, that's why it's correctly redefined to timer_0 used in time.c

This is tricky, either we should improve the script or manually check(hack) the timer settings.

By the way, I haven't successfully compiled user space xenomai stuff, I will let you know when it's done.

Best Regards,
Huan
________________________________________
From: Patrice Kadionik [[email protected]]
Sent: 30 March 2010 10:37
To: Huan Fang
Cc: [email protected]
Subject: Re: [Xenomai-help] Problem to cross-compile Xenomai user-space support

Quoted 2 lines · Huan Fang

Hi Patrice,

Hi Huan,

Have you really used uClinux with NIOS2 without MMU in your Quartus II design? Have you synchronized the µClinux kernel file version with the NIOS2 ipipe version?

Quoted 6 lines

Many thanks for the tutorial, Now I am able to run xenomai patched uclinux on my DE2-70 board. But the kernel doesn't boot unless I modified one file :linux-2.6/arch/nios2/kernel/time.c

na_timer0 -> na_sys_clock_timer which I guess is the clock timer used by Linux. Did you manually patch this file? The adeos patch doesn't seem to change this part.

Not at all.

If you have done this:

$ make vendor_hwselect SYSPTF=my_design.ptf
it generates a nios2.h under uClinux-dist/linux-2.6.x/include/asm-nios2
in which you have na_sys_clk_timer redefined as na_timer0.
For example, in my nios2.h generated file, I have:
/* Executing ...scripts/nios2.h/altera_avalon_timer.pm */

/* system timer input clock frequency */
#define nasys_clock_freq 50000000
#define nasys_clock_freq_1000 50000

/* Redefining sys_clk_timer -> timer0 */
#undef na_sys_clk_timer
#undef na_sys_clk_timer_irq

#define na_timer0 ((void *) 0x00810800)

Please send me in a private email your nios2.h file.

Patrice

#13 lore raw
Quoted 14 lines · Huan Fang

Hi Patrice,

I probably know why it fails the first time.

before modification, my nios2.h has

/* system timer input clock frequency */
#define nasys_clock_freq 100000000
#define nasys_clock_freq_1000 100000

/* Redefining hrtimer -> timer0 */
#undef na_hrtimer
#undef na_hrtimer_irq

Quoted 7 lines

#define na_timer0 ((void *) 0x09609080)
#define na_timer0_irq 1

The script altera_avalon_timer.pm will redefine the first timer (by the order of address?) to timer_0. In your case, sys_clk_timer is your first timer, that's why it's correctly redefined to timer_0 used in time.c

OK. You have the same thing with MicroBlaze and .DTS file with dtb parsing during kernel booting! Thank you for this info.

Quoted 4 lines

This is tricky, either we should improve the script or manually check(hack) the timer settings.

By the way, I haven't successfully compiled user space xenomai stuff, I will let you know when it's done.

OK, read the other messages of this thread. Gilles proposes 2 patchs for Xenomai 2.5.2 for correcting error compilation (sem_heap.c, vdso-check.c and cond-torture.c)

Cheers;

Patrice

Quoted 54 lines

Best Regards,
Huan
________________________________________
From: Patrice Kadionik [[email protected]]
Sent: 30 March 2010 10:37
To: Huan Fang
Cc: [email protected]
Subject: Re: [Xenomai-help] Problem to cross-compile Xenomai user-space support

Quoted 3 lines · Huan Fang

Hi Patrice,

Hi Huan,

Have you really used uClinux with NIOS2 without MMU in your Quartus II design? Have you synchronized the µClinux kernel file version with the NIOS2 ipipe version?

Quoted 7 lines

Many thanks for the tutorial, Now I am able to run xenomai patched uclinux on my DE2-70 board. But the kernel doesn't boot unless I modified one file :linux-2.6/arch/nios2/kernel/time.c

na_timer0 -> na_sys_clock_timer which I guess is the clock timer used by Linux. Did you manually patch this file?
The adeos patch doesn't seem to change this part.

Not at all.

If you have done this:

$ make vendor_hwselect SYSPTF=my_design.ptf
it generates a nios2.h under uClinux-dist/linux-2.6.x/include/asm-nios2
in which you have na_sys_clk_timer redefined as na_timer0.
For example, in my nios2.h generated file, I have:
/* Executing ...scripts/nios2.h/altera_avalon_timer.pm */

/* system timer input clock frequency */
#define nasys_clock_freq 50000000
#define nasys_clock_freq_1000 50000

/* Redefining sys_clk_timer -> timer0 */
#undef na_sys_clk_timer
#undef na_sys_clk_timer_irq

#define na_timer0 ((void *) 0x00810800)

Please send me in a private email your nios2.h file.

Patrice

Signature · 13 lines
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:[email protected] +
+----------------------------------------------------------------------+