Hi Alice
I have tried your suggestion and it sort of works. The only problem is when receiving data, it misses the last character and substitutes 00 at other character positions. Example, I receive 8 bytes and echo them using...
static void rs485Task( void *pvParameters )
{
uint16_t *reg, N,base,k;
reg = (uint16_t *)pvParameters;
static uint8_t buf[255];
UART_HAL_SetTransmitterRtsPolarityMode(UART0_BASE_PTR,true); // use RTS to enable RS485
UART_HAL_SetTransmitterRtsCmd(UART0_BASE_PTR,true);
while(1)
{
if (kStatus_UART_Success == UART_DRV_EdmaReceiveDataBlocking(rs485_IDX, buf, 8,OSA_WAIT_FOREVER))
UART_DRV_EdmaSendDataBlocking(rs485_IDX, buf, 8, OSA_WAIT_FOREVER);
..........etc
Here is a typical log of data (TX) sent by an external source vs. what has been received (RX):
I am using UART0 with its 4 byte fifo. Should the fifo be disabled when using DMA?
Any other suggestion?
Many thanks
Pete