Part Number: CC2640
Tool/software: TI-RTOS
Hi all,
I try to make a communication between a NXP microcontroller and CC2640 based Sable-X in UART.
The microcontroller send looped data to the CC2640, but the Sable-X don't seems to read it.
I've make some tests with an oscilloscope, and I see that data arrive well on Rx pin of the Sable-x, but when I make UART_read, it return 0 for the first package of data, and then it return loop -1.
The result is that I'm not able to go through the readCallback function.
I have already try example projects like the echo project, and it work, but when I try to make the UART of the Sable-X work with an extern microcontroller, I've got nothing.
Rx pin and Tx pin are respectively IOID 1 and IOID 0, size of buffer and package of data match and the baudrate is good.
I don't know why it doesn't work, and it's making me crazy !
Here is some of my code :
void receiveUART(){
int ret;
ret = UART_read(hUart, UART_rxBuf, 20);
printf("The UART read %d bytes\n", ret));
}
UART_Params* UART_Init(){
UART_Params_init(¶msUart);
paramsUart.writeDataMode = UART_DATA_BINARY;
paramsUart.readMode = UART_MODE_CALLBACK;
paramsUart.readCallback = readCallback;
paramsUart.readEcho = UART_ECHO_OFF;
paramsUart.readDataMode = UART_DATA_BINARY;
paramsUart.baudRate = 115200;
paramsUart.readReturnMode = UART_RETURN_FULL;
hUart = UART_open(Board_UART, ¶msUart);
if (!hUart){
printf("UART did not open");
}
printf("UART OPEN\n");
return ¶msUart;
}
thanks in advance.