XMC4500 and UART multiple data transmission problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I have created a Dave 3 CE project for Hexagon Application Kit with a UART001 app. Everything works fine in transmission and reception but when I start transmitting data using multiple times the function UART001_WriteDataMultiple(&UART001_Handle0,Data,sizeof(string)) the UART stops working at the moment that the transmit FIFO is full.

Have I to redirect the pointer of the FIFO? How can I solve this issue?

Thanks in advance and best regards,
MagicPhoton
0 Likes
2 Replies
Not applicable
Hey Infineon-Team,

i got the same Problem and i don´t know why? plz help me
0 Likes
Not applicable
I would like to explain the behavior. If I read the incoming characters:in a buffer
ISR:

do{
tmpc = (uint16_t)UartRegs->OUTR;

if (!__BUF_IS_FULL(rb.rx_head, rb.rx_tail)) // If no more space, remaining character will be trimmed out
{
rb.rx[rb.rx_head] = tmpc;
__BUF_INCR(rb.rx_head);
}

}while(!USIC_ubIsRxFIFOempty(UartRegs));


can I send multiple characters with:

UART001_WriteDataMultiple(&UART001_Handle0,(uint8_t*)RecBuf,(uint32_t)strlen(RecBuf));

But if i want to send characters before Reading only got 3 characters...
Here my Uart Receive function:

uint32_t UART_Receive(const UART001_HandleType* Handle, uint8_t *rxbuf, uint8_t buflen)
{
uint8_t *data = (uint8_t *) rxbuf;
uint32_t bytes = 0;

// Temporarily lock out UART receive interrupts during this read so the UART receive interrupt won't cause problems with the index values
UART_IntConfig(UARTx, UART_INTCFG_RBR, DISABLE);

// Loop until receive buffer ring is empty or until max_bytes expires
while ((buflen > 0) && (!(__BUF_IS_EMPTY(rb.rx_head, rb.rx_tail))))
{
*data = rb.rx[rb.rx_tail]; // Read data from ring buffer into user buffer
data++;
__BUF_INCR(rb.rx_tail); // Update tail pointer
bytes++; // Increment data count
buflen--; // Decrement buffer size count

}

UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); // Re-enable UART interrupts

return bytes;
}
0 Likes