[Zigbee] OTA compatibility & custom memory configuration

Setup: 
NCS v2.4.1

nrf52840DK (ZR)

Hi, 

I am looking for clarification regarding that small note [Developing with ZBOSS]: 
The memory configuration must not be changed between firmware versions if the firmware is going to be upgraded using the OTA DFU.

  1. Is it valid for all configs or only for part of them ? 
  2. How this works under the hood ? 
  3. Is OTA incompatibility still valid if I am using static partition layout ? 
  4. Do I really need to put my custom memory configuration header after zboss_api.h everywhere I am using the zboss_api.h ? Can it be done in other way in Cmake for eg. ?

I look forward to hearing from you,

Pawel

Parents
  • Hi Pawel,

    This link is to the documentation of an old ZBOSS version. The most recent -- and the one applicable for NCS v2.4.1 is found here (ZBOSS 3.11.2.1 for production). Please update bookmarks if you have an older version of the documentation saved. This can save you some confusion in the future.

    Is it valid for all configs or only for part of them ? 

    It's valid for all the configs.

    How this works under the hood ? 

    What are your referring to here? The memory configuration layout, the OTA DFU process? Please elaborate.

    Is OTA incompatibility still valid if I am using static partition layout ? 

    Yes, the requirement for using the same memory configuration for future firmware versions applies when you are using a static partition layout. Note that static partition is recommended when you are planning to do DFU in the future.

    Do I really need to put my custom memory configuration header after zboss_api.h everywhere I am using the zboss_api.h ?

    No, not everywhere. It is needed in your main application file (often named main.c) and the memory configuration header needs to be included after including zboss_api.h. See the Where to include header files section of the documentation.

    Can it be done in other way in Cmake for eg. ?

    No, the method is as described in the documentation: including it in the main application file after zboss_api.h is included.

    Best regards,

    Maria

  • Hi Maria, 

    Thank you for fast response. 

    Regarding "How it works under the hood" I meant the memory configuration layout. I would like to know what is causing the OTA incompatibility. 

    Additionaly: Is it possible to build app without zboss_product_config partition ? I am not going to use it anyway and at this point 1kB of memory is simply being lost.

    I am satisfied with answers for other questions:) 

    Regards,

    Pawel

  • Hi Pawel,

    Regarding your original question:

    I am looking for clarification regarding that small note [Developing with ZBOSS]: 
    The memory configuration must not be changed between firmware versions if the firmware is going to be upgraded using the OTA DFU.

    This note is not relevant for RAM memory configuration and the note will be removed in a future documentation update.

    The note is important for Flash memory configuration. It is a common requirement for DFU in general, not just for Zigbee OTA DFU.

    Pawel(embeddedsolutions.pl) said:
    Additionaly: Is it possible to build app without zboss_product_config partition ? I am not going to use it anyway and at this point 1kB of memory is simply being lost.

    I got one more insight about this:

    zb_production_config_disable() can be used before zboss_start(), in order for ZBOSS not to call zb_osif_prod_cfg_ functions. However the proposed modifications are still needed if you want to remove the partition (in order to avoid build issues).

    Best regards,

    Maria

  • Hi Maria,

    Thank you for your effort.

    This note is not relevant for RAM memory configuration and the note will be removed in a future documentation update.

    So since today, that note is false-positive and each config (see screenshot below) can be changed between FOTA updates without a risk, am I right?

      

    Regarding the production config partition it turned out that the best option is to do the following: 

    # prj.conf
    CONFIG_PM_PARTITION_SIZE_ZBOSS_PRODUCT_CONFIG
    
    
    # main.c 
    
    int main(void){
    
        # some other important zigbee stuff
        zb_production_config_disable(ZB_TRUE);
        zigbee_enable();
    
    }

    The build system is happy because the zboss_product_config partition exists but does not occupy any memory.

    Commenting out the flash_area_open in zb_osif_nvram.c: zb_osif_nvram_init() for me seems not mandatory. In case of a failure it will generate only false-positive log.

    Regards,

    Pawel

  • Hi Pawel,

    Pawel(embeddedsolutions.pl) said:
    So since today, that note is false-positive and each config (see screenshot below) can be changed between FOTA updates without a risk, am I right?

    Note that the Flash memory configuration is still important and will cause incompatibility if they differ between current and new image.

    But yes, the memory configuration for RAM can be changed between FOTA updates.

    Pawel(embeddedsolutions.pl) said:
    Regarding the production config partition it turned out that the best option is to do the following: 
    Pawel(embeddedsolutions.pl) said:

    The build system is happy because the zboss_product_config partition exists but does not occupy any memory.

    Commenting out the flash_area_open in zb_osif_nvram.c: zb_osif_nvram_init() for me seems not mandatory. In case of a failure it will generate only false-positive log.

    Thank you for sharing your solution.

    Best regards,

    Maria

  • Hi Maria,

    Note that the Flash memory configuration is still important and will cause incompatibility if they differ between current and new image.

    Ok, to sum things up.

    ZBOSS 3.11.2.1 RAM -> These configs can be changed between FOTA/DFU updates.

    ZBOSS 3.11.2.1 FLASH -> That data cannot be changed between FOTA/DFU updates but I do not see any configurable configs. I assume the "Flash memory configuration" applies only to the flash layout. Is my assumption correct? 

    Best regards,

    Pawel

  • Good summary.

    Pawel(embeddedsolutions.pl) said:
    I assume the "Flash memory configuration" applies only to the flash layout. Is my assumption correct? 

    Yes, you are correct.

    Best regards,

    Maria

Reply Children
No Data
Related