i.MX RT1176 eDMA: CR[HALT] set by Halt-On-Error clears without any software write to C Hello, We are investigating eDMA errors on an i.MX RT1176 (rev B0) running NuttX on a PX4 flight controller board (fmu-v6xrt). The trigger of the errors has been found and fixed in NuttX, but we observed eDMA behavior that we cannot explain from the Reference Manual, and we would like to understand it. Background (public report): https://github.com/apache/nuttx/issues/20881 Fix merged in apache/nuttx: https://github.com/apache/nuttx/pull/20893 ## Configuration - eDMA (the one serving LPSPI, LPI2C and LPUART; not eDMA_LPSR) - CR[HOE] = 1 (Halt On Error), CR[EDBG] = 1 - Scatter/gather enabled; minor-loop channel linking (ELINK) enabled - Channels in use: LPSPI1/2/3, LPI2C1/2/3, LPUART3/4/5/6/8/10 ## What happened A driver bug linked a TCD with CITER = BITER = 0 (scatter/gather) after a valid TCD on LPUART TX channels. We captured the eDMA registers in the error interrupt handler, before clearing the error: - ES[NCE] set, failing channel = an LPUART TX channel, TCD CITER = BITER = 0 - CR = 0x432 (HALT set) When we read CR later from thread context (outside the interrupt), it was 0x412 (HALT clear). The errors came in pairs on the same channel. In most pairs both errors were in the same millisecond, but in some pairs the second error came 1-269 ms after the first. In those cases the LPSPI and LPI2C transfers stopped for almost the same time as the gap between the two errors (for example, 268 ms gap / 270.2 ms interruption). ## What the software does - CR is written only once, at initialization. No code writes CR[HALT] = 0 afterwards. - In the error interrupt handler, the driver writes CERR for the channel, then terminates the transfer on that channel: CEEI, CERQ, TCD CSR = 0, TCD DLASTSGA = 0. The Reference Manual (Rev. 5) describes CR[HOE] as: "any error causes the eDMA engine to write 1 to the HALT field. Subsequently, the eDMA engine ignores all service requests until you write 0 to the HALT field." Our observation does not match this, because HALT became 0 without any software write. ## Questions 1. With CR[HOE] = 1, under what conditions is CR[HALT] cleared without a software write to CR? For example, writing CERR or CERQ, or activating or terminating another channel. 2. While CR[HALT] = 1, what happens to a minor loop that is already executing on another channel, and to service requests that arrive during that time? Are they lost, or are they held and serviced after HALT is cleared? 3. After the error handler has written CERQ and TCD CSR = 0 on the failing channel, what can cause a second NCE on the same channel 1-269 ms later? 4. For a system where several peripherals share the eDMA, would NXP recommend HOE = 0 or HOE = 1? If HOE = 1, is the expected recovery to write CR[HALT] = 0 in the error handler? We have not found an erratum about this in the i.MX RT1170 Chip Errata (Rev. 1.6). We can share the register capture method and more details of the measurement if that helps. Thank you. i.MXRT Re: i.MX RT1176 eDMA: CR[HALT] set by Halt-On-Error clears without any software write to C Hi @miyawaki ,
Thanks for the reaching out! Have you tried with some MCUXpresso SDK demo on an RT1176 rev B0 board to reproduce this issue? I think it would be a useful way to separate eDMA behavior from the NuttX driver and PX4 workload.
Have a great day, Kan
------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. -------------------------------------------------------------------------------
View full article