DMA cause system crash/hang (I think)
- From: John <jvasquez@xxxxxxx>
- Date: Thu, 10 Jul 2008 08:41:35 -0700
Lynx40 - Device Driver.
I have a requirement to transmit data and receive data at the same
time. The received data is not done during the read(). It is performed
during the write().
the user calls the ioctl first specifying a buffer for the receive
buffer. Then the write() is performed as follows:
getpid of the write task.
getpriority() of write task,
stsetprio() of the interrupt thread ID to (stgetprio() <<1)+1.
setup output dma using the following steps:
mem_lock() /*locks users' output buffer using write task id*/
caculate number of DMA pages required for operation.
mmchain() to retrieve physical address of output DMA pages.
setup receive dma using the following steps:
mem_lock() /*locks users' output buffer using write task id*/
caculate number of DMA pages required for operation.
mmchain() to retrieve physical address of received buffer DMA pages.
Setup hardware for output and input DMA.
Enable the hardward for DMA operation.
when interrupt occurs, mem_unlock() both output and input buffers.
The above operation works find the first time. However, if I try it
again, the system either crashes(most of the time) or hangs up.
If I do strictly write() operations, it works find...no crashes.
It looks like the receive buffer is causing a problem but I haven't
been able to figure it out. It has been 3 days, and I need to solve
this problem.
I noticed that I'm using the write task ID to lock the memory for
receive buffer although the buffer was give to the driver during an
ioctl call. Is this correct? Could this be causing my problem? should
I be locking the received buffer during the ioctl call?
My experience with LynxOS is limitted. I'm a Windows Device Driver
guy.
Any suggestion?
.
- Follow-Ups:
- Re: DMA cause system crash/hang (I think)
- From: Cyril Novikov
- Re: DMA cause system crash/hang (I think)
- Prev by Date: Problems detecting EOF when using ifstream class on LynxOS 4.2
- Next by Date: Re: DMA cause system crash/hang (I think)
- Previous by thread: Problems detecting EOF when using ifstream class on LynxOS 4.2
- Next by thread: Re: DMA cause system crash/hang (I think)
- Index(es):
Relevant Pages
|