Skip to contentSkip to conversation

Non RT PCI device driver vs interrupts (almost ok)

Xenomai-help Hubert Talbot 2 participants 2 messages Feb 21, 2008

lore
Share & tools
lore
#0 lore raw

First of all, I am studying xenomai to show to my manager that this framework can do the expected job for our realtime applications (me, I believe!). I have to prove that with a concrete application (alike the ones we do in general), where the need to test xenomai with pci card.

The first step I decided to do is capture interrupt. Eventually, I will want to translate driver to rtdm.

I had some difficulties to catch interrupt from realtime task but with your confirmation, it is ok now.

However, it seems to be not as precise as expected (in milliseconds order instead of microsecs).

Within a demo application...

The main function is as:

- opens board (specifying ISR)
- enables capturing of digital IO events
- enables interrupt requests in response to captured DIO edges
- enables interrupts
- reads counter
- disables interrupts
- closes board

And the ISR is as:

- gets interrupts status
- updates count
- resets DIO event capture flags
- enables interrupts

Doing like that in realtime application, I succeeded to catch interrupts but with imprecision.

In rt_task, I have the following:

- rt_intr_wait()
- gets interrupts status (1)
- reads counter
- resets DIO event capture flags (2)
- enables interrupts (3)

Can (1) (2) (3) api calls cause the imprecision (primary/secondary mode)?

Should it be better if device driver would be implemented with xenomai-rtdm?

Thanks

Hubert

#1 lore raw
Quoted 51 lines · Hubert Talbot

First of all, I am studying xenomai to show to my manager that this framework can do the expected job for our realtime applications (me, I believe!). I have to prove that with a concrete application (alike the ones we do in general), where the need to test xenomai with pci card.

The first step I decided to do is capture interrupt. Eventually, I will want to translate driver to rtdm.

I had some difficulties to catch interrupt from realtime task but with your confirmation, it is ok now.

However, it seems to be not as precise as expected (in milliseconds order instead of microsecs).

Within a demo application...

The main function is as:

- opens board (specifying ISR)
- enables capturing of digital IO events
- enables interrupt requests in response to captured DIO edges
- enables interrupts
- reads counter
- disables interrupts
- closes board

And the ISR is as:

- gets interrupts status
- updates count
- resets DIO event capture flags
- enables interrupts

Doing like that in realtime application, I succeeded to catch interrupts but with imprecision.

In rt_task, I have the following:

- rt_intr_wait()
- gets interrupts status (1)
- reads counter
- resets DIO event capture flags (2)
- enables interrupts (3)

Quoted 3 lines

Can (1) (2) (3) api calls cause the imprecision (primary/secondary mode)?

Should it be better if device driver would be implemented with xenomai-rtdm?

If you see milliseconds, then there is a problem somewhere. If you kept the Linux driver running, it maybe this driver which disturbs your real-time activities, for instance by clearing the interrupt bit by reading interrupt status at an unwanted time.

About the rtdm vs user-space question. In my opinion, if you want to get results rapidly, you can go for user-space, there you have better debug tools. However, if the driver you write is expected to have a longer life than a proof-of-concept, then you should go for RTDM.

P.S: I get error messages from your mail system telling me that messages I send to you can not be delivered.

Signature · 1 line
					    Gilles Chanteperdrix.