davids5 commented on code in PR #11020:
URL: https://github.com/apache/nuttx/pull/11020#discussion_r1374203882


##########
arch/arm/src/imxrt/imxrt_serial.c:
##########
@@ -1373,6 +1373,7 @@ static inline void imxrt_serialout(struct imxrt_uart_s 
*priv,
 static int imxrt_dma_nextrx(struct imxrt_uart_s *priv)
 {
   int dmaresidual = imxrt_dmach_getcount(priv->rxdma);
+  DEBUGASSERT(dmaresidual <= RXDMA_BUFFER_SIZE);

Review Comment:
   @danielappiagyei-bc 
   
   I think the % operations is constant time and branch less.  That would be my 
preferred solution it if is needed.
   
   I am not convinced it is the correct thing to do yet, I would like to 
understand the root cause because it may be hiding a greater problem. 
   
   A few questions:
   
   1.  Are you opening and closing the port between messages?
   2. Did you test with 1 char idle timeout and the fifo buffer size of 32?
   3. Do you run with a separate interrupt stack? 
   4. What is you current stack pentation?
   
   If you configure NuttX with the debug options for debugging hardfault and 
post the output when the assertion fires the task list and stacks usage will be 
show,  
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to