-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async/DMA UART2 callback issues #1136
Comments
@rschoop For the async case I see in your request struct you still have UART1 for the read request. Set it to UART2 and you should at least get the callbacks. // Setup the asynchronous request
mxc_uart_req_t read_req;
read_req.uart = MXC_UART1; // <-----
read_req.rxData = RxData;
read_req.rxLen = BUFF_SIZE;
read_req.txLen = 0;
read_req.callback = readCallback; For the DMA case - I worked through this on my side and found it working for both manual and auto handlers. I see you've commented out the Here's an updated project for your use-case. Note I used There's an Also be careful if your printfs are going to the same UART instance and being echoed back by your python script. (printfs go to MXC_Delay(MXC_DELAY_MSEC(50)); // Small delay to allow any echos to complete from python script.
// Otherwise previous echos may hit after this and fill up the FIFO again
MXC_UART_ClearRXFIFO(RX_UART);
error = MXC_UART_TransactionDMA(&read_req);
// ... Hope this helps. |
Hi Jake-Carter , Thank you very much, it helped for sure . But still some issues with UART2 DMA echo . For the async , it was my mistake with UART1 on the read request . I changed it to UART2 and the callbacks works now . Also another mistake I saw was assuming that the blocking MXC_UART_Transaction function has a callback . Now for the async I have a echo that runs on UART2 with no problem. First wait for a read and then echo it back on UART2 . The echo DMA and the python script works perfect for me on the console or UART0 . But when change the UART0 to UART2 , the read flag does not work . Same behavior I had with my echo DMA program . I did not explain my dma program well. The program you see it is only for the write transaction . I can receive the transmitted data and write flag is received . But when I comment out the write transaction and the wait for write flag and use only the read transaction and wait only for the read flag it does not work . So actually my previous dma code is not a echo application . This week I am going to write a register level dma uart echo example on UART2 . The thing is the uart2 echo works well on async . I would like to have uart2 echo on dma . I just changed the following in the sent dma echo example using the python script :
Add the following:
Manual DMA:
Results:
on my console you can see it does not receive the read flag:
Full code:
|
Hello , I have a custom board based on the MAX32650 . UART2 is connected to a FT230X chip and is working fine . In the examples , data is looped back from UART2 to UART1 . I modified the code to work only with UART2 and I am using a terminal program to receive from UART2_TX and send data to UART2_RX.
In the case for Async transmissions , the callbacks from UART2_TX write requests work fine. I receive the data on the terminal every time. But for read requests, blocking MXC_UART_Transaction and non-blocking MXC_UART_TransactionAsync do not work or the callbacks do not work to make READ_FLAG=0 ; When I use blocking MXC_UART_Read it works every time . See the code below .
For DMA transmissions I used the code from #1106 , I modified the code a bit to use only UART2 in my situation , so no loop back from UART2 to UART1 . Callbacks to make WRITE_FLAG and READ_FLAG zero does not work in the case of DMAAutoHandlers. For DMAManualHandlers the call back works only for write requests. For read requests it does not work . Please check the code below .
Please , can you have a look for me ?
The text was updated successfully, but these errors were encountered: