Part Number: CC2652R
Other Parts Discussed in Thread: SYSCONFIG,
I have been struggling with integrating DMM into a BLE/Thread application.
First, the symptom of the problem - the message queue in the OpenThread Task fills faster than they can pop out, but only if the BLE stack is also running simultaneously. If the BLE stack is paused in DMM then the Thread components all function as expected.
I can make a switching system function, but my main focus is to have simultaneous operation, at least most of the time. I want BLE to beacon every second to know the device is active and to advertise some data. Simultaneously, I want to be able to send and receive data on the Thread network. I know I can pause stacks when needed, such as OAD or heavy transfers, but most of the time I want simultaneous RX functionality and being able to transmit from either stack as needed.
So here's my current setup - There are 3 main tasks (not counting iCall/RTOS idle).
- BLE Task
- mostly the Simple Peripheral example with DMM, single advertisement with temperature data for testing
- OpenThread Task
- mostly the OpenThread FTD ottask.c, but with some DMM integrations
- Main Task
- A simple task that waits for 3 seconds
- then attempting to join a thread network (This is where I see the assert error from the mq)
- then waits for the join to complete (will simply bring up Thread stack if a commissioner isn't active)
- then waits for the device to become a child/router role
- then pings a device on my desk
So far I can use both, but only if BLE is paused while Thread is operating. It seems like either there's a long-running radio task that leads to the queue filling up or the DMM is causing a lot of radio tasks. I also considered the radio might be preempted constantly, causing the radio state to change more than necessary? The behavior is the same if I increase the size of the mq, but it will still eventually fill up regardless of size.
Questions:
- Does anyone see an immediate problem in radio.c that would cause these problems?
- Is there a way to see DMM functionality in ROV? Radio states? System_printf slows everything down significantly, which means the mq doesn't fill up, but it does mean Thread packets are missed or preempted or something.
- Should I do something else like pausing the BLE stack every time Thread is transmitting? It feels like the DMM dynamic windows for TX/RX do not give adequate time to really perform an entire Thread transaction, even a simple ICMP, because return RX is missed.
Code is available upon request.
