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

Why doesn't Device State Manager allow to increase the number of entries?

The Device State Manager (DSM) will erase the flash if any of the following parameters have changed since last boot.

  • DSM_NONVIRTUAL_ADDR_MAX
  • DSM_VIRTUAL_ADDR_MAX
  • DSM_APP_MAX
  • DSM_DEVICE_MAX
  • DSM_SUBNET_MAX

I agree that it can cause problem if these have decreased in size but is there really an issue if they have increased?

For example, after deploying a node it becomes clear that the number of application keys weren't sufficient and thus DSM_APP_MAX must be increased. This would erase the DSM flash page which isn't actually required as the old entries would fit in the new firmware's arrays as they are larger. The indexes will remain the same.

Thus, is there an issue of changing dsm_flash_config_load() according to the following patch.

Thanks.

Parents
  • Hi. 

    What you describe above seems to be the correct behavior. 

    Thus, is there an issue of changing dsm_flash_config_load() according to the following patch.

     I'll ask for a comment from our developers about this. 

    Cheers, 
    Joakim

  • Hi,

    Any comment from the developers?

    The same "problem" remains with Mesh SDK 4.0.0.

    The new metadata should also be written to the flash when they mismatch. Otherwise there could be more entries in the flash than the metadata indicate causing issues later on.

    Thanks.

Reply
  • Hi,

    Any comment from the developers?

    The same "problem" remains with Mesh SDK 4.0.0.

    The new metadata should also be written to the flash when they mismatch. Otherwise there could be more entries in the flash than the metadata indicate causing issues later on.

    Thanks.

Children
  • Hi.

    Sorry about the delay.  

    I have an open internal request to our developers to comment on this. I'll update you as soon as I get any feedback. 

    Br, 
    Joakim

  • Hi again.

    The problem with allowing this use case is that; if a number of DMS pages get changed as a result of increasing values of DSM_*MAX defines, it will trigger either an assertion in subsequent modules when they see that the flash page metadata is different than expected. Or it may lead to corrupted data loading other modules.
    It is better to plan in advance and allocate more space for a sufficient number of DSM entries.

    Regards,
    Joakim