Other Parts Discussed in Thread: SYSCONFIG
Hi Folks,
I can't seem to communicate simultaneously with two UART devices attached to the native UART ports. The CC26X2R1 series features two native UART ports as well as the sensor controller which can be used a UART emulator. In my application, a 115200 and a 9600 bps device are mapped to the UART0 and UART1 through SysConfig. I send one way and call-response style messages periodically to both devices.
I suspect my simultaneous UART2 driver instances are causing problems because of the significant difference in baud rate. HWI generated by full RX buffers to execute callbacks likely interrupts the behavior of the other UART2 instance.
- A 70 byte long RX received at 115200 bps takes (560 [bits]/11500 [bits/sec]) 4.8611 milliseconds under ideal conditions.
- TX (One Way) every 20 ms
- TX (Call/Response) every 50ms
- A 20 byte long RX received at 9600 bps takes (160 [bits]/9600 [bits/sec]) 16.667 milliseconds under ideal conditions.
- TX (One Way) every 200ms
- TX (Call/Response) every 100ms
When only clocks associated with UART0 are running, the behavior of UART0 is as expected.
[Cortex_M4_0] Host Display Initialized Tasks Initializing: SERIAL: UART0 Initialized Successfully SERIAL: UART1 Initialized Successfully UART0: TX - Request UART0: RX - Processing Callback Executed! UART0: PASS Packet (70) Length Received (70) UART0: PASS Packet Termination UART0: Completed RX Parsing UART0: TX - Request UART0: RX - Processing Callback Executed! UART0: PASS Packet (70) Length Received (70) UART0: PASS Packet Termination UART0: Completed RX Parsing
When only clocks associated with UART1 are running, the behavior of UART1 is as expected.
[Cortex_M4_0] Host Display Initialized Tasks Initializing: SERIAL: UART0 Initialized Successfully SERIAL: UART1 Initialized Successfully UART1: TX - Request 0x08 UART1: RX - Processing Callback Executed! UART1: Completed RX Parsing UART1: TX - Request 0x09 UART1: RX - Processing Callback Executed! UART1: Completed RX Parsing
When scheduling clocks associated with both UART0 and UART1, the one or both peripherals stops receiving or transmitting correctly. Here, UART0 is unable to handle RX correctly and UART1 is unaffected.
[Cortex_M4_0] Host Display Initialized Tasks Initializing: SERIAL: UART0 Initialized Successfully SERIAL: UART1 Initialized Successfully UART0: TX - Request UART0: RX - Processing Callback Executed! UART0: PASS Packet (70) Length Received (70) UART0: PASS Packet Termination UART0: Completed RX Parsing UART0: TX - Request UART1: TX - Request 0x08 UART1: RX - Processing Callback Executed! UART1: Completed RX Parsing UART0: TX - Request UART0: RX - Processing Callback Executed! UART0: PASS Packet (70) Length Received (70) UART0: FAIL Packet Termination UART0: TX - Request UART1: TX - Request 0x09 UART1: RX - Processing Callback Executed! UART1: Completed RX Parsing
Ultimately, it could be a driver limitation or flawed RTOS Task Design. Either way, I would appreciate a second set of eyes - I would like to share my project code privately for some help.
Thanks,
Ken