You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jturnsek (via GitHub)" <gi...@apache.org> on 2024/01/30 07:02:47 UTC
Re: [PR] imxrt:serial Ensure the cache is updated if the DMA has updated again [nuttx]
jturnsek commented on PR #11020:
URL: https://github.com/apache/nuttx/pull/11020#issuecomment-1916196596
@davids5 I am working on imxrt117x where I also have found some problems with edma. I am using edma with Flexio driver to get ADC samples in. My driver is using the same logic as imxrt_serial rxdma logic and SOMETIMES I am getting corrupted data. Especially when the system is stressed. What I have found out so far is that DONE flag is sometimes not set when it should be., although interrupt is triggered. Because I am relying on DONE flag passed to my callback function, I get wrong context in. If the system is not stressed, DONE flag is set every done-interrupt, half-interrupt has DONE flag set to zero. Looking further with the debugger, I've noticed that when DONE flag was not set, destination address was a few words ahead. This lead me to conclusion that my interrupt routine servicing is delayed a little bit and eDMA ran a little bit further, activating new major loop. From the documentation:
_Channel Done
This field indicates whether the eDMA has completed the major loop. The eDMA engine sets the value of
this field to 1 when the CITER count reaches zero. The value of this field is reset to 0 by the hardware
(when the channel is activated) or by software._
one can see that DONE flag can be reset by hardware. Because imxrt_edma is checking DONE status quite a few times and is also influencing on imxrt_dmach_getcount which is then used in imxrt_serial, maybe this could also be a reason to get missing characters. What do you think? I think imxrt_edma driver should be revised here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org