HI. I am using KW40Z. Using the Bare metal Hybrid demo with BLE and Zigbee. BLE is event based using the message queue. Zigbee is based on the SAP handlers which get activated when a message arrives from the MAC or NWK.
In the application code, Both belong to the one task - "main task". Both use one radio resource in the PHY.
I want to make the Zigbee a star coordinator and make it event based too (Like BLE), such that I add a state machine in "ApplMain.c" to handle all the zigbee events and BLE events simultaneously (As in the star coordinator demo). I added the code. In "App_Thread" Function in "ApplMain.c", I now have two event_wait functions in the while loop. The BLE is triggered by pressing "SW4" and Star coordinator is directly started after Initialization.
For some reason the BLE is not working properly.
I have tried the following:
1. If I use only the main task wit hall events: Star coordinator works fine. To Start BLE when I press "SW4", Button press is not registered. I used code breakpoint in IAR to see if the button press is handled, And it is. The code goes to the handler but for some reason does not start BLE. Any ideas on what the issue may be?
2. Making a separate task for BLE(Main task) and Zigbee (New task created). The new task is never executed because the code for "YIELDING" the task is not available in the abstraction and I am not sure if this is the right approach. What is your opinion?
Any help in how to make this work would be great. Thanks.