EEPROM On The Nano 33 BLE - Arduino Forum

EEPROM on the Nano 33 BLE ? Official Hardware Nano Family Nano 33 BLE July 11, 2020, 4:38pm 1

Might be a silly question... Is there any EEPROM on the Nano 33 BLE ? If so, how to use it ?

July 11, 2020, 6:10pm 2

There is not, but you can use a part of the flash inside the microcontroller. I searched quite some time as well, resulting in deep diving into the underlying Mbed OS which facilitates a sort of filesystem and has the so-called KvStore. I use it to do some Config file type style settings, and seems to work quite well, at least for what I started with right now.

https://os.mbed.com/docs/mbed-os/v6.1/apis/kvstore.html Examples KvStore usage

My current code (under development);

#include <mbed.h> #include <KVStore.h> #include <kvstore_global_api.h> .... // NVMEM keys and strings static char KvBuf [40]; static char CheckValidStr[] = "55AA"; .... // ***************************************************************************** // NVMEM routines to read/write the configuration to/from non volatile memory // ***************************************************************************** static void nvmemGetConfig() { int16_t res; int16_t i; int32_t templ; size_t  actualSize;   res = kv_get("/kv/check_valid", KvBuf, sizeof(KvBuf), &actualSize);   Serial.println (KvBuf);   if (res != MBED_SUCCESS)   {     // Reset the nvmem storage when not yet initialized     res = kv_reset("/kv/");     Serial.println("KV: Could not get check_valid");     res = kv_set("/kv/check_valid", CheckValidStr, strlen(CheckValidStr), 0);     res = kv_set("/kv/cal_offset", "0", 2, 0);   }   else if (strcmp(KvBuf, CheckValidStr) == 0)   {     Serial.println("KV: store is valid");     res = kv_get("/kv/cal_offset", KvBuf, sizeof(KvBuf), &actualSize);     Hx711SensorOffset = atol(KvBuf);     sprintf(PrintBuf, "Hx711SensorOffset = %d", Hx711SensorOffset);     Serial.println(PrintBuf);   } } July 13, 2020, 11:37am 3

As the frequency of writes that I intend for this non volatile memory is high, I will investigate the possibility to keep RAM On, when in System Off, using the RAMn.POWER control registers.

Topic Replies Views Activity
Non volatile storage in NANO 33 BLE? Nano 33 BLE 5 2577 May 7, 2021
Non volatile memory Nano 33 BLE Sense Storage 6 8406 May 6, 2021
Persistent storage Nano 33 BLE 10 3763 June 26, 2022
NanoBLEFlashPrefs: Library for missing EEPROM functionality on Nano 33 BLE Nano 33 BLE 3 2645 December 28, 2021
NANO 33 BLE: EEPROM emulation? Nano 33 BLE 2 1221 May 7, 2021
Unfortunately, your browser is unsupported. Please switch to a supported browser to view rich content, log in and reply.

Tag » Arduino Ble Eeprom