Hello,
I didn't find any previous topic for connection issues with BitCloud.
My chip is an ATMEGA256RFR2.
I'm using a firmware which proved to worked before on another chip (at least the connection part worked).
This is an ED, and it can't connect to the coordinator:
DDRB |= (1<<PB3); //for test
PORTB &= ~(1<<PB3);
NWK_JoinControl_t joinControl = {
.method = NWK_JOIN_BY_DEFAULT,
.secured = true,
.discoverNetworks = true,
.annce = true
};
CS_WriteParameter(CS_JOIN_CONTROL_ID, &joinControl);
//Starting network (results in joining to or forming a ZigBee network)
zdoStartReq.ZDO_StartNetworkConf = appZdoStartNetworkConf; //Setting the callback function
ZDO_StartNetworkReq(&zdoStartReq); //Sending a request to the stack
static void appZdoStartNetworkConf(ZDO_StartNetworkConf_t *startInfo) {
PORTB |= (1<<PB3); //TEST, but PB3 stays low.
//Check if the node has successfully started the network
if (ZDO_SUCCESS_STATUS == startInfo->status) {
appState = APP_IN_NETWORK_STATE;
if (deviceInterface.appDeviceTaskReset)
deviceInterface.appDeviceTaskReset();
}
else
appPostGlobalTask();
}
If I use ZDO_StartNetworkReq, the conf handler should be called, right? How else could I check what's going on? In my example, PB3 stays low.
A few more things:
1.)
After ZDO_StartNetworkReq, the whole stack seems freezed. Interrupts might arrive, but the stack is not responding for the posttasks that's initiated from the ISR's.
2.)
There was a hw error before, the balun's unbalanced pin was shorted to GND. This balun is now replaced, but the above situation is not changed at all.
3.)
Sometimes if I reset the board after this stackfreeze, the appZdoStartNetworkConf is called. (PDS is enabled, so I assume that on the first connection request it goes until some point, and freeze, but after reset, the stack thinks it was already connected before.)
Thanks!