Tool/software: TI-RTOS
Hello,
I am working with TDA2P based customized board in which TDA2P is interfaced to a safety micro TI TMS570. I am using Processor SDK 03.03.
I am trying to establish a communication between TDA2P and TMS over UART. TDA2P's UART2 (instance 1) is interfaced to the UART of TMS.
For TDA2P, I referred to "uart_echo" example code from "PROCESSOR_SDK_VISION_03_03_00_00/ti_components/drivers/pdk_01_09_00_17/packages/ti/drv/bsp_lld/uart/examples". Using this example code, I have created an application which has a read task to read data over UART2 from TMS.
Currently, the data bytes sent by TDA2P are received by TMS but TDA2P does not receive anything from TMS. I debugged the code to find out that in the read task, my code never comes out of the GIO_read API call.
Below code is UART init and my read task,
"
/* Adding UART2 device */
status = GIO_addDevice("/uart1", (xdc_Ptr) &Uart_IOMFXNS, &init_UART,
UART2_INSTANCE, (xdc_Ptr) &uartParams);
void init_UART(void)
{
uartParams = Uart_PARAMS;
uartParams.opMode = UART_OPMODE_POLLED;
uartParams.hwiNumber = 8U;
uartParams.rxThreshold = UART_RXTRIGLVL_8;
uartParams.txThreshold = UART_TXTRIGLVL_56;
uartParams.baudRate = UART_BAUDRATE_115_2K;
uartParams.charLen = UART_CHARLEN_8;
uartParams.stopBits = UART_NUMSTOPBITS_1;
uartParams.parity = UART_PARITY_NO;
uartParams.prcmDevId = 1; /* 1 is instance number of UART2 */
}
void uart2_ReadTsk(void)
{
Bool exitLoop = FALSE;
size_t len = 0, totalLen = 0;
char *pRxBuf = NULL;
Int status = IOM_COMPLETED;
/* Now the user will input a string of APP_UART_NUM_BYTES bytes.
* Hence submit a read request for APP_UART_NUM_BYTES bytes and loop
* till we receive that many bytes */
while (exitLoop != TRUE)
{
len = APP_UART_NUM_BYTES - totalLen;
status = GIO_read(uartRxHndl, &uart2RxBuf[totalLen], &len);
if (IOM_COMPLETED != status)
{
/* Report Error */
Vps_printf("\r\nUART : GIO_read failed. returned : %d \r\n",
status);
}
totalLen += len;
if (totalLen >= APP_UART_NUM_BYTES)
{
exitLoop = TRUE;
}
}
return;
}
"
I have highlighted the GIO_read call where my code hangs. I have not called "Uart_init()" as it already called from Utils functions during init.
Can anyone suggest what can be the issue here as I am able to transmit data but I am not able to receive any data over UART2.
Regards,
Abhay