This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Does Zigbee persistent data need 48kB or 48 pages of flash?

Looking at the instructions to add Zigbee to a SDK example here, I am instructed to define FDS_VIRTUAL_PAGES_RESERVED to 0x30 to reserve some flash for Zigbee persistent data. It seems like the same number is used in the multiprotocol examples as well (for instance #define FDS_VIRTUAL_PAGES_RESERVED ((ZIGBEE_NVRAM_PAGE_SIZE * (ZIGBEE_NVRAM_PAGE_COUNT + ZIGBEE_NVRAM_CONFIG_PAGE_COUNT))/FDS_VIRTUAL_PAGE_SIZE) ).


This seems to reserve 48 pages of flash. The documentation here however indicates that one needs to reserve 48kB of flash, not 48 pages (192kB).

If I define FDS_VIRTUAL_PAGES_RESERVED to 0x30 as instructed, flash_end_addr() in fds.c (from the Thread and Zigbee SDK, v2.0.0) returns 0xD0000, seen by "printf-debugging". Examining the flash after running and joining a network, shows unused flash from 0xD0000 to 0xF4000, and some used flash after 0xF4000. This is without any bootloader.

Have I misread or miscalculated the macros, or is there something odd here? How much flash should really be reserved for the Zigbee persistent data? I could use those extra 144kB that would be freed if 48kB is the answer :)

Parents
  • Hello,

    I see what you mean. I have forwarded this to our ZigBee team to see whether it actually is a bug, but I agree that it says it requires 32kB of flash from the "Typical flash and RAM requirements table" and 48kB from the "Zigbee stack flash and RAM layout". I assume this is 32kB + a config page or a swap page.

    They replied that they will look into this, but that they can't guarantee to have an answer until next week. I am sorry for the delay. I will get back to you as soon as I hear from them.

    However, 48kB of persistant storage (FDS pages) would suggest 0x0C = 12 pages, so if you'd like, you can try with this, and see whether you run into some unexpected issues that you can't reproduce with 0x30 = 48 reserved pages.

    Best regards,

    Edvin

  • Thanks, no hurry. Just found it curious that so much flash should be reserved, so I thought I'd ask.

Reply Children
Related