This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2538: CC2538 support maximum number(devices)

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK, CC2530, CC2652R

Hi TI team 

My zigbee network CC2538 as Coordinator,and CC2652 as a end device,no router, in the zstack3.0.2 if I want the CC2538 support maximum number 80.

I set the NWK_MAX_DEVICE_LIST=79;and bdbTrustCenterRequireKeyExchange=FALSE; 

This modify can supprt the 80 devices? I heard my friend CC2538 as FFD,maximum 24 RFD.according to Pending Address register.

These two parameters affect this parameter(default value:ZDSECMGR_TC_DEVICE_MAX=40)?

So If I set two parameters,the Coordinator just support 40 or 80, or 24?

I should increase the Coordinator memory space stack?

If affect the end device(CC2652) rejoin or frequent dropped?

  • 1. Why do you use NWK_MAX_DEVICE_LIST=79 not NWK_MAX_DEVICE_LIST=80 if you want to support 80 devices?

    2. As I know, these two parameters don't affect ZDSECMGR_TC_DEVICE_MAX.

    3. If you don't enable bdbTrustCenterRequireKeyExchange, it should be able to join NWK_MAX_DEVICE_LIST Zigbee HA devices.

  • OK! Thanks for your reply YiKai Chen. 

    1. zstack3.0.2 original source code 

       // Maximum number in tables

    #if !defined( NWK_MAX_DEVICE_LIST )
    #define NWK_MAX_DEVICE_LIST 79 // Maximum number of devices in the
    // Assoc/Device list.
    #endif

    // Don't change this value to set the number of devices. Change
    // NWK_MAX_DEVICE_LIST above
    #define NWK_MAX_DEVICES ( NWK_MAX_DEVICE_LIST + 1 ) // One extra space for parent

    reply: I may mistakenly think the code #define NWK_MAX_DEVICES ( NWK_MAX_DEVICE_LIST + 1 )

    2&3.reply:I had looked up about set the maximum number of devices in this TI  forum a post,the answer are: a.NWK_MAX_DEVICE_LIST;b.bdbTrustCenterRequireKeyExchange=FALSE[condition:coordinator and end device,no router]

    Now you answer is not affect ZDSECMGR_TC_DEVICE_MAX, so in my zigbee system ,the coordinator support maximum number is 80,no 40? right?

    And sure bdbTrustCenterRequireKeyExchange is FALSE or TRUE

     

    I have another problem,the zstack using stack heap(zsatck3.0.2 default 16K RAM,no entire 32K RAM),if i want to increase it,how much it is more suitable?and had other potential risks,eg:in some applications, increasing the RAM to this value will cause Z-Stack to lock up!

    about the Post  

    Thanks!

  • 1. You should define NWK_MAX_DEVICE_LIST to support upto 80 devices.

    2. With bdbTrustCenterRequireKeyExchange is set to FALSE, the coordinator support maximum number is 80.

    3. If you add the patch in , I see no problem on this.

  • OK! Thanks for your reply YiKai Chen. 

    Soft Reset/Freezing/Stack Overflow due to BDB_REPORTING on CC2530/CC2531

    Issue description:
    The default size of the XDATA stack is 0x300 (768 bytes), and with the addition of BDB_REPORTING in an application, sometimes the callstack will become too large and overflow the XDATA stack. 

    Proposed Fix:
    Increase the size of the XDATA stack in the project options to at least 0x400:

     

    my coordinator is CC2538,no CC2530, I had not see the set XDATA stack in the CC2538 project(using GenericApp.project using IAR FOR ARM 8.11.3)

    I should set it in the linker file?(Z-Stack 3.0.2\Projects\zstack\HomeAutomation\GenericApp\CC2538\Coordinator\List  GenericApp.map).

  • There is no XDATA issue on CC2538 so you can skip it.

  • Thanks for your reply YiKai Chen

    now I can set it  entire 32K RAM(sure no potential risks?) 1.define region SRAM = mem:[from 0x20000000 to 0x20007FFF]; 

                                                  2 in the linker file (Z-Stack 3.0.2\Projects\zstack\HomeAutomation\GenericApp\CC2538\Coordinator\List  GenericApp.map).

                                                 "A0": place at start of [0x00200000-0x0027c7ff] { ro section .intvec };

    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x0027c7ff] { ro };
    "A9": place at start of [0x20004000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20004000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    place at end of SRAM { section .noinit };
    initialize by copy { rw };

  • Yes, that's correct.

  • OK! Thanks!YiKai Chen!

  • The CC2652R ZEDs will request to update the TC Link Key by default, regardless of whether bdbTrustCenterRequireKeyExchange is set to FALSE or not on the CC2538 ZC.  Therefore you will need to increase ZDSECMGR_TC_DEVICE_MAX to 80 as well.  Since the NV memory is initialized on start-up based off these definitions you will need to increase OSAL_NV_PHY_PER_PG, HAL_NV_PAGE_CNT, and FLASH/NV_MEM regions of the linker file: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/746836/2799808#2799808 

    Regards,
    Ryan

  •   Thanks for correcting this. I would like to clarify something. Does NWK_MAX_DEVICE_LIST define the number of end devices that is directly connected to the parent node and ZDSECMGR_TC_DEVICE_MAX define total number of devices that can join the Zigbee network? For example, if we define NWK_MAX_DEVICE_LIST as 20 and ZDSECMGR_TC_DEVICE_MAX as 80 on coordinator, it means we can have 20 end devices connected to coordinator directly and we can have total 80 devices join in the network when we have routers in the network?

  • Hi Ryan Brown1,Thanks your reply,
    another post I have set the paramters as follow:1.define region SRAM = mem:[from 0x20000000 to 0x20007FFF]; 

          2 in the linker file (Z-Stack 3.0.2\Projects\zstack\HomeAutomation\GenericApp\CC2538\Coordinator\List         GenericApp.map).

    "A0": place at start of [0x00200000-0x0027c7ff] { ro section .intvec };

    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x0027c7ff] { ro };
    "A9": place at start of [0x20004000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20004000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    place at end of SRAM { section .noinit };
    initialize by copy { rw };

     3.NWK_MAX_DEVICE_LIST =79;

     4.ZDSECMGR_TC_DEVICE_MAX=80;

    5.bdbTrustCenterRequireKeyExchange=FALSE;

    6.HAL_NV_PAGE_CNT = 12 ;OSAL_NV_PHY_PER_PG =2;

    7. FLASH = mem:[from 0x00200000 to 0x002797FF];
       NV_MEM = mem:[from 0x00279800 to 0x0027F7FF];

      result:bulid successfully.  

     Have a question:what SRAM and FLASH are the respective uses and storage?I can learn more detail.                                                              

    I have two questions,Please help to answer it,Thanks!:1.If in my zigbee system(coordinator,and end device,no router),I want Coordinator support the 80
                                                                                              as same as the red line paramters above,right?
                                                                                           2. If my zigbee system has a router,what parmters can i set it ?
  • Hi YK,

    Yes, your explanation is correct.

    Hi user5948209,

    You can refer to the CC2538 User's Guide (swru319) if you would like to know more about Flash/SRAM in general.  Flash is used for application code and NV memory, SRAM is used for variable and heap storage.

    Your understanding of the network based on the settings provided is correct.  If you add routers (parents) that have end devices connected (children) then you can reduce NWK_MAX_DEVICE_LIST for routing devices accordingly.  If you were to add several routers then you would perhaps consider increasing MAX_NEIGHBOR_ENTRIES and NWK_MAX_ROUTERS, but based on your inquiries up to this point I would not believe this to be an issue.  Routers are unaffected by ZDSECMGR_TC_DEVICE_MAX but it must remain 80 for the ZC trust center.

    Regards,
    Ryan

  • Hi Ryan Brown1 ,Thanks your reply,

    this pdf [the CC2538 User's Guide (swru319)] I had not found,and i look introduction about flash on the PDF[Serial Boot Loader for CC2538]

    Base on this post,I had my understand,you check if right or not,

    1.in my zigbee sysyem,no routers,just coordinator and end device,it set it in summary,the coordinator just support maximum 80,

    2.Regardless of zigbee system has router or not,the coordinator  just support maximum 80 direct children devices(eg. 80=router+end device or 80=end devices),

    2.I had browse carefully this post, He want to expand coordinator zigbee network,set the ZDSECMGR_TC_DEVICE_MAX=150;

      His zigbee system had a router ,right?Ryan Brown1 you say the max value of ZDSECMGR_TC_DEVICE_MAX are equal to 80,why he can set it 150?

  • As Ryan has confirmed, , if you define NWK_MAX_DEVICE_LIST as 20 and ZDSECMGR_TC_DEVICE_MAX as 80 on coordinator, it means you can have 20 end devices connected to coordinator directly and you can have total 80 devices join in the network when you have routers in the network

  • OK,Thanks YiKai Chen and Ryan Brown1 answer, But base your reply,why this post he can set ZDSECMGR_TC_DEVICE_MAX=150,why the maximum is not 80?

    https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/746836/2799808#2799808  

  • I suggest he wants max 150 devices ( including routers and devices) to join his Zigbee network so he set ZDSECMGR_TC_DEVICE_MAX as 150. ZDSECMGR_TC_DEVICE_MAX can be set according to flash limitation and your application requirements.

  • OK,Thanks YiKai Chen!

    I set ZDSECMGR_TC_DEVICE_MAX =235,and other parmeters set it as like I said before, The IAR FOR ARM 8.11.3 can compile successfully just now,

    It meas that the coordinator can support 235 nodes(Regardless of router or end device)?

    So in my zigbee network system.I can set the coordinator support maximum 235?

    And you suggest 150 devices are suitable.

    Thanks!

  • If you set ZDSECMGR_TC_DEVICE_MAX =235, it means you can join max 235 device into this Zigbee network but the max end device directly connected to coordinator depending on NWK_MAX_DEVICE_LIST.

  • OK,Thanks YiKai Chen! I have understand it!

    And the CC2538 entire 32K SRAM have used,it can affect the Stack space which it previously allocated?

    I have another post about CC2538 2652 OTA. You can give me pointers when you are free!Thanks!

  • I couldn’t understand your question “And the CC2538 entire 32K SRAM have used,it can affect the Stack space which it previously allocated?” Can you elaborate?

  • OK,I mean that default usinge SRAM is 16k on the zstack3.0.2.

    Now I expand the entire SRAM from 16K to 32K(32K all use it), the SRAM is used for variable and heap storage,the stack space also in SRAM(eg Function address).

    Can  the 32K SRAM all using in zstack3.0.2  bring what risks.

    This post can as a coordinator support maximum devices,because I browse before not that more details.

    Thanks!

  • No, it won’t have problem to use whole 32K SRAM.

  • OK! got it!

  • If we join Zigbee HA 1.2 ZRs and ZEDs into Zigbee 3.0 network, does ZDSECMGR_TC_DEVICE_MAX constrain the total number of joined ZRs and ZEDs? My understanding is that ZDSECMGR_TC_DEVICE_MAX only constrain max total number of Zigbee 3.0 ZRs and ZEDs. Is my understanding correct?

  • Yes , your understanding is correct.

    Regards,
    Ryan

  •  Thanks for confirming this!

  • OK,Thanks 

    According to ,if the ZED or ZR devices(run Zigbee HA 1.2 ) join the ZC(Zigbee3.0).the ZC total devices support(eg:100),just contain  ZED or ZR devices(Zigbee3.0)[100].

    How to calculate the number devices[the ZED or ZR devices(run Zigbee HA 1.2)]. 

  • Do you mean to know max number of Zigbee HA 1.2 ZRs and ZEDs can join a Zigbee network? If so, it will depend on how many ZRs join to network and how NWK_MAX_DEVICE_LIST is set on ZC and ZRs. You can refer to which has 660 HA devices on a Zibgee network.

  • userjiabo,

    ZDSECMGR_TC_DEVICE_MAX would not need to change for adding 1.2.2a devices but you would need to increase NWK_MAX_DEVICE_LIST if they are directly joining the coordinator.  If this macro gets too large then you will need to increase your NV item memory settings to compensate.  This not an issue since the CC2538 has plenty of extra flash space.

    Regards,
    Ryan

  • Yes ,I want to know it. I will brown this post.Thanks!

  • OK,Thanks  reply,I mean that this parameter NWK_MAX_DEVICE_LIST contain total devices[1.2.2a  and zigbee3.0].

    I understand that ZDSECMGR_TC_DEVICE_MAX contain all the zigbee network devices numbers.

  • Yes, NWK_MAX_DEVICE_LIST constrains total devices[1.2.2a  and zigbee3.0].

  • OK,! Thanks reply! 

    your previous post I had not turn on it.

  • Hi YiKai Chen,

    I had do it just now: 1. ZDSECMGR_TC_DEVICE_MAX=80;

                                     2. NWK_MAX_DEVICE_LIST=80;

                                     3.NWK_MAX_ROUTERS=0 or 1;

                                     4.keep the default Configuration,no expand the flash.

    Build result: Error[Lp011]: section placement failed

                       unable to allocate space for sections/blocks with a total estimated minimum size of 0x40dc bytes (max align 0x4) in <[0x20004000-0x20007fff]> (total uncommitted space 0x3f00).

                       Error[Lp021]: the destination for compressed initializer batch "P2-1" is placed at an address that is dependent on the size of the batch, which is not allowed when using

                       packbits compression. Consider using "initialize by copy with packing = zeros" (or none) instead.

                       Error while running Linker.

    I had do it just now: 1. ZDSECMGR_TC_DEVICE_MAX=40;

                                     2. NWK_MAX_DEVICE_LIST=80;

                                     3.NWK_MAX_ROUTERS=0 or 1;

                                     4.keep the default Configuration,no expand the flash.

    Build result: Error[Lp011]: section placement failed

                       unable to allocate space for sections/blocks with a total estimated minimum size of 0x3f20 bytes (max align 0x4) in <[0x20004000-0x20007fff]> (total uncommitted space 0x3f00).

                         Error[Lp021]: the destination for compressed initializer batch "P2-1" is placed at an address that is dependent on the size of the batch, which is not allowed when using

                         packbits compression. Consider using "initialize by copy with packing = zeros" (or none) instead.

                         Error while running Linker.

    I had do it just now: 1. ZDSECMGR_TC_DEVICE_MAX=40;

                                     2. NWK_MAX_DEVICE_LIST=79;

                                     3.NWK_MAX_ROUTERS=0 or 1;

                                     4.keep the default Configuration,no expand the flash.

    Build result: successfully.

     Now I had a problem, Can I set the ZC support the 80 ZE devices without expanding flash?

    Thanks!

  • No, I think you need to expand flash.

  • OK,Thanks Yi Chen 

  • Increasing the SRAM section of CC2538.icf addresses this specific linker error, however FLASH and NV_MEM will also need to be changed to account for the larger address tables

    Regards,
    Ryan

  • OK Thank you Ryan!

  • Hi Ryan Brown1

    I had set the parameters as follows successfully in the linker file (Z-Stack 3.0.2\Projects\zstack\HomeAutomation\GenericApp\CC2538\Coordinator\List   GenericApp.map).

    But why I re-open the project I should re-set it?

    "A0": place at start of [0x00200000-0x0027c7ff] { ro section .intvec };

    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x0027c7ff] { ro };
    "A9": place at start of [0x20004000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20004000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    place at end of SRAM { section .noinit };
    initialize by copy { rw };

  • I don't see why it need to re-set it after you re-open the project. Basically, the icf file modification should be persist.

  • Thanks YiKai Chen reply, 

    yes,I also had not understand it,But it is certain should re-set it.(.map file)  

    Why it happened?(just on the .map file,no icf file.)

  • Is linker script re-set too?

  • Thanks YiKai Chen reply 

    just linker file script re-set it,other had not need to set.

    follow these parameter :

    "A0": place at start of [0x00200000-0x0027c7ff] { ro section .intvec };

    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x0027c7ff] { ro };
    "A9": place at start of [0x20004000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20004000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    place at end of SRAM { section .noinit };
    initialize by copy { rw };

     

  • Can you elaborate how and what you modify your linker script and how to reproduce this issue?

  • OK,YaKai,

    I want to set the ZC support the 120 devices, and modify the flash and sram on the icf file.

    and I also should modify the linker file(C:\Texas Instruments\Z-Stack 3.0.2\Projects\zstack\HomeAutomation\GenericApp\CC2538\Coordinator\List\GenericApp.map)

    set the parameters as follow:

    "A0": place at start of [0x00200000-0x0027c7ff] { ro section .intvec };

    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x0027c7ff] { ro };
    "A9": place at start of [0x20004000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20004000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    place at end of SRAM { section .noinit };
    initialize by copy { rw };

    But  I set the linker file successfully. after I re-open the project,the parameters had not the above parameter.

    It is the following original parameter:

    "A0": place at start of [0x00200000-0x002797ff] { ro section .intvec };
    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x002797ff] { ro };
    "A9": place at start of [0x20000000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20000000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    initialize by copy { rw };

    the icf file and other parameter is Ok!

  • To modify the linker file, it means you need to revise CC2538.icf not the map file.

  • Thanks YiKan Chen reply,

    you mean I was not need to set the map file?

    no set the parameters as follows:?

    "A0": place at start of [0x00200000-0x0027c7ff] { ro section .intvec };

    "A1": place at start of [0x0027ffd4-0x0027ffdf] { ro section .cca };
    "P1": place in [from 0x00200000 to 0x0027c7ff] { ro };
    "A9": place at start of [0x20004000-0x20007fff] { section VTABLE };
    define block HEAP with size = 256, alignment = 8 { };
    "P2": place in [from 0x20004000 to 0x20007fff] { rw, block HEAP };
    do not initialize { section .noinit };
    place at end of SRAM { section .noinit };
    initialize by copy { rw };

  • Yes, map file is generated by build process and it's useless to modify it.

  • OK,I know it!