Part Number: TMDXIDK5728
Tool/software: TI-RTOS
Dear all,
I try to get RS-485 running on the IDK, but I have some troubles with that. Basically I removed all other code to break it down to the UART routine.
I'm using the am5728x IDK v1.2, Processor SDK RTOS AM57xx 4.2.0.
/* main entry point */
int main()
{
/* Init Board */
initBoard();
biosTaskCreate(uart_test,
"uart_test",
8, 4096);
/* Start the BIOS 6 Scheduler */
BIOS_start ();
return 0;
}
static int initBoard()
{
/* Call board init functions */
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_MODULE_CLOCK;// | BOARD_INIT_UART_STDIO;
Board_init(boardCfg);
}
void uart_test(UArg arg0, UArg arg1)
{
UART_Params uartParams;
int32_t count;
char input = '\n';
char buffPointer[1000];
char echoPrompt[] = "\n";
char echoPrompt1[] = "Data received is\n";
// CSL_xbarDspIrqConfigure(1,
// CSL_XBAR_INST_DSP1_IRQ_34,
// CSL_XBAR_UART2_IRQ);
UART_init();
/* Create a UART with data processing off. */
UART_Params_init(&uartParams);
uartParams.writeMode = UART_MODE_BLOCKING;
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 9600;
uart_handle = UART_open(0x01, &uartParams);
//First write does not work
UART_write(uart_handle,echoPrompt,sizeof(echoPrompt));
while(1)
{
UART_write(uart_handle,echoPrompt1,sizeof(echoPrompt));
Task_sleep(250);
}
}
I've used the examples to get started. The schematic and pinmux says, that the RS-485 is connected to UART2. So I've opened 0x01 and I get the correct handle and address. Everything looks fine, but I never get back from the write routine, because it stucks in the semaphore in UART_write2_v1:
if (object->params.writeMode == UART_MODE_BLOCKING)
{
/* Pend on lock and wait for Hwi to finish. */
semStatus = UART_osalPendLock(object->writeSem,
transaction->timeout);
The interesting part is, that this example works with the UART3, so I get response from the FTDI. Probably its something easy, but I've no more ideas, where to start.
Thanks!