On 05/10/2012 07:29 PM, aubin.rebil...@free.fr wrote:
>> Also, from the sources I could gather (snakeos-sdk), the hardware
>> timer
>> for str8100 is programmed in periodic, auto-reload mode. Obviously,
>> when
>> CONFIG_IPIPE is on, you have to change this to make the timer run in
>> one-shot mode, as required by Xenomai.
> 
> I did not know that it was required, i thought it was handy not to reprogram 
> the timer each time.

That is likely your problem. You can not assume that a decreasing
counter is all of a sudden a free-running counter with match register.
You have to find the processor datasheet and look at how its registers
must be programmed to run in one-shot mode, if at all possible.

Note that since linux 2.6.24, linux itself switched to one-shot mode,
because it allows high resolution software timers.

>>> #ifdef CONFIG_IPIPE
>>> void __ipipe_mach_demux_irq(unsigned irq, struct pt_regs *regs)
>>> {
>>>   // No cascaded interrupt using the VIC
>>> }
>>> #endif /* CONFIG_IPIPE */
>>
>> You probably do not need to define this function if you #define
>> ipipe_mach_irq_mux_p to always be 0.
>>
> 
> I do, to avoid an undefined reference.

If you #define ipipe_mach_irq_mux_p(irq) 0

The compilers optimizes away the function call, and there is no
undefined reference. At least with current compilers.

> 
> Nevertheless, thank you very much for all this.
> 
> When i developped the IPIPE code for this board i followed the
> HOWTO but it's quite vague so I mostly read what has been done 
> with other boards and what has been done with linux for this board 
> to implement it.

This HOWTO assumes that you understand what you are doing. No HOWTO
guide is a substitute for that unfortunately.

> Therefore, I'm clearly not aware of the interactions between Linux 
> and Xenomai. I will definitely read the publications available on 
> the Xenomai website.

Well, it is not all that complicated. When xenomai wants to program the
timer it calls ipipe_mach_set_dec, and when a timer interrupt happens,
ipipe_mach_acktimer is called, whether the timer is handled by Linux, or
it has been taken over by Xenomai.

-- 
                                            Gilles.

_______________________________________________
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help

Reply via email to