Postby ESP_igrr » Fri Nov 09, 2018 1:52 am
Two sectors is the minimum possible size because NVS needs to provide power off safety (data should not be lost if device is powered off during flash operation). Flash sector size is 4kB. We need one spare sector when performing flash operations, it acts as an area where data will be temporarily written while another sector is being erased.
Regarding the failure to store a 1000 byte blob, please check NVS available size before storing the blob. If you have been using Wi-Fi or Bluetooth, then PHY calibration data has also been stored in NVS, and it is about 2kB large. Wi-Fi also stores a few other configuration values. So it might be that the entire data did not fit into one sector (4K). Remember, one sector is used as a "spare" when NVS needs to erase something, so in the case when you have N sectors in NVS partition, N-1 will be actually used for data storage.