Hi,
I don't really know what is going on in the TI MAC/Z-Stack library, but it is not working accordingly.
My hardware is a CC2530EM mounted on a SmartRF05eb evaluation board. Sofware is based on a mix of Timac 1.3.1 stack and Z-Stack 2.4.0-1.4.0
I have a node that switches from a Chan22-Receiver to a Chan26-PanCoord beacon mode. It switches back and forth infinitely.
The problem occurs when switching from the Chan26-PanCoord beacon mode to Chan22-Receiver. It remains, occasionally, on the Chan 26 frequency.
What the written code does is as follows:
Forever Loop:
(a) Configure node to be a Chan26-PanCoord and put out 3 beacons on Chan 26 // MAC_RX_ON_WHEN_IDLE = False, MAC_ASSOCIATION_PERMIT = False
(b) After 3 beacons, the code stops the Chan26-PanCoord by sending MAC_MlmeStartReq(&stopReq) with stopReq.beaconOrder = 15; // this always works
(c) // Now change to Chan22-Receiver ;
(d) MAC_MlmeResetReq(TRUE); // this follows other codes which set up the Mac address and so forth ...
(e) MAC_MlmeScanReq(&scanReq) with scanReq.scanChannels = MAC_CHAN_22. // sometimes ok, sometimes Nok (Not ok).
// If Nok, node will remain on Chan26
(f) .... Lines of Codes to check if the switch is unsuccessful by checking if packets on Chan 26 is being received ....
(g) if packets on Chan 26 received successfully then { // Something wrong here - did not switch to intended channel 22
// use even lower level Mac functions to change the channel:
macRadioSetChannel(MAC_CHAN_22); // This doesn't work at all - will still scan on Channel 26
macLowLevelReset(); // This doesn't work at all - will still scan on Channel 26
macLowLevelInit(); // this definitely knocks the node back to Channel 22, but this line will screw up the (b) part in the Forever Loop. Program hangs on (b).
MAC_InitCoord(); // this also knocks the node back to Channel 22, but like the above line, program will hang when it loops back to (b) later.
Endif
Repeat
Qn : why are all the High level and low level resets useless in making the node switch channels ( i.e. from 26 to 22) ?
While the high and low level Mac Init functions are effective, they screw up later codes which require switching back to Chan26-PanCoord . So they are not the solution either.
I know that another solution is to use watchdog reset. But that is my last means. I would expect a mature chip like the CC2530 to perform as expected.
My company has already invested on an entire reel of CC2530 and CC2591 ICs. I really don't know how to face my CEO if this simple channel switching issue is indeed a TI chip bug.
Thanx.