Topic

FAQ
Login Register
ZigBee + BLE SDK - gateway not working
Jul 24, 2022 09:21

/

A

/A

I have a ZigBee gateway based on ZigBee SDK working fine.

Now, because I need to use BLE as well, I tried using ZigBee BLE Concurrent SDK.

Unfortunately ZigBee gateway is not working. I spent a day trying to figure it out, but I can t get it to work.

Only BLE module is working - I can connect to it.


What I can see is, that in the function app_task(), zb_getMacAssocPermit always returns FALSE

void app_task(void){

 static bool assocPermit = 0;

 if(clock_time_exceed(ledtoggle, 500*1000)){

  ledtoggle = clock_time();

  led_toggle(LED_3);      //flash led to see that mcu is working

 }

 if(assocPermit != zb_getMacAssocPermit()){

  assocPermit = zb_getMacAssocPermit();

  if(assocPermit){

   led_on(LED_PERMIT);

  }else{

   led_off(LED_PERMIT);

  }

 }

 if(BDB_STATE_GET() == BDB_STATE_IDLE){

  app_key_handler();

 }


}


What is wrong? Any suggestions?


Edit:

Next, I decided to try zigbee_gateway_controller.exe in the ZigBee SDK Tools folder.

After pressing the button "Start Network", see log below:

2022/7/24 14:58:20.18 -> 55 00 01 00 00 01 AA //! BDB_COMMISSION_FORMATION

2022/7/24 14:58:20.103 <- 55 80 00 00 04 85 00 01 00 00 AA //! ACK

The MCU freezes - led in app_task stops flashing.

What is worse, after disconnecting and reconnecting the power to the module, it is not working any more - i.e. Power Led is OFF, and the flashing led is off as well. BLE is not working either. It looks like some data is corrupted!

Another check, and it turns out that pressing "Factory Reset" button does the same thing - mcu not working any more.





4 replies
TL_Soyo Jul 25, 2022 11:44
0
/A

Hi,

   You can make your own modifications according to the execution flow of the original program,and you can refer to this link http://wiki.telink-semi.cn/tools_and_sdk/Dual_Mode/AN_19071000-E4_Telink%20Zigbee%20BLE%20Concurrent%20Mode%20Demo%20User%20Guide.pdf

wes58 [Author] Jul 25, 2022 12:41
0
/A

I can't modify something that doesn't work. There is no way to guess how it should be working, what should be the flow of the program.

I read the user guide, I looked through the code but it is not easy to understand how things are done.

For example, definition like this in stack_cfg.h:

typedef enum{

TL_IMAGETYPE_LIGHT = 0xd3a3,

TL_IMAGETYPE_RC = 0xd3a2,

TL_IMAGETYPE_ONOFFSWITCH = 0xd3a1,

}tl_imageType_e;

And the sample gateway project has:

#define IMAGE_TYPE    TL_IMAGETYPE_LIGHT

I would have expected that the gateway would have TL_IMAGETYPE_RC - just guess from looking at the names.

But this didn't make any difference

There are some warnings (I know it is only a warning but?)

../stack/zigbee/zbhci/../zcl/../include/../zbapi/zb_api.h:727:4: note: expected 'u8 *' but argument is of type 'const u8 *' ../stack/zigbee/zbhci/zbhciCmdProcess.c:795:3: warning: passing argument 2 of 'zb_nwkKeyUpdate' from incompatible pointer type


That's why I expected that the demo will work - like in any other Telink SDK's. I had never had a problem with demo not working.


Last test I did - I had enabled the while(1) loop in the sampleGwSysException() function:

static void sampleGwSysException(void) {

// SYSTEM_RESET();

//light_off();

 while(1);

}


And here is the log from the BDT debuging:

First entry is after calling bdb_networkFormationStart():
[10:09:30]:
mcu run
[10:09:49]:   Here, I think is the while(1) loop in the exception function
pause mcu, pc : 0x076002
step mcu, : 0x076002
step mcu, : 0x076002
step mcu, : 0x076002
[10:10:17]:
mcu run
[10:10:23]:
pause mcu, pc : 0x076002
[10:11:05]:

I had to press RESET on BDT to restart mcu

reset mcu
[10:11:06]:
mcu run
[10:11:09]:
pause mcu, pc : 0x01566c
00015650 :
1566e: 97ed 99bd tjl 29ec 00015650 :
[10:11:17]:
mcu run
[10:11:20]:
pause mcu, pc : 0x00007e
00000078 :
80: 87fa tj.n 78 00000078 :
7a: ca02 tjge.n 82 [10:11:27]:
mcu run
[10:14:57]:
mcu run
[10:14:59]:
pause mcu, pc : 0x015672
[10:15:01]:
mcu run
[10:15:03]:
pause mcu, pc : 0x0160dc
[10:15:05]:
mcu run
[10:15:07]:
pause mcu, pc : 0x00007e

And here it loops back to pc: 0x00007e, as was at time mark [10:11:20]

MCU is not working any more. I need to re-flash firmware!


So, how can I find out why it doesn't work, and there is no way for me to find out what the source of exception is!

There is no way to set a breakpoint anywhere during debugging, so debugging process is very basic.

I think that Telink would have better tools to track it.


Could someone from Telink try to compile and run the sample_concurrentGW_8258 example to confirm that it is working?

Please let me know if Telink is going to do it. If not, I have to forget about Concurrent SDK (it would be a pity).


TL_Soyo Jul 25, 2022 13:44
0
/A

Hi,

 how about you chip flash size,it is need 1M flash.

wes58 [Author] Jul 25, 2022 14:29
0
/A

Thanks. So this is it I have only 512k chip.

I only looked in the example folder where you have different boards 8258, 826x.

And in the board for 8258, I saw this:

#if (BOARD == BOARD_8258_DONGLE_1M)

/* Running chip flash size select. If 1 - 1M, otherwise (or undefined) - 512K. */

  #define FLASH_SIZE_1M 1

#endif

And another place in the app_cfg.h:

#if (DUAL_MODE_SW_BOOT || DUAL_MODE_HW_BOOT)

#define DUAL_MODE 1

// must use 1M flash, like #define BOARD BOARD_8258_DONGLE_1M

#endif

/* board ID */
#define BOARD_8258_EVK 1
#define BOARD_8258_EVK_V1P2 2
#define BOARD_8258_DONGLE 3
#define BOARD_8258_DONGLE_1M
4
So, all boards are defined! If you can't use it don't put it there!

Isn t it confusing! Shouldn t it be defined here?

I assumed, if I don t have BOARD_8258_DONGLE_1M, I use 0 or levae undefined for 512k.


This should trigger compiler Error if FLASH_SIZE_1M is undefined or 0! That s the correct way of doing things.

I wasted so much time on this!


That s it with Telink Zigbee, can t use it.