Hello,
I need to persist ~200K of data on the internal flash of an NRF52832 chip. I've run a memory report and I'm current taking up 185Kb and the chip has 512 Kb of flash so there is the space. I've taken the code from teh sample nvm project to init that nvm filesystm as below:
int init_storage(){ LOG_INF("Init storage"); int rc = 0; /* define the nvs file system by settings with: * sector_size equal to the pagesize, * 3 sectors * starting at NVS_PARTITION_OFFSET */ fs.flash_device = NVS_PARTITION_DEVICE; if (!device_is_ready(fs.flash_device)) { LOG_ERR("Flash device %s is not ready\n", fs.flash_device->name); return -1; } fs.offset = NVS_PARTITION_OFFSET; rc = flash_get_page_info_by_offs(fs.flash_device, fs.offset, &info); if (rc) { LOG_ERR("Unable to get page info, rc=%d\n", rc); return -1; } LOG_INF("Storage initialized size is %" PRIu32 " index is %" PRIu32, info.size, info.index); fs.sector_size = info.size; fs.sector_count = 2U; rc = nvs_mount(&fs); if (rc) { LOG_ERR("Flash Init failed, rc=%d\n", rc); return 0; } return 0; }
This works fine but it only gives me 4K worth of memory space. If I increase the sector count to more than 3 I get an invalid address: 0x00080ff8 error on runtime. How can I set the nvm filesystem to be 200Kb in size?
Cheers,
Neil