Other Parts Discussed in Thread: CC2540, , SYSBIOS
Tool/software: TI-RTOS
Hey there,
I am developing a custom Observer project which communicates with a Master over UART, however I have been having a lot of trouble properly parsing packets with the included UART driver. The Master's packet structure consists of a header byte (0x0D), followed by two opcode bytes, followed by two length bytes, followed by the payload. What I want to do is wait for a header byte and then read the two opcode bytes and two length bytes and then parse the payload based on that. However, the UART driver only enables RX while in UART_read(), so when I call UART_read() for one byte (header byte), RX gets turned off once that byte is read into the buffer which causes me to lose sync with the Master. I have tried using the NPI Transport Layer APIs (http://processors.wiki.ti.com/index.php/Cc2640_Adding_a_UART_or_SPI_driver_to_a_Sample_Project
This project is aiming to replace an identical application which functions on the CC2540 with the old BLE stack. The CC2540 project used the HAL UART driver in this way without causing problems. Is there a way to use the HAL UART driver on the CC2640. Alternatively, is there a method to read the UART byte-by-byte with no issues? Thank you.
Regards,
Nick