Hi Everyone
I am having a code on TIRTOS and the platform is cc1310 , the code simply reads the message from UART and send it over the air. But now the problem is that the UART can not read all messages. For example, I used a 30-byte buffer, and sent a 100-byte message through UART, it only read three times, giving me two 30-byte payload and one 2 byte payload(62 bytes in total). Ideally, it shall be 30+30+30+10. So I am just wondering how shall I read a long message through UART.
Below is my code
static void rfEasyLinkTxFnx(UArg arg0, UArg arg1) { /* Create a semaphore for Async */ Semaphore_Params params; Error_Block eb; /* Init params */ Semaphore_Params_init(¶ms); Error_init(&eb); /* Create semaphore instance */ txDoneSem = Semaphore_create(0, ¶ms, &eb); rxDoneSem = Semaphore_create(0, ¶ms, &eb); EasyLink_init(EasyLink_Phy_50kbps2gfsk); /* Set Freq to 868MHz */ EasyLink_setFrequency(868000000); /* Set output power to 12dBm */ EasyLink_setRfPwr(12); /* Create a UART with data processing off. */ UART_Params_init(&uartParams); //uartParams.readMode=UART_MODE_CALLBACK; uartParams.writeDataMode = UART_DATA_BINARY; uartParams.readDataMode = UART_DATA_BINARY; uartParams.readReturnMode = UART_RETURN_FULL; uartParams.readEcho = UART_ECHO_OFF; uartParams.baudRate = 115200; uartParams.readTimeout=(1000000 / Clock_tickPeriod); //uartParams.readCallback=readCB; uart = UART_open(Board_UART0, &uartParams); while(1) { number = UART_read(uart, txPacket.payload, RFEASYLINKTXPAYLOAD_LENGTH); if(number>0) { UART_write(uart, txPacket.payload, number); txPacket.len = number; txPacket.dstAddr[0] = 0xaa; int numbersToTransmit = 3; // EasyLink_transmitAsync(&txPacket, txDoneCb); // /* Wait 300ms for Tx to complete */ // if(Semaphore_pend(txDoneSem, (300000 / Clock_tickPeriod)) == FALSE) // { // /* TX timed out, abort */ // if(EasyLink_abort() == EasyLink_Status_Success) // { // /* // * Abort will cause the txDoneCb to be called, and the txDoneSem ti // * Be released. So we must consume the txDoneSem // * */ // Semaphore_pend(txDoneSem, BIOS_WAIT_FOREVER); // } // } } } }
I am debugging it with HTERM. I sent over 100 bytes, and only 62 bytes received. The code is based on the example easylinkTX
The problem happens also in UARTecho when one sending a long packet(more than 60 bytes)
Thanks in advance