Tool/software: Code Composer Studio
Hi all,
I am running the project zero on the dev board and I have problems with the UART RX INT
here is the setup
on init:
UART_init();
// Initialize UART parameters
UART_Params_init(&Bottom_COM_Params);
Bottom_COM_Params.baudRate = c_Top_Baudrate;
Bottom_COM_Params.readMode = UART_MODE_CALLBACK; //UART_MODE_BLOCKING
Bottom_COM_Params.writeMode = UART_MODE_CALLBACK;
Bottom_COM_Params.readTimeout = UART_WAIT_FOREVER; //UART_WAIT_FOREVER;
Bottom_COM_Params.writeTimeout = UART_WAIT_FOREVER;
Bottom_COM_Params.writeCallback = Send_Byte;
Bottom_COM_Params.readCallback = Byte_Received;
Bottom_COM_Params.readDataMode = UART_DATA_BINARY;
Bottom_COM_Params.writeDataMode = UART_DATA_BINARY;
Bottom_COM_Params.readReturnMode = UART_RETURN_FULL;
// Open the UART
Bottom_COM_Handle = UART_open(BOTTOM_UART, &Bottom_COM_Params);
pRX = &RX_Buffer[0];
Bytes_Received = 1;
UART_read(Bottom_COM_Handle, pRX, Bytes_Received);
in the RX Call back a timeout timer is started, which sets a flag indicating Data was received
void RXTimeout(UArg ID){
Timeout_ON = false;
RX_Received = true;
}
void Byte_Received(UART_Handle handl, void *buf, size_t count){
// Set and Start COM Timeout Timer
if(Timeout_ON == false){
Util_startClock((Clock_Struct *)TimeOutHandle);
Timeout_ON = true;
}
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
this setup works perfectly for the TX INT, I put one Byte in the X buffer, it gets transmitted and in the TX int it gets the next byte.... and so on.
problem with RX INT
setting the
Bytes_Received to 0 does not set the INT, the call back function Byte_Received() gets never called!
-------
Bytes_Received to 1 set the INT, the call back function Byte_Received() gets called!
but when it comes to
ReceivedFromUART = UART_read(Bottom_COM_Handle, pRX, i);
the first byte is missing?!!! and ReceivedFromUART is always 0!!! but there are all the bytes in the pRX[] buffer, except the first one
Is this a bug in the UARTCC26XX.c file?
I don't understand why the RX INT is only set with UARTCC26XX_read(xxx);
thanks for your help
Best regards
Kurt