12-10-2012 02:57 PM
Hello
I have a Target to Host DMA between. The read function sits in a while loop with a 2000ms timeout. Upon timeout it loops round and recalls the read function. On the second, and subsequent calls, it does not wait for the timeout time. I assume that this is because it was already itemed out. The error is wired to a shift register.
Does the timeout result in an error on the error line?
Is there a way to clear the timeout?
If i change it to an indefinite wait, is there a way to force the read to wake up?
Thanks
Solved! Go to Solution.
12-10-2012 03:29 PM - edited 12-10-2012 03:29 PM
@jonnnnnnn wrote:
Hello
I have a Target to Host DMA between. The read function sits in a while loop with a 2000ms timeout. Upon timeout it loops round and recalls the read function. On the second, and subsequent calls, it does not wait for the timeout time. I assume that this is because it was already itemed out. The error is wired to a shift register.
Does the timeout result in an error on the error line?
Is there a way to clear the timeout?
If i change it to an indefinite wait, is there a way to force the read to wake up?
Thanks
Does the timeout result in an error on the error line? Yes, errro -54000 if memory serves correctly. Did you try highlighting execution to see this...
Is there a way to clear the timeout? Don't wire -1, I got burned by this. The DMA actually polls in the background (I think but I never verified) so a negative timeout can slam your processor. You can maybe try interrupts, although I didn't use this method I just threw a not-too-long timeout on there and cleared the error if it was -54000
If i change it to an indefinite wait, is there a way to force the read to wake up? The read will only return when data is there, unless you have a timeout.
12-10-2012 04:17 PM
@jonnnnnnn wrote:
The error is wired to a shift register.
Does the timeout result in an error on the error line?
Why don't you probe the wire, or put an indicator on it, and find out? If it does return an error, there's your problem. You'll have that error in the shift register so on the second call that error will go into the DMA FIFO Read. Since there's an incoming error, the read doesn't execute (standard behavior for most functions is to do nothing when there's an error) so it doesn't wait for the timeout.
12-11-2012 03:21 AM
Thanks for the info.
After thought last night I was figuring that it might be an error condition causing it, but I didn' get time to check. I'll be able to check today. If it is I'll just clear that error out and/or stop or somwthing else.