#define RECLEN 4 int32_t rec[RECLEN] , ite = 0; bool chkUARTcmd = false; void UART6_IRQHandler(void) { uint32_t ui32Status; ui32Status = MAP_UARTIntStatus(UART6_BASE, true); MAP_UARTIntClear(UART6_BASE, ui32Status); if(ui32Status & UART_INT_RX){ while(MAP_UARTCharsAvail(UART6_BASE) ) { rec[ite++] = MAP_UARTCharGetNonBlocking(UART6_BASE); if (RECLEN == ite) { chkUARTcmd = true; ite = 0; } } } } void UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count) { while(ui32Count--) { MAP_UARTCharPutNonBlocking(UART6_BASE, *pui8Buffer++); } } int main(void) { initUART(); //Initialize UART settings, content omitted. while(1) { if(chkUARTcmd){ UARTSend((uint8_t *)"ABCDEFGH", 8); chkUARTcmd = false; } } }
Hi, We need to useMSP432E401Y UART to receive commands and send back an acknowledgment of the received instructions. However, we've identified that the UART RX and TX share the same register. In the provided code, when writing to the RX buffer, it gets interfered with by the TX process, resulting in the RX buffer being incorrectly written with TX transmission data. How can we resolve this issue? How should we implement simultaneous TX/RX?