Le 31/03/2010 12:55, Chtourou Sonda a écrit :

Hi Chtourou,

Hi Patrice,
OK. Please, verify first that you can boot µClinux without Xenomai on your board with the 2 extra hrtimer and hrclock peripherals.
There is no priority on IRQ with NIOS.

So, If I have understood, I could put:
IRO = 7 for hrtimer
IRQ = 8 for hrclock
IRQ = 1 for sys_clk_timer
with this configuration µClinux without Xenomai with the 2 extra hrtimer and hrclock peripherals can boot on the board . But I'm wondering why with the first configuration (IRO = 1 for hrtimer,IRQ = 2 for hrclock and IRQ = 3 for sys_clk_timer), it didn't boot?

**Huan Fang (https://mail.gna.org/public/xenomai-help/2010-04/msg00013.html) has detected the problem.
I have done some investigations.

For recall,
- From the HW point of view, when you build your SoPC system with SOPC Builder tool in Quartus II, you add different peripherals (Altera peripheral and your own peripherals). After that you lanch a generate command. At this, it creates a .ptf (and now a .sopc) file. This file is an ASCII file (in a synthax like XML), a declarative file that gives all informations for HDL synthesis. After that, you compile (a synthesis) your SoPC system that gives the .sof file for programming your Altera FPGA. - From the SW point of view, when you do a "$ make vendor_hwselect SYSPTF=your_ptf_file.ptf", you generate (through Perl scripts) a nios2.h file under .../uClinux-dist/linux-2.6.x/include/asm-nios2 directory that translates the .ptf file into .h file with #define declarations.

The sys_clk_timer must be the Linux timer even with the 2 Xenomai extra timers. sys_cllk_timer is renamed in the nios2.h as timer0:
/* Redefining sys_clk_timer -> timer0 */
#undef na_sys_clk_timer
#undef na_sys_clk_timer_irq

#define na_timer0                                  ((void *) 0xXXXXXXXX)
#define na_timer0_irq                                                  Y

The Perl script (altera_avalon_timer.pm) used by the "make vendor_hwselect" command parses the .ptf file and takes the first encountered timer as Linux timer! So, if it is not the sys_clk_timer (hrtimer or hrclock or your own timer...), it will be bad and you can't boot.

How can you have sys_clk_timer as the first timer in your .ptf file?
If you change the order in the graphical view under SOPC builder, it doesn't care. The order of the peripherals in the generated .ptf file is their creation order. So, you MUST first create in SOPC Builder sys_clk_timer and then the 2 other timers for Xenomai hrtimer and hrclock. If you are note sure, delete all timers in the SoPC, save the SoPC and create finally in the right order the 3 timers.

If all is OK, you must have in the nios2.h something like:
/* Redefining sys_clk_timer -> timer0 */
#undef na_sys_clk_timer
#undef na_sys_clk_timer_irq

#define na_timer0                                  ((void *) 0xXXXXXXXX)
#define na_timer0_irq                                                  Y

Another verification is when you generate your SoPC system. The traces during SoPC generation with SOPC Builder gives the order in the .ptf file. For example, a good example:
# 2010.03.31 22:06:55 (*) Running Generator Program for ext_flash
# 2010.03.31 22:06:57 (*) Running Generator Program for ext_ram
# 2010.03.31 22:06:58 (*) Running Generator Program for onchip_ram_64_kbytes
# 2010.03.31 22:06:59 (*) Running Generator Program for sys_clk_timer
. . .
# 2010.03.31 22:07:05 (*) Running Generator Program for hrclock
. . .
# 2010.03.31 22:07:18 (*) Running Generator Program for uart_0
# 2010.03.31 22:07:21 (*) Running Generator Program for hrtimer
# 2010.03.31 22:07:22 (*) Running Generator Program for std_1s10_clock_0

So verify this point, it should be your problem.
Please verify that you have correctly enabled all the right options under SOPC builder for hrtimer and hrclock. Because we have flexibility in HW configuration with SoPC, we must be more careful.

Configuration of hrtimer with the SoPC Builder:
• Timer: 32 bits.
• Timeout period: 1 µs.
• Preset : custom. Writable period, readable snapshot, Start/Stop control bits.

Configuration of hrclock with the SoPC Builder:
in the snapshot mode. Its configuration with the SoPC Builder tool is:
• 64-bit timer.
• Timeout period: 5 clocks. clock=20 ns (100 ns). The timer functionality is not used by Xenomai.

• Preset: custom. Writable period, readable snapshot, Start/Stop control bits.

Is it correct?
According to errno.h, code -19 is ENODEV, please verify your timer configuration and respect naming convention

Here, you speek about "sys_clock_timer"?

It is sys_clk_timer, sorry. I'll correct the typo error.

Patrice
Configuration of sys_clock_timer with the SoPC Builder:
• 32-bit timer.
• Timeout period: 10 ms.
• Preset: custom. Writable period, readable snapshot, Start/Stop control bits.

Regards,




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

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb.fr/~kadionik         +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB                      http://www.enseirb.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-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to