Skip to contentSkip to conversation

Blackfin BF537 userspace - kernelspace strategy

Xenomai-help Fillod Stephane 1 participant 1 message Dec 8, 2008

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Daniele Pagani

I'm using uClinux with Xenomai on BF537 and it works fine.

But, I need to understand the best strategy to use about Linux/Xenomai and >userspace/kernelspace.

[...]

Quoted 1 line

 The driver is developed in Linux environment (without real time), using 2d-dma buffering and dma_copy in function read/write.

My advice would be to have a simple kernel driver that keeps the double buffer DMA continuously running, and have that buffer memory mmapped to user land. The user RT task would either be notified by interrupt, either by polling (my preference).

Quoted 1 line

and inside the real time task I'm using read/write function according to the char device driver sport. The priority of the task is set to 99.

If I'm not mistaken, the read/write is not RT safe.

Quoted 3 lines

Anyway, when I'm using this configuration, sometimes a calling to a webserver (that is running on the same machine) could cause an error on the audio output, so I think that something is not in real time environment.

Has you kernel PREEMPT_RT enabled?

Quoted 1 line

So the question is, what I need to do?

Quoted 1 line

1) write real time driver (very difficult now for me)

RTDM should ease that pathway, isn't?

Quoted 4 lines

2) write userspace application with real time interrupt and dma management? If yes, I don't understand if in Xenomai context I can set the Blackfin register from a userspace application or if in Xenomai context has no sense to speak about user/kernel space.

Not sure about the BF arch, but generally, you can access
the hardware register by mmap'ing /dev/mem from userspace, and once mapped, stay in RT. See the following for inspiration:
http://www.denx.de/twiki/bin/view/PPCEmbedded/DeviceDrivers#Section_AccessingPeripheralsFromUserSpace

Regards

Signature · 1 line
Stephane