I am working on a CC2640 4x4 custom board, BLE stack 2.1, CCS 6.1, TI RTOS 2.13. The UART
is used for wired sensor calibration in read callback mode and write blocking, baud rate 9600 bps.
Once calibration is complete, the idea is to switch to BLE operation without the use of UART in
steady state.
UART activity will be checked once during SimpleBLEPeripheral initialization. I can
also set it up to be checked on the clock event, but I didn't have luck getting the clock to run at the
clock event either. I constructed a one shot clock, since the wait between starting this clock is
variable. I start the clock every time I monitor UART activity.
The UART is read one byte at a time in order to extract the message length from the incoming frame.
When the end of the message is reached, the read callback function puts the UART event in the RTOS
queue. After the UART message is processed, the task sleeps a while and checks for UART activity
again.
UART activity is monitored for a period of 20 bytes to account for any gap between the receive bytes
or lack of UART activity. After a time limit of 20 bytes, the wait for UART function does nothing if UART
activity is absent. I tried using a clock to time the UART monitoring. I am having trouble getting the
clock to run. Will a timer work better in this situation. If so, how do I set one up?
Can you also comment if this set up is BLE thread safe?
Thanks,
Priya