2023-09-16 11:26 PM
We are using a the Microcontroller for one of our products , we are using two UARTS for communication , however when both the UARTS are enabled we are facing some difficulties in the communication, can anybody help in this ?
Attached is the main file for the same.
Can we have a call or something with the concerned Engineers so that this can be resolved ?
I will give the details for this.
2023-09-16 11:45 PM - edited 2023-09-16 11:46 PM
Hello @Pooshan
Can you add the reference of the MCU you are using. I personally suggest you to do debug your code and to use an oscilloscope to visualise all signals to have a clear idea on the issue.
Best regards.
II
2023-09-17 12:55 AM
I had read your code already but I really unsure what is your idea to manage both USART.
I had saw somewhere in USART interrupt for USART2 that you didn't get USART2 data but I also do not see another configuration about USART and DMA so I don't see their relation between them.
2023-09-17 03:01 AM
Do you not have your own engineers?
STM32 parts should have no problem dealing with multiple UARTs concurrently and in full duplex modes. Should avoid using blocking functions, or blocking in interrupts or callbacks. Time there should be very brief, basically just buffering, with processing handled in other tasks or threads.
2023-09-20 09:00 PM
I hope this video tutorial will help: haven't tested it with L0 yet, but it surely works on F1 (3 ports), F4 and H7 (8 ports).
2023-09-21 08:08 AM
Hi,
Is there no transmit function?
The two UARTS seem to be putting their data in the same receive buffer viz:
HAL_UARTEx_ReceiveToIdle_DMA(&huart1, RX_Buffer, 50);
__HAL_DMA_DISABLE_IT(&hdma_usart1_rx, DMA_IT_HT);
HAL_UARTEx_ReceiveToIdle_DMA(&huart2, RX_Buffer, 50);
__HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_HT);
Shouldn't you have RX_Buffer1 and RXBuffer2.?
Regards
Rob
2023-09-21 09:01 AM
BaudRate setting is different, UART1 is set to 115200 and UART2 is set to 9600
2023-09-22 08:07 AM
Are you related to the OP? Unfortunately forum questions will likely stall-out if the OP ceases to participate.