This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
您好!
我有 带 DMA 的6843AOP UART:
UART_Params_init(&uartParams); uartParams.writeDataMode = UART_DATA_BINARY; uartParams.readDataMode = UART_DATA_BINARY; uartParams.readReturnMode = UART_RETURN_FULL; uartParams.readEcho = UART_ECHO_OFF; uartParams.clockFrequency = gMmwMssMCB.cfg.platformCfg.sysClockFrequency; uartParams.baudRate = gMmwMssMCB.cfg.platformCfg.commandBaudRate; uartParams.isPinMuxDone = 1; uartParams.dmaHandle = dmaHandle; uartParams.txDMAChannel = UART_DMA_TX_CHANNEL; //1 uartParams.rxDMAChannel = UART_DMA_RX_CHANNEL; //2
我没有确切的输入数据长度、因此我修改了 UartSci_read (在 uartsci.c 中)而不等待信标。
// status = SemaphoreP_pend (ptrUartSciDriver->readSem, ptrUartSciDriver->params.readTimeout);
´m 在其他任务中、我查找传输的数据数量:
memset(&pChanStatus, 0, sizeof(pChanStatus)); retCode = DMA_getChannelStatus(handlee, 2, &pChanStatus); cnt_1 = pChanStatus.chCurrFrameCnt;
高于所需限制的情况为:
UART_readCancel(gMmwMssMCB.commandUartHandle);
但在 readCancel 和 UART_READ 的新调用后、dma_getChannelStatus 仍返回最后一个值(cnt_1)。 这是因为在我收到例如30B 长消息后、执行 readCancel+UART_Read 、 然后又收到30B 消息时、该值未更改。 第二次接收到此消息后、值发生了变化。
是否有其他方法可以检查接收到的 DMA 字节的数量? 或者如何纠正此行为?
提前感谢您!