Skip to content

Commit 0686cde

Browse files
committed
update internal nvm size
1 parent 35ef6c6 commit 0686cde

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ports/esp32s2/common-hal/nvm/ByteArray.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static nvs_handle get_nvs_handle(void) {
5656
bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self,
5757
uint32_t start_index, uint8_t* values, uint32_t len) {
5858
char index[9];
59-
sprintf(index, "%i", start_index);
59+
sprintf(index, "%i", start_index - CIRCUITPY_INTERNAL_NVM_START_ADDR);
6060
// start nvs
6161
nvs_handle handle = get_nvs_handle();
6262
bool status = ((nvs_set_u8(handle, (const char *)index, *values) == ESP_OK) && (nvs_commit(handle) == ESP_OK));
@@ -69,7 +69,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self,
6969
void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self,
7070
uint32_t start_index, uint32_t len, uint8_t* values) {
7171
char index[9];
72-
sprintf(index, "%i", start_index);
72+
sprintf(index, "%i", start_index - CIRCUITPY_INTERNAL_NVM_START_ADDR);
7373
// start nvs
7474
nvs_handle handle = get_nvs_handle();
7575
if (nvs_get_u8(handle, (const char *)index, values) != ESP_OK) {

ports/esp32s2/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x9000)
4444

4545
#ifndef CIRCUITPY_INTERNAL_NVM_SIZE
46-
#define CIRCUITPY_INTERNAL_NVM_SIZE (20000)
46+
#define CIRCUITPY_INTERNAL_NVM_SIZE (20 * 1024)
4747
#endif
4848

4949
#endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H

0 commit comments

Comments
 (0)