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

Writing Logs to the Flash using mesh example(light switch)

Hi,

I want to log the application error data log into the internal flash(1MB) using the mesh example.  I found that there are two ways of writing 1)FDS 2)Flash Manager. I want to know which one is better. And can i get some example code?

Parents Reply Children
  • The garbage collection (defragmentation) is executed automatically by the module when there is no more space to update/add new entry to the system. Please have a look here.

    The max size of an entry by default is 128. You can increase it by increasing FLASH_MANAGER_ENTRY_MAX_SIZE. 

    Note that you would need to increase FLASH_MANAGER_POOL_SIZE as well. 

  • Hi,

    I have gone through Flash Manager document, but I didn't find some of the things like:

    1) How the FLASH_MANAGER_ENTRY_MAX_SIZE and FLASH_MANAGER_POOL_SIZE are related and if I want to increase FLASH_MANAGER_ENTRY_MAX_SIZE to 512 bytes then what should be the FLASH_MANAGER_POOL_SIZE ?

    2) FLASH_MANAGER_ENTRY_MAX_SIZE and FLASH_MANAGER_POOL_SIZE should be in multiples of 128? ( like 128,256,384,512,1024)

  • Hi Satwik,

    Please refer to the response of our R&D:

    The pool size should be at least 16 bytes larger than the largest packet to fit internal overhead.

    Having a pool size that just barely fits the largest entry will cause some performance issues though, so I'd recommend adjusting it to keep it at two times the size of the largest entry.

    I would suggest to have the pool size of 2xFLASH_MANAGER_ENTRY_MAX_SIZE + 2x16. 

Related