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

Halt on nvs_init()

We are implementing on nRF52840 with latest NCS version the following code:

config.fs.offset = FLASH_AREA_OFFSET(storage);
  res = flash_get_page_info_by_offs(
          device_get_binding(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL),
          config.fs.offset, &config.info);
  if (RET_OK != res) {
          LOG_ERR("Unable to get page info");
  }
  config.fs.sector_size = config.info.size;
  config.fs.sector_count = 3U;

  if(RET_OK == res)
  {
    res = nvs_init(&config.fs, DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL);
    if (RET_OK != res) {
      LOG_ERR("Flash Init failed\n");
    }
  }

The nvs_init() function is halting due to an error at flash_sync_mpsl.c within nrf_flash_sync_exe function when attempting to call mpsl_timeslot_request()

errcode = MULTITHREADING_LOCK_ACQUIRE();
__ASSERT_NO_MSG(errcode == 0);
ret = mpsl_timeslot_request(_context.session_id, req);
__ASSERT_EVAL((void)ret, (void)ret, ret == 0,
     "mpsl_timeslot_request failed: %d", ret);
MULTITHREADING_LOCK_RELEASE();

We set at prj.conf proper settings from the nvs example. But we are implementing NVS within the Zigbee Light Switch example (with FOTA activated which involves mcuboot).

Is there any special consideration to handle in this case? Are we missing something?

Thanks in advance,

Santiago

Parents Reply Children
No Data
Related