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

Mesh assert when changed ACCESS_FLASH_PAGE_COUNT to 2

A mesh node contains multiple lights.

Assume a light contains 5 Elements (Main, Temperature, Hue, Saturation, Light LC). Each light has 30 model servers implemented.

When I use this with 2 Lights (10 elements and 60 + 2 models), works fine, code builds and executes without any assertion. At this time ACCESS_FLASH_PAGE_COUNT is 1.

When I changed light count to 3 (15 elements and 90 + 2 models), Changed ACCESS_FLASH_PAGE_COUNT to 2, code builds but during execution it asserts.

What is going wrong, do I need to change any more things in order to use the ACCESS_FLASH_PAGE_COUNT as 2?

I did look into the macro in access.c which does a static check during build time and calculated the requied page_count.

Is there any restrictions for using maximum number of ACCESS_FLASH_PAGE_COUNT?

Parents
  • Hi,

    Do you see where it asserts?

    You might get an assert during compilation if the allocated flash page size is too low. In addition to ACCESS_FLASH_PAGE_COUNT you will also need to increase DSM_FLASH_PAGE_COUNT as well. If this doesn't work try increasing ACCESS_FLASH_PAGE_COUNT more.

  • Thanks Mttrinh,

    I changed ACCESS_FLASH_PAGE_COUNT to appropriate value, so it did not assert during compilation.

    But during execution, I observed following:

    Increased ACCESS_FLASH_PAGE_COUNT, code asserts during call to access_init().
    Increased ACCESS_FLASH_PAGE_COUNT and DSM_FLASH_PAGE_COUNT, code asserts during call to dsm_init().
    Increased ACCESS_FLASH_PAGE_COUNT, DSM_FLASH_PAGE_COUNT, and NET_FLASH_PAGE_COUNT, code asserts during call to network_init().

    Assert location:
        Mesh SDK 3.2
        File: flash_manager.c
        Function: flash_area_is_valid
        Line Number: 255

    NRF_MESH_ASSERT(p_manager->config.p_area[i].metadata.pages_in_area == p_manager->config.page_count);

    Also, p_manager->config.p_area[i].metadata.pages_in_area is always 1 thats why it is asserting. I looked around but could not find the place where pages_in_area is set.

    p_area is calculated by keeping mp_recovery_area as base. (file: flash_manager_defrag.c)
    (traced from file: mesh_config_flashman_glue.c, function: mesh_config_backend_file_create, line number: 152)

    So I am unable to locate the where and what is the actual content of p_area in case of access_init().

Reply
  • Thanks Mttrinh,

    I changed ACCESS_FLASH_PAGE_COUNT to appropriate value, so it did not assert during compilation.

    But during execution, I observed following:

    Increased ACCESS_FLASH_PAGE_COUNT, code asserts during call to access_init().
    Increased ACCESS_FLASH_PAGE_COUNT and DSM_FLASH_PAGE_COUNT, code asserts during call to dsm_init().
    Increased ACCESS_FLASH_PAGE_COUNT, DSM_FLASH_PAGE_COUNT, and NET_FLASH_PAGE_COUNT, code asserts during call to network_init().

    Assert location:
        Mesh SDK 3.2
        File: flash_manager.c
        Function: flash_area_is_valid
        Line Number: 255

    NRF_MESH_ASSERT(p_manager->config.p_area[i].metadata.pages_in_area == p_manager->config.page_count);

    Also, p_manager->config.p_area[i].metadata.pages_in_area is always 1 thats why it is asserting. I looked around but could not find the place where pages_in_area is set.

    p_area is calculated by keeping mp_recovery_area as base. (file: flash_manager_defrag.c)
    (traced from file: mesh_config_flashman_glue.c, function: mesh_config_backend_file_create, line number: 152)

    So I am unable to locate the where and what is the actual content of p_area in case of access_init().

Children
No Data
Related