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

Routine NVS initialization returns -22

I'm attempting to make a custom program using a few different libraries based on the samples. In attempting to initialize nvs, it returns -22. I've been able to trace it deep into nvs_startup using the debugger. I see that -22 means "invalid argument", but it's unclear what is invalid and where it's being passed. The project loads and builds correctly.

main.c:

// gps

#include <zephyr.h>
#include <nrf_socket.h>
#include <net/socket.h>
#include <stdio.h>

// nvs

#include <zephyr.h>
#include <misc/reboot.h>
#include <device.h>
#include <string.h>
#include <flash.h>
#include <nvs/nvs.h>

// led

#include <zephyr.h>
#include <device.h>
#include <gpio.h>



#include <gps_.h>


struct nvs_fs fs;

int nvs_setup(){
  int retval = 0;
  struct flash_pages_info info;

  fs.offset = DT_FLASH_AREA_STORAGE_OFFSET;
//  fs.offset = PM_MCUBOOT_STORAGE_ADDRESS;
  retval = flash_get_page_info_by_offs(device_get_binding(DT_FLASH_DEV_NAME), fs.offset, &info);
  if(retval){
    printk("Unable to get page info");
    return retval;
  }

  fs.sector_size = info.size;
  fs.sector_count = 3U;

  retval = nvs_init(&fs, DT_FLASH_DEV_NAME);
  if(retval){
    printk("Flash Init failed: %d\n", retval);
    return retval;
  }
  return 0;
}


void test_(){

    //nvs  
    nvs_setup();

    //gps

//    spoof(true);
//
//    GPS_Init();
//    printk("\nGPS Initialized");
//    GPS_Enable();
//    printk("\nGPS Enabled");
//    GPS_Logging_On();
//
//    s64_t loop_timer = k_uptime_get();
//    while(1){
//        GPS_State_Machine(&fs);
//
//        while(k_uptime_get()-loop_timer <= 20);
//        loop_timer = k_uptime_get();
//    }

}


int main(){
    

    printk("running");
    test_();

    return 0;
}

prj.conf:

# gps-----------------

CONFIG_BSD_LIBRARY=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# Disable native network stack to save some memory
CONFIG_NET_IPV4=n
CONFIG_NET_IPV6=n
CONFIG_NET_UDP=n
CONFIG_NET_TCP=n


# nvs---------------------
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y

CONFIG_NVS=y
CONFIG_LOG=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_REBOOT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y


# led---------------------
CONFIG_GPIO=y
# CONFIG_SERIAL=n








CMakeLists:

#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

cmake_minimum_required(VERSION 3.13.1)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(test_integration)

# NORDIC SDK APP START
target_sources(app PRIVATE src/main.c)

# new stuff
target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/subsys/fs/nvs C:/Users/user/Desktop/includes)

target_sources(app PRIVATE C:/Users/user/Desktop/includes/gps_.c)
target_sources(app PRIVATE C:/Users/user/Desktop/includes/led.c)

# NORDIC SDK APP END

Running this gives me this output:

***** Booting Zephyr OS v1.14.99-ncs2 *****                                     
Flash region            Domain          Permissions                             
00 0x00000 0x08000      Secure          rwxl                                    
01 0x08000 0x10000      Non-Secure      rwxl                                    
02 0x10000 0x18000      Non-Secure      rwxl                                    
03 0x18000 0x20000      Non-Secure      rwxl                                    
04 0x20000 0x28000      Non-Secure      rwxl                                    
05 0x28000 0x30000      Non-Secure      rwxl                                    
06 0x30000 0x38000      Non-Secure      rwxl                                    
07 0x38000 0x40000      Non-Secure      rwxl                                    
08 0x40000 0x48000      Non-Secure      rwxl                                    
09 0x48000 0x50000      Non-Secure      rwxl                                    
10 0x50000 0x58000      Non-Secure      rwxl                                    
11 0x58000 0x60000      Non-Secure      rwxl                                    
12 0x60000 0x68000      Non-Secure      rwxl                                    
13 0x68000 0x70000      Non-Secure      rwxl                                    
14 0x70000 0x78000      Non-Secure      rwxl                                    
15 0x78000 0x80000      Non-Secure      rwxl                                    
16 0x80000 0x88000      Non-Secure      rwxl                                    
17 0x88000 0x90000      Non-Secure      rwxl                                    
18 0x90000 0x98000      Non-Secure      rwxl                                    
19 0x98000 0xa0000      Non-Secure      rwxl                                    
20 0xa0000 0xa8000      Non-Secure      rwxl                                    
21 0xa8000 0xb0000      Non-Secure      rwxl                                    
22 0xb0000 0xb8000      Non-Secure      rwxl                                    
23 0xb8000 0xc0000      Non-Secure      rwxl                                    
24 0xc0000 0xc8000      Non-Secure      rwxl                                    
25 0xc8000 0xd0000      Non-Secure      rwxl                                    
26 0xd0000 0xd8000      Non-Secure      rwxl                                    
27 0xd8000 0xe0000      Non-Secure      rwxl                                    
28 0xe0000 0xe8000      Non-Secure      rwxl                                    
29 0xe8000 0xf0000      Non-Secure      rwxl                                    
30 0xf0000 0xf8000      Non-Secure      rwxl                                    
31 0xf8000 0x100000     Non-Secure      rwxl                                    
Non-secure callable region 0 placed in flash region 0 with size 32.             
                                                                                
                                                                                
SRAM region             Domain          Permissions                             
00 0x00000 0x02000      Secure          rwxl                                    
01 0x02000 0x04000      Secure          rwxl                                    
02 0x04000 0x06000      Secure          rwxl                                    
03 0x06000 0x08000      Secure          rwxl                                    
04 0x08000 0x0a000      Secure          rwxl                                    
05 0x0a000 0x0c000      Secure          rwxl                                    
06 0x0c000 0x0e000      Secure          rwxl                                    
07 0x0e000 0x10000      Secure          rwxl                                    
08 0x10000 0x12000      Non-Secure      rwxl                                    
09 0x12000 0x14000      Non-Secure      rwxl                                    
10 0x14000 0x16000      Non-Secure      rwxl                                    
11 0x16000 0x18000      Non-Secure      rwxl                                    
12 0x18000 0x1a000      Non-Secure      rwxl                                    
13 0x1a000 0x1c000      Non-Secure      rwxl                                    
14 0x1c000 0x1e000      Non-Secure      rwxl                                    
15 0x1e000 0x20000      Non-Secure      rwxl                                    
16 0x20000 0x22000      Non-Secure      rwxl                                    
17 0x22000 0x24000      Non-Secure      rwxl                                    
18 0x24000 0x26000      Non-Secure      rwxl                                    
19 0x26000 0x28000      Non-Secure      rwxl                                    
20 0x28000 0x2a000      Non-Secure      rwxl                                    
21 0x2a000 0x2c000      Non-Secure      rwxl                                    
22 0x2c000 0x2e000      Non-Secure      rwxl                                    
23 0x2e000 0x30000      Non-Secure      rwxl                                    
24 0x30000 0x32000      Non-Secure      rwxl                                    
25 0x32000 0x34000      Non-Secure      rwxl                                    
26 0x34000 0x36000      Non-Secure      rwxl                                    
27 0x36000 0x38000      Non-Secure      rwxl                                    
28 0x38000 0x3a000      Non-Secure      rwxl                                    
29 0x3a000 0x3c000      Non-Secure      rwxl                                    
30 0x3c000 0x3e000      Non-Secure      rwxl                                    
31 0x3e000 0x40000      Non-Sec***** Booting Zephyr OS v1.14.99-ncs2 *****      
Flash region            Domain          Permissions                             
00 0x00000 0x08000      Secure          rwxl                                    
01 0x08000 0x10000      Non-Secure      rwxl                                    
02 0x10000 0x18000      Non-Secure      rwxl                                    
03 0x18000 0x20000      Non-Secure      rwxl                                    
04 0x20000 0x28000      Non-Secure      rwxl                                    
05 0x28000 0x30000      Non-Secure      rwxl                                    
06 0x30000 0x38000      Non-Secure      rwxl                                    
07 0x38000 0x40000      Non-Secure      rwxl                                    
08 0x40000 0x48000      Non-Secure      rwxl                                    
09 0x48000 0x50000      Non-Secure      rwxl                                    
10 0x50000 0x58000      Non-Secure      rwxl                                    
11 0x58000 0x60000      Non-Secure      rwxl                                    
12 0x60000 0x68000      Non-Secure      rwxl                                    
13 0x68000 0x70000      Non-Secure      rwxl                                    
14 0x70000 0x78000      Non-Secure      rwxl                                    
15 0x78000 0x80000      Non-Secure      rwxl                                    
16 0x80000 0x88000      Non-Secure      rwxl                                    
17 0x88000 0x90000      Non-Secure      rwxl                                    
18 0x90000 0x98000      Non-Secure      rwxl                                    
19 0x98000 0xa0000      Non-Secure      rwxl                                    
20 0xa0000 0xa8000      Non-Secure      rwxl                                    
21 0xa8000 0xb0000      Non-Secure      rwxl                                    
22 0xb0000 0xb8000      Non-Secure      rwxl                                    
23 0xb8000 0xc0000      Non-Secure      rwxl                                    
24 0xc0000 0xc8000      Non-Secure      rwxl                                    
25 0xc8000 0xd0000      Non-Secure      rwxl                                    
26 0xd0000 0xd8000      Non-Secure      rwxl                                    
27 0xd8000 0xe0000      Non-Secure      rwxl                                    
28 0xe0000 0xe8000      Non-Secure      rwxl                                    
29 0xe8000 0xf0000      Non-Secure      rwxl                                    
30 0xf0000 0xf8000      Non-Secure      rwxl                                    
31 0xf8000 0x100000     Non-Secure      rwxl                                    
Non-secure callable region 0 placed in flash region 0 with size 32.             
                                                                                
                                                                                
SRAM region             Domain          Permissions                             
00 0x00000 0x02000      Secure          rwxl                                    
01 0x02000 0x04000      Secure          rwxl                                    
02 0x04000 0x06000      Secure          rwxl                                    
03 0x06000 0x08000      Secure          rwxl                                    
04 0x08000 0x0a000      Secure          rwxl                                    
05 0x0a000 0x0c000      Secure          rwxl                                    
06 0x0c000 0x0e000      Secure          rwxl                                    
07 0x0e000 0x10000      Secure          rwxl                                    
08 0x10000 0x12000      Non-Secure      rwxl                                    
09 0x12000 0x14000      Non-Secure      rwxl                                    
10 0x14000 0x16000      Non-Secure      rwxl                                    
11 0x16000 0x18000      Non-Secure      rwxl                                    
12 0x18000 0x1a000      Non-Secure      rwxl                                    
13 0x1a000 0x1c000      Non-Secure      rwxl                                    
14 0x1c000 0x1e000      Non-Secure      rwxl                                    
15 0x1e000 0x20000      Non-Secure      rwxl                                    
16 0x20000 0x22000      Non-Secure      rwxl                                    
17 0x22000 0x24000      Non-Secure      rwxl                                    
18 0x24000 0x26000      Non-Secure      rwxl                                    
19 0x26000 0x28000      Non-Secure      rwxl                                    
20 0x28000 0x2a000      Non-Secure      rwxl                                    
21 0x2a000 0x2c000      Non-Secure      rwxl                                    
22 0x2c000 0x2e000      Non-Secure      rwxl                                    
23 0x2e000 0x30000      Non-Secure      rwxl                                    
24 0x30000 0x32000      Non-Secure      rwxl                                    
25 0x32000 0x34000      Non-Secure      rwxl                                    
26 0x34000 0x36000      Non-Secure      rwxl                                    
27 0x36000 0x38000      Non-Secure      rwxl                                    
28 0x38000 0x3a000      Non-Secure      rwxl                                    
29 0x3a000 0x3c000      Non-Secure      rwxl                                    
30 0x3c000 0x3e000      Non-Secure      rwxl                                    
31 0x3e000 0x40000      Non-Secure      rwxl                                    
                                                                                
Peripheral              Domain          Status                                  
00 NRF_P0               Non-Secure      OK                                      
01 NRF_CLOCK            Non-Secure      OK                                      
02 NRF_RTC1             Non-Secure      OK                                      
03 NRF_NVMC             Non-Secure      OK                                      
04 NRF_UARTE1           Non-Secure      OK                                      
05 NRF_UARTE2           Secure          SKIP                                    
06 NRF_TWIM2            Non-Secure      OK                                      
07 NRF_SPIM3            Non-Secure      OK                                      
08 NRF_TIMER0           Non-Secure      OK                                      
09 NRF_TIMER1           Non-Secure      OK                                      
10 NRF_TIMER2           Non-Secure      OK                                      
11 NRF_SAADC            Non-Secure      OK                                      
12 NRF_PWM0             Non-Secure      OK                                      
13 NRF_PWM1             Non-Secure      OK                                      
14 NRF_PWM2             Non-Secure      OK                                      
15 NRF_PWM3             Non-Secure      OK                                      
16 NRF_IPC              Non-Secure      OK                                      
17 NRF_VMC              Non-Secure      OK                                      
18 NRF_FPU              Non-Secure      OK                                      
19 NRF_EGU1             Non-Secure      OK                                      
20 NRF_EGU2             Non-Secure      OK                                      
21 NRF_GPIOTE1          Non-Secure      OK                                      
                                                                                
SPM: NS image at 0xc000                                                         
SPM: NS MSP at 0x20024368                                                       
SPM: NS reset vector at 0x13f39                                                 
SPM: prepare to jump to Non-Secure image.                                       
***** Booting Zephyr OS v1.14.99-ncs2 *****                                     
running-22NVS Startup Failed                                                    
Flash Init failed: -22 

I get the same -22 error running the nvs sample code found in zephyr/samples/subsys

How do I fix this?

Thanks

  • Could you provide these files as well:

    target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/subsys/fs/nvs C:/Users/user/Desktop/includes)
    
    target_sources(app PRIVATE C:/Users/user/Desktop/includes/gps_.c)
    target_sources(app PRIVATE C:/Users/user/Desktop/includes/led.c)

    I need them to run your example, and reproduce and debug your issue.

    Best regards,

    Simon

  • Could you try this sample? I used this in the past to test the NVS system and it still works on my DK. Deploy this in your sample folder and run it via the command line.

    You should get something like this (ignore the different Flash addresses, I edited my partitions but this should work on your spm build as I have reset it to 3 flash sectors)

    ***** Booting Zephyr OS v1.14.99-ncs2 *****
    NVS offset: 0009a000
    NVS ate_wra: 00000fa0
    NVS data_wra: 0000015e
    NVS Sector Size: 4096
    NVS sector_count: 3
    NVS write_block_size: 1
    NVS ready: 1
    Remaining free space in nvs sector is 8176 Bytes
    Bytes written to nvs: 35 at ID 0
    Bytes written to nvs: 35 at ID 1
    Bytes written to nvs: 35 at ID 2
    Bytes written to nvs: 35 at ID 3
    Bytes written to nvs: 35 at ID 4
    Bytes written to nvs: 35 at ID 5
    Bytes written to nvs: 35 at ID 6
    Bytes written to nvs: 35 at ID 7
    Bytes written to nvs: 35 at ID 8
    Bytes written to nvs: 35 at ID 9
    NVS offset: 0009a000
    NVS ate_wra: 00000f50
    NVS data_wra: 000002bc
    NVS Sector Size: 4096
    NVS sector_count: 3
    NVS write_block_size: 1
    NVS ready: 1
    Remaining free space in nvs sector is 7746 Bytes
    [00:00:00.420,135] <inf> fs_nvs: 3 Sectors of 4096 bytes
    [00:00:00.420,135] <inf> fs_nvs: alloc wra: 0, fa0
    [00:00:00.420,135] <inf> fs_nvs: data wra: 0, 15e
    [00:00:00.420,166] <dbg> fs_nvs.nvs_flash_erase_sector: Erasing flash at 9a000, len 4096

  • Hi,

    Thanks for the input, I just ran your code on my DK and I get a mix of 35 and -28 when writing, but nvs seems to work. Looking through your project files, I can't place what makes this project work over the others. What's your secret?

    Output:

    ***** Booting Zephyr OS v1.14.99-ncs2 *****
    NVS offset: 000fa000
    NVS ate_wra: 00000ff0
    NVS data_wra: 00000000
    NVS Sector Size: 4096
    NVS sector_count: 3
    NVS write_block_size: 1
    NVS ready: 1
    Remaining free space in nvs sector is 8176 Bytes
    Bytes written to nvs: 35 at ID 0
    Bytes written to nvs: 35 at ID 1
    Bytes written to nvs: 35 at ID 2
    Bytes written to nvs: 35 at ID 3
    Bytes written to nvs: 35 at ID 4
    Bytes written to nvs: 35 at ID 5
    Bytes written to nvs: 35 at ID 6
    Bytes written to nvs: 35 at ID 7
    Bytes written to nvs: 35 at ID 8
    Bytes written to nvs: 35 at ID 9
    Bytes written to nvs: 35 at ID 10
    Bytes written to nvs: 35 at ID 11
    Bytes written to nvs: 35 at ID 12
    Bytes written to nvs: 35 at ID 13
    Bytes written to nvs: 35 at ID 14
    Bytes written to nvs: 35 at ID 15
    Bytes written to nvs: 35 at ID 16
    Bytes written to nvs: 35 at ID 17
    Bytes written to nvs: 35 at ID 18
    Bytes written to nvs: 35 at ID 19
    Bytes written to nvs: 35 at ID 20
    Bytes written to nvs: 35 at ID 21
    Bytes written to nvs: 35 at ID 22
    Bytes written to nvs: 35 at ID 23
    Bytes written to nvs: 35 at ID 24
    Bytes written to nvs: 35 at ID 25
    Bytes written to nvs: 35 at ID 26
    Bytes written to nvs: 35 at ID 27
    Bytes written to nvs: 35 at ID 28
    Bytes written to nvs: 35 at ID 29
    Bytes written to nvs: 35 at ID 30
    Bytes written to nvs: 35 at ID 31
    Bytes written to nvs: 35 at ID 32
    Bytes written to nvs: 35 at ID 33
    Bytes written to nvs: 35 at ID 34
    Bytes written to nvs: 35 at ID 35
    Bytes written to nvs: 35 at ID 36
    Bytes written to nvs: 35 at ID 37
    Bytes written to nvs: 35 at ID 38
    Bytes written to nvs: 35 at ID 39
    Bytes written to nvs: 35 at ID 40
    Bytes written to nvs: 35 at ID 41
    Bytes written to nvs: 35 at ID 42
    Bytes written to nvs: 35 at ID 43
    Bytes written to nvs: 35 at ID 44
    Bytes written to nvs: 35 at ID 45
    Bytes written to nvs: 35 at ID 46
    Bytes written to nvs: 35 at ID 47
    Bytes written to nvs: 35 at ID 48
    Bytes written to nvs: 35 at ID 49
    Bytes written to nvs: 35 at ID 50
    Bytes written to nvs: 35 at ID 51
    Bytes written to nvs: 35 at ID 52
    Bytes written to nvs: 35 at ID 53
    Bytes written to nvs: 35 at ID 54
    Bytes written to nvs: 35 at ID 55
    Bytes written to nvs: 35 at ID 56
    Bytes written to nvs: 35 at ID 57
    Bytes written to nvs: 35 at ID 58
    Bytes written to nvs: 35 at ID 59
    Bytes written to nvs: 35 at ID 60
    Bytes written to nvs: 35 at ID 61
    Bytes written to nvs: 35 at ID 62
    Bytes written to nvs: 35 at ID 63
    Bytes written to nvs: 35 at ID 64
    Bytes written to nvs: 35 at ID 65
    Bytes written to nvs: 35 at ID 66
    Bytes written to nvs: 35 at ID 67
    Bytes written to nvs: 35 at ID 68
    Bytes written to nvs: 35 at ID 69
    Bytes written to nvs: 35 at ID 70
    Bytes written to nvs: 35 at ID 71
    Bytes written to nvs: 35 at ID 72
    Bytes written to nvs: 35 at ID 73
    Bytes written to nvs: 35 at ID 74
    Bytes written to nvs: 35 at ID 75
    Bytes written to nvs: 35 at ID 76
    Bytes written to nvs: 35 at ID 77
    Bytes written to nvs: 35 at ID 78
    Bytes written to nvs: 35 at ID 79
    Bytes written to nvs: 35 at ID 80
    Bytes written to nvs: 35 at ID 81
    Bytes written to nvs: 35 at ID 82
    Bytes written to nvs: 35 at ID 83
    Bytes written to nvs: 35 at ID 84
    Bytes written to nvs: 35 at ID 85
    Bytes written to nvs: 35 at ID 86
    Bytes written to nvs: 35 at ID 87
    Bytes written to nvs: 35 at ID 88
    Bytes written to nvs: 35 at ID 89
    Bytes written to nvs: 35 at ID 90
    Bytes written to nvs: 35 at ID 91
    Bytes written to nvs: 35 at ID 92
    Bytes written to nvs: 35 at ID 93
    Bytes written to nvs: 35 at ID 94
    Bytes written to nvs: 35 at ID 95
    Bytes written to nvs: 35 at ID 96
    Bytes written to nvs: 35 at ID 97
    Bytes written to nvs: 35 at ID 98
    Bytes written to nvs: 35 at ID 99
    Bytes written to nvs: 35 at ID 100
    Bytes written to nvs: 35 at ID 101
    Bytes written to nvs: 35 at ID 102
    Bytes written to nvs: 35 at ID 103
    Bytes written to nvs: 35 at ID 104
    Bytes written to nvs: 35 at ID 105
    Bytes written to nvs: 35 at ID 106
    Bytes written to nvs: 35 at ID 107
    Bytes written to nvs: 35 at ID 108
    Bytes written to nvs: 35 at ID 109
    Bytes written to nvs: 35 at ID 110
    Bytes written to nvs: 35 at ID 111
    Bytes written to nvs: 35 at ID 112
    Bytes written to nvs: 35 at ID 113
    Bytes written to nvs: 35 at ID 114
    Bytes written to nvs: 35 at ID 115
    Bytes written to nvs: 35 at ID 116
    Bytes written to nvs: 35 at ID 117
    Bytes written to nvs: 35 at ID 118
    Bytes written to nvs: 35 at ID 119
    Bytes written to nvs: 35 at ID 120
    Bytes written to nvs: 35 at ID 121
    Bytes written to nvs: 35 at ID 122
    Bytes written to nvs: 35 at ID 123
    Bytes written to nvs: 35 at ID 124
    Bytes written to nvs: 35 at ID 125
    Bytes written to nvs: 35 at ID 126
    Bytes written to nvs: 35 at ID 127
    Bytes written to nvs: 35 at ID 128
    Bytes written to nvs: 35 at ID 129
    Bytes written to nvs: 35 at ID 130
    Bytes written to nvs: 35 at ID 131
    Bytes written to nvs: 35 at ID 132
    Bytes written to nvs: 35 at ID 133
    Bytes written to nvs: 35 at ID 134
    Bytes written to nvs: 35 at ID 135
    Bytes written to nvs: 35 at ID 136
    Bytes written to nvs: 35 at ID 137
    Bytes written to nvs: 35 at ID 138
    Bytes written to nvs: 35 at ID 139
    Bytes written to nvs: 35 at ID 140
    Bytes written to nvs: 35 at ID 141
    Bytes written to nvs: 35 at ID 142
    Bytes written to nvs: 35 at ID 143
    Bytes written to nvs: 35 at ID 144
    Bytes written to nvs: 35 at ID 145
    Bytes written to nvs: 35 at ID 146
    Bytes written to nvs: 35 at ID 147
    Bytes written to nvs: 35 at ID 148
    Bytes written to nvs: 35 at ID 149
    Bytes written to nvs: 35 at ID 150
    Bytes written to nvs: 35 at ID 151
    Bytes written to nvs: 35 at ID 152
    Bytes written to nvs: 35 at ID 153
    Bytes written to nvs: 35 at ID 154
    Bytes written to nvs: 35 at ID 155
    Bytes written to nvs: 35 at ID 156
    Bytes written to nvs: 35 at ID 157
    Bytes written to nvs: 35 at ID 158
    Bytes written to nvs: 35 at ID 159
    Bytes written to nvs: 35 at ID 160
    Bytes written to nvs: 35 at ID 161
    Bytes written to nvs: 35 at ID 162
    Bytes written to nvs: 35 at ID 163
    Bytes written to nvs: 35 at ID 164
    Bytes written to nvs: 35 at ID 165
    Bytes written to nvs: 35 at ID 166
    Bytes written to nvs: 35 at ID 167
    Bytes written to nvs: 35 at ID 168
    Bytes written to nvs: 35 at ID 169
    Bytes written to nvs: 35 at ID 170
    Bytes written to nvs: 35 at ID 171
    Bytes written to nvs: 35 at ID 172
    Bytes written to nvs: 35 at ID 173
    Bytes written to nvs: 35 at ID 174
    Bytes written to nvs: 35 at ID 175
    Bytes written to nvs: 35 at ID 176
    Bytes written to nvs: 35 at ID 177
    Bytes written to nvs: 35 at ID 178
    Bytes written to nvs: 35 at ID 179
    Bytes written to nvs: 35 at ID 180
    Bytes written to nvs: 35 at ID 181
    Bytes written to nvs: 35 at ID 182
    Bytes written to nvs: 35 at ID 183
    Bytes written to nvs: 35 at ID 184
    Bytes written to nvs: 35 at ID 185
    Bytes written to nvs: 35 at ID 186
    Bytes written to nvs: 35 at ID 187
    Bytes written to nvs: -28 at ID 188
    Bytes written to nvs: -28 at ID 189
    Bytes written to nvs: -28 at ID 190
    Bytes written to nvs: -28 at ID 191
    Bytes written to nvs: -28 at ID 192
    Bytes written to nvs: -28 at ID 193
    Bytes written to nvs: -28 at ID 194
    Bytes written to nvs: -28 at ID 195
    Bytes written to nvs: -28 at ID 196
    Bytes written to nvs: -28 at ID 197
    Bytes written to nvs: -28 at ID 198
    Bytes written to nvs: -28 at ID 199
    Bytes written to nvs: -28 at ID 200
    Bytes written to nvs: -28 at ID 201
    Bytes written to nvs: -28 at ID 202
    Bytes written to nvs: -28 at ID 203
    Bytes written to nvs: -28 at ID 204
    Bytes written to nvs: -28 at ID 205
    Bytes written to nvs: -28 at ID 206
    Bytes written to nvs: -28 at ID 207
    Bytes written to nvs: -28 at ID 208
    Bytes written to nvs: -28 at ID 209
    Bytes written to nvs: -28 at ID 210
    Bytes written to nvs: -28 at ID 211
    Bytes written to nvs: -28 at ID 212
    Bytes written to nvs: -28 at ID 213
    Bytes written to nvs: -28 at ID 214
    Bytes written to nvs: -28 at ID 215
    Bytes written to nvs: -28 at ID 216
    Bytes written to nvs: -28 at ID 217
    Bytes written to nvs: -28 at ID 218
    Bytes written to nvs: -28 at ID 219
    Bytes written to nvs: -28 at ID 220
    Bytes written to nvs: -28 at ID 221
    Bytes written to nvs: -28 at ID 222
    Bytes written to nvs: -28 at ID 223
    Bytes written to nvs: -28 at ID 224
    Bytes written to nvs: -28 at ID 225
    Bytes written to nvs: -28 at ID 226
    Bytes written to nvs: -28 at ID 227
    Bytes written to nvs: -28 at ID 228
    Bytes written to nvs: -28 at ID 229
    Bytes written to nvs: -28 at ID 230
    Bytes written to nvs: -28 at ID 231
    Bytes written to nvs: -28 at ID 232
    Bytes written to nvs: -28 at ID 233
    Bytes written to nvs: -28 at ID 234
    Bytes written to nvs: -28 at ID 235
    Bytes written to nvs: -28 at ID 236
    Bytes written to nvs: -28 at ID 237
    Bytes written to nvs: -28 at ID 238
    Bytes written to nvs: -28 at ID 239
    Bytes written to nvs: -28 at ID 240
    Bytes written to nvs: -28 at ID 241
    Bytes written to nvs: -28 at ID 242
    Bytes written to nvs: -28 at ID 243
    Bytes written to nvs: -28 at ID 244
    Bytes written to nvs: -28 at ID 245
    Bytes written to nvs: -28 at ID 246
    Bytes written to nvs: -28 at ID 247
    Bytes written to nvs: -28 at ID 248
    Bytes written to nvs: -28 at ID 249
    Bytes written to nvs: -28 at ID 250
    Bytes written to nvs: -28 at ID 251
    Bytes written to nvs: -28 at ID 252
    Bytes written to nvs: -28 at ID 253
    Bytes written to nvs: -28 at ID 254
    Bytes written to nvs: -28 at ID 255
    Bytes written to nvs: -28 at ID 256
    Bytes written to nvs: -28 at ID 257
    Bytes written to nvs: -28 at ID 258
    Bytes written to nvs: -28 at ID 259
    Bytes written to nvs: -28 at ID 260
    Bytes written to nvs: -28 at ID 261
    Bytes written to nvs: -28 at ID 262
    Bytes written to nvs: -28 at ID 263
    Bytes written to nvs: -28 at ID 264
    Bytes written to nvs: -28 at ID 265
    Bytes written to nvs: -28 at ID 266
    Bytes written to nvs: -28 at ID 267
    Bytes written to nvs: -28 at ID 268
    Bytes written to nvs: -28 at ID 269
    Bytes written to nvs: -28 at ID 270
    Bytes written to nvs: -28 at ID 271
    Bytes written to nvs: -28 at ID 272
    Bytes written to nvs: -28 at ID 273
    Bytes written to nvs: -28 at ID 274
    Bytes written to nvs: -28 at ID 275
    Bytes written to nvs: -28 at ID 276
    Bytes written to nvs: -28 at ID 277
    Bytes written to nvs: -28 at ID 278
    Bytes written to nvs: -28 at ID 279
    Bytes written to nvs: -28 at ID 280
    Bytes written to nvs: -28 at ID 281
    Bytes written to nvs: -28 at ID 282
    Bytes written to nvs: -28 at ID 283
    Bytes written to nvs: -28 at ID 284
    Bytes written to nvs: -28 at ID 285
    Bytes written to nvs: -28 at ID 286
    Bytes written to nvs: -28 at ID 287
    Bytes written to nvs: -28 at ID 288
    Bytes written to nvs: -28 at ID 289
    Bytes written to nvs: -28 at ID 290
    Bytes written to nvs: -28 at ID 291
    Bytes written to nvs: -28 at ID 292
    Bytes written to nvs: -28 at ID 293
    Bytes written to nvs: -28 at ID 294
    Bytes written to nvs: -28 at ID 295
    Bytes written to nvs: -28 at ID 296
    Bytes written to nvs: -28 at ID 297
    Bytes written to nvs: -28 at ID 298
    Bytes written to nvs: -28 at ID 299
    Bytes written to nvs: -28 at ID 300
    Bytes written to nvs: -28 at ID 301
    Bytes written to nvs: -28 at ID 302
    Bytes written to nvs: -28 at ID 303
    Bytes written to nvs: -28 at ID 304
    Bytes written to nvs: -28 at ID 305
    Bytes written to nvs: -28 at ID 306
    Bytes written to nvs: -28 at ID 307
    Bytes written to nvs: -28 at ID 308
    Bytes written to nvs: -28 at ID 309
    Bytes written to nvs: -28 at ID 310
    Bytes written to nvs: -28 at ID 311
    Bytes written to nvs: -28 at ID 312
    Bytes written to nvs: -28 at ID 313
    Bytes written to nvs: -28 at ID 314
    Bytes written to nvs: -28 at ID 315
    Bytes written to nvs: -28 at ID 316
    Bytes written to nvs: -28 at ID 317
    Bytes written to nvs: -28 at ID 318
    Bytes written to nvs: -28 at ID 319
    Bytes written to nvs: -28 at ID 320
    Bytes written to nvs: -28 at ID 321
    Bytes written to nvs: -28 at ID 322
    Bytes written to nvs: -28 at ID 323
    Bytes written to nvs: -28 at ID 324
    Bytes written to nvs: -28 at ID 325
    Bytes written to nvs: -28 at ID 326
    Bytes written to nvs: -28 at ID 327
    Bytes written to nvs: -28 at ID 328
    Bytes written to nvs: -28 at ID 329
    Bytes written to nvs: -28 at ID 330
    Bytes written to nvs: -28 at ID 331
    Bytes written to nvs: -28 at ID 332
    Bytes written to nvs: -28 at ID 333
    Bytes written to nvs: -28 at ID 334
    Bytes written to nvs: -28 at ID 335
    Bytes written to nvs: -28 at ID 336
    Bytes written to nvs: -28 at ID 337
    Bytes written to nvs: -28 at ID 338
    Bytes written to nvs: -28 at ID 339
    Bytes written to nvs: -28 at ID 340
    Bytes written to nvs: -28 at ID 341
    Bytes written to nvs: -28 at ID 342
    Bytes written to nvs: -28 at ID 343
    Bytes written to nvs: -28 at ID 344
    Bytes written to nvs: -28 at ID 345
    Bytes written to nvs: -28 at ID 346
    Bytes written to nvs: -28 at ID 347
    Bytes written to nvs: -28 at ID 348
    Bytes written to nvs: -28 at ID 349
    Bytes written to nvs: -28 at ID 350
    Bytes written to nvs: -28 at ID 351
    Bytes written to nvs: -28 at ID 352
    Bytes written to nvs: -28 at ID 353
    Bytes written to nvs: -28 at ID 354
    Bytes written to nvs: -28 at ID 355
    Bytes written to nvs: -28 at ID 356
    Bytes written to nvs: -28 at ID 357
    Bytes written to nvs: -28 at ID 358
    Bytes written to nvs: -28 at ID 359
    Bytes written to nvs: -28 at ID 360
    Bytes written to nvs: -28 at ID 361
    Bytes written to nvs: -28 at ID 362
    Bytes written to nvs: -28 at ID 363
    Bytes written to nvs: -28 at ID 364
    Bytes written to nvs: -28 at ID 365
    Bytes written to nvs: -28 at ID 366
    Bytes written to nvs: -28 at ID 367
    Bytes written to nvs: -28 at ID 368
    Bytes written to nvs: -28 at ID 369
    Bytes written to nvs: -28 at ID 370
    Bytes written to nvs: -28 at ID 371
    Bytes written to nvs: -28 at ID 372
    Bytes written to nvs: -28 at ID 373
    Bytes written to nvs: -28 at ID 374
    Bytes written to nvs: -28 at ID 375
    Bytes written to nvs: -28 at ID 376
    Bytes written to nvs: -28 at ID 377
    Bytes written to nvs: -28 at ID 378
    Bytes written to nvs: -28 at ID 379
    Bytes written to nvs: -28 at ID 380
    Bytes written to nvs: -28 at ID 381
    Bytes written to nvs: -28 at ID 382
    Bytes written to nvs: -28 at ID 383
    Bytes written to nvs: -28 at ID 384
    Bytes written to nvs: -28 at ID 385
    Bytes written to nvs: -28 at ID 386
    Bytes written to nvs: -28 at ID 387
    Bytes written to nvs: -28 at ID 388
    Bytes written to nvs: -28 at ID 389
    Bytes written to nvs: -28 at ID 390
    Bytes written to nvs: -28 at ID 391
    Bytes written to nvs: -28 at ID 392
    Bytes written to nvs: -28 at ID 393
    Bytes written to nvs: -28 at ID 394
    Bytes written to nvs: -28 at ID 395
    Bytes written to nvs: -28 at ID 396
    Bytes written to nvs: -28 at ID 397
    Bytes written to nvs: -28 at ID 398
    Bytes written to nvs: -28 at ID 399
    Bytes written to nvs: -28 at ID 400
    Bytes written to nvs: -28 at ID 401
    Bytes written to nvs: -28 at ID 402
    Bytes written to nvs: -28 at ID 403
    Bytes written to nvs: -28 at ID 404
    Bytes written to nvs: -28 at ID 405
    Bytes written to nvs: -28 at ID 406
    Bytes written to nvs: -28 at ID 407
    Bytes written to nvs: -28 at ID 408
    Bytes written to nvs: -28 at ID 409
    Bytes written to nvs: -28 at ID 410
    Bytes written to nvs: -28 at ID 411
    Bytes written to nvs: -28 at ID 412
    Bytes written to nvs: -28 at ID 413
    Bytes written to nvs: -28 at ID 414
    Bytes written to nvs: -28 at ID 415
    Bytes written to nvs: -28 at ID 416
    Bytes written to nvs: -28 at ID 417
    Bytes written to nvs: -28 at ID 418
    Bytes written to nvs: -28 at ID 419
    Bytes written to nvs: -28 at ID 420
    Bytes written to nvs: -28 at ID 421
    Bytes written to nvs: -28 at ID 422
    Bytes written to nvs: -28 at ID 423
    Bytes written to nvs: -28 at ID 424
    Bytes written to nvs: -28 at ID 425
    Bytes written to nvs: -28 at ID 426
    Bytes written to nvs: -28 at ID 427
    Bytes written to nvs: -28 at ID 428
    Bytes written to nvs: -28 at ID 429
    Bytes written to nvs: -28 at ID 430
    Bytes written to nvs: -28 at ID 431
    Bytes written to nvs: -28 at ID 432
    Bytes written to nvs: -28 at ID 433
    Bytes written to nvs: -28 at ID 434
    Bytes written to nvs: -28 at ID 435
    Bytes written to nvs: -28 at ID 436
    Bytes written to nvs: -28 at ID 437
    Bytes written to nvs: -28 at ID 438
    Bytes written to nvs: -28 at ID 439
    Bytes written to nvs: -28 at ID 440
    Bytes written to nvs: -28 at ID 441
    Bytes written to nvs: -28 at ID 442
    Bytes written to nvs: -28 at ID 443
    Bytes written to nvs: -28 at ID 444
    Bytes written to nvs: -28 at ID 445
    Bytes written to nvs: -28 at ID 446
    Bytes written to nvs: -28 at ID 447
    Bytes written to nvs: -28 at ID 448
    Bytes written to nvs: -28 at ID 449
    Bytes written to nvs: -28 at ID 450
    Bytes written to nvs: -28 at ID 451
    Bytes written to nvs: -28 at ID 452
    Bytes written to nvs: -28 at ID 453
    Bytes written to nvs: -28 at ID 454
    Bytes written to nvs: -28 at ID 455
    Bytes written to nvs: -28 at ID 456
    Bytes written to nvs: -28 at ID 457
    Bytes written to nvs: -28 at ID 458
    Bytes written to nvs: -28 at ID 459
    Bytes written to nvs: -28 at ID 460
    Bytes written to nvs: -28 at ID 461
    Bytes written to nvs: -28 at ID 462
    Bytes written to nvs: -28 at ID 463
    Bytes written to nvs: -28 at ID 464
    Bytes written to nvs: -28 at ID 465
    Bytes written to nvs: -28 at ID 466
    Bytes written to nvs: -28 at ID 467
    Bytes written to nvs: -28 at ID 468
    Bytes written to nvs: -28 at ID 469
    Bytes written to nvs: -28 at ID 470
    Bytes written to nvs: -28 at ID 471
    Bytes written to nvs: -28 at ID 472
    Bytes written to nvs: -28 at ID 473
    Bytes written to nvs: -28 at ID 474
    Bytes written to nvs: -28 at ID 475
    Bytes written to nvs: -28 at ID 476
    Bytes written to nvs: -28 at ID 477
    Bytes written to nvs: -28 at ID 478
    Bytes written to nvs: -28 at ID 479
    Bytes written to nvs: -28 at ID 480
    Bytes written to nvs: -28 at ID 481
    Bytes written to nvs: -28 at ID 482
    Bytes written to nvs: -28 at ID 483
    Bytes written to nvs: -28 at ID 484
    Bytes written to nvs: -28 at ID 485
    Bytes written to nvs: -28 at ID 486
    Bytes written to nvs: -28 at ID 487
    Bytes written to nvs: -28 at ID 488
    Bytes written to nvs: -28 at ID 489
    Bytes written to nvs: -28 at ID 490
    Bytes written to nvs: -28 at ID 491
    Bytes written to nvs: -28 at ID 492
    Bytes written to nvs: -28 at ID 493
    Bytes written to nvs: -28 at ID 494
    Bytes written to nvs: -28 at ID 495
    Bytes written to nvs: -28 at ID 496
    Bytes written to nvs: -28 at ID 497
    Bytes written to nvs: -28 at ID 498
    Bytes written to nvs: -28 at ID 499
    Bytes written to nvs: -28 at ID 500
    Bytes written to nvs: -28 at ID 501
    Bytes written to nvs: -28 at ID 502
    Bytes written to nvs: -28 at ID 503
    Bytes written to nvs: -28 at ID 504
    Bytes written to nvs: -28 at ID 505
    Bytes written to nvs: -28 at ID 506
    Bytes written to nvs: -28 at ID 507
    Bytes written to nvs: -28 at ID 508
    Bytes written to nvs: -28 at ID 509
    Bytes written to nvs: -28 at ID 510
    Bytes written to nvs: -28 at ID 511
    Bytes written to nvs: -28 at ID 512
    Bytes written to nvs: -28 at ID 513
    Bytes written to nvs: -28 at ID 514
    Bytes written to nvs: -28 at ID 515
    Bytes written to nvs: -28 at ID 516
    Bytes written to nvs: -28 at ID 517
    Bytes written to nvs: -28 at ID 518
    Bytes written to nvs: -28 at ID 519
    Bytes written to nvs: -28 at ID 520
    Bytes written to nvs: -28 at ID 521
    Bytes written to nvs: -28 at ID 522
    Bytes written to nvs: -28 at ID 523
    Bytes written to nvs: -28 at ID 524
    Bytes written to nvs: -28 at ID 525
    Bytes written to nvs: -28 at ID 526
    Bytes written to nvs: -28 at ID 527
    Bytes written to nvs: -28 at ID 528
    Bytes written to nvs: -28 at ID 529
    Bytes written to nvs: -28 at ID 530
    Bytes written to nvs: -28 at ID 531
    Bytes written to nvs: -28 at ID 532
    Bytes written to nvs: -28 at ID 533
    Bytes written to nvs: -28 at ID 534
    Bytes written to nvs: -28 at ID 535
    Bytes written to nvs: -28 at ID 536
    Bytes written to nvs: -28 at ID 537
    Bytes written to nvs: -28 at ID 538
    Bytes written to nvs: -28 at ID 539
    Bytes written to nvs: -28 at ID 540
    Bytes written to nvs: -28 at ID 541
    Bytes written to nvs: -28 at ID 542
    Bytes written to nvs: -28 at ID 543
    Bytes written to nvs: -28 at ID 544
    Bytes written to nvs: -28 at ID 545
    Bytes written to nvs: -28 at ID 546
    Bytes written to nvs: -28 at ID 547
    Bytes written to nvs: -28 at ID 548
    Bytes written to nvs: -28 at ID 549
    Bytes written to nvs: -28 at ID 550
    Bytes written to nvs: -28 at ID 551
    Bytes written to nvs: -28 at ID 552
    Bytes written to nvs: -28 at ID 553
    Bytes written to nvs: -28 at ID 554
    Bytes written to nvs: -28 at ID 555
    Bytes written to nvs: -28 at ID 556
    Bytes written to nvs: -28 at ID 557
    Bytes written to nvs: -28 at ID 558
    Bytes written to nvs: -28 at ID 559
    Bytes written to nvs: -28 at ID 560
    Bytes written to nvs: -28 at ID 561
    Bytes written to nvs: -28 at ID 562
    Bytes written to nvs: -28 at ID 563
    Bytes written to nvs: -28 at ID 564
    Bytes written to nvs: -28 at ID 565
    Bytes written to nvs: -28 at ID 566
    Bytes written to nvs: -28 at ID 567
    Bytes written to nvs: -28 at ID 568
    Bytes written to nvs: -28 at ID 569
    Bytes written to nvs: -28 at ID 570
    Bytes written to nvs: -28 at ID 571
    Bytes written to nvs: -28 at ID 572
    Bytes written to nvs: -28 at ID 573
    Bytes written to nvs: -28 at ID 574
    Bytes written to nvs: -28 at ID 575
    Bytes written to nvs: -28 at ID 576
    Bytes written to nvs: -28 at ID 577
    Bytes written to nvs: -28 at ID 578
    Bytes written to nvs: -28 at ID 579
    Bytes written to nvs: -28 at ID 580
    Bytes written to nvs: -28 at ID 581
    Bytes written to nvs: -28 at ID 582
    Bytes written to nvs: -28 at ID 583
    Bytes written to nvs: -28 at ID 584
    Bytes written to nvs: -28 at ID 585
    Bytes written to nvs: -28 at ID 586
    Bytes written to nvs: -28 at ID 587
    Bytes written to nvs: -28 at ID 588
    Bytes written to nvs: -28 at ID 589
    Bytes written to nvs: -28 at ID 590
    Bytes written to nvs: -28 at ID 591
    Bytes written to nvs: -28 at ID 592
    Bytes written to nvs: -28 at ID 593
    Bytes written to nvs: -28 at ID 594
    Bytes written to nvs: -28 at ID 595
    Bytes written to nvs: -28 at ID 596
    Bytes written to nvs: -28 at ID 597
    Bytes written to nvs: -28 at ID 598
    Bytes written to nvs: -28 at ID 599
    Bytes written to nvs: -28 at ID 600
    Bytes written to nvs: -28 at ID 601
    Bytes written to nvs: -28 at ID 602
    Bytes written to nvs: -28 at ID 603
    Bytes written to nvs: -28 at ID 604
    Bytes written to nvs: -28 at ID 605
    Bytes written to nvs: -28 at ID 606
    Bytes written to nvs: -28 at ID 607
    Bytes written to nvs: -28 at ID 608
    Bytes written to nvs: -28 at ID 609
    Bytes written to nvs: -28 at ID 610
    Bytes written to nvs: -28 at ID 611
    Bytes written to nvs: -28 at ID 612
    Bytes written to nvs: -28 at ID 613
    Bytes written to nvs: -28 at ID 614
    Bytes written to nvs: -28 at ID 615
    Bytes written to nvs: -28 at ID 616
    Bytes written to nvs: -28 at ID 617
    Bytes written to nvs: -28 at ID 618
    Bytes written to nvs: -28 at ID 619
    Bytes written to nvs: -28 at ID 620
    Bytes written to nvs: -28 at ID 621
    Bytes written to nvs: -28 at ID 622
    Bytes written to nvs: -28 at ID 623
    Bytes written to nvs: -28 at ID 624
    Bytes written to nvs: -28 at ID 625
    Bytes written to nvs: -28 at ID 626
    Bytes written to nvs: -28 at ID 627
    Bytes written to nvs: -28 at ID 628
    Bytes written to nvs: -28 at ID 629
    Bytes written to nvs: -28 at ID 630
    Bytes written to nvs: -28 at ID 631
    Bytes written to nvs: -28 at ID 632
    Bytes written to nvs: -28 at ID 633
    Bytes written to nvs: -28 at ID 634
    Bytes written to nvs: -28 at ID 635
    Bytes written to nvs: -28 at ID 636
    Bytes written to nvs: -28 at ID 637
    Bytes written to nvs: -28 at ID 638
    Bytes written to nvs: -28 at ID 639
    Bytes written to nvs: -28 at ID 640
    Bytes written to nvs: -28 at ID 641
    Bytes written to nvs: -28 at ID 642
    Bytes written to nvs: -28 at ID 643
    Bytes written to nvs: -28 at ID 644
    Bytes written to nvs: -28 at ID 645
    Bytes written to nvs: -28 at ID 646
    Bytes written to nvs: -28 at ID 647
    Bytes written to nvs: -28 at ID 648
    Bytes written to nvs: -28 at ID 649
    Bytes written to nvs: -28 at ID 650
    Bytes written to nvs: -28 at ID 651
    Bytes written to nvs: -28 at ID 652
    Bytes written to nvs: -28 at ID 653
    Bytes written to nvs: -28 at ID 654
    Bytes written to nvs: -28 at ID 655
    Bytes written to nvs: -28 at ID 656
    Bytes written to nvs: -28 at ID 657
    Bytes written to nvs: -28 at ID 658
    Bytes written to nvs: -28 at ID 659
    Bytes written to nvs: -28 at ID 660
    Bytes written to nvs: -28 at ID 661
    Bytes written to nvs: -28 at ID 662
    Bytes written to nvs: -28 at ID 663
    Bytes written to nvs: -28 at ID 664
    Bytes written to nvs: -28 at ID 665
    Bytes written to nvs: -28 at ID 666
    Bytes written to nvs: -28 at ID 667
    Bytes written to nvs: -28 at ID 668
    Bytes written to nvs: -28 at ID 669
    Bytes written to nvs: -28 at ID 670
    Bytes written to nvs: -28 at ID 671
    Bytes written to nvs: -28 at ID 672
    Bytes written to nvs: -28 at ID 673
    Bytes written to nvs: -28 at ID 674
    Bytes written to nvs: -28 at ID 675
    Bytes written to nvs: -28 at ID 676
    Bytes written to nvs: -28 at ID 677
    Bytes written to nvs: -28 at ID 678
    Bytes written to nvs: -28 at ID 679
    Bytes written to nvs: -28 at ID 680
    Bytes written to nvs: -28 at ID 681
    Bytes written to nvs: -28 at ID 682
    Bytes written to nvs: -28 at ID 683
    Bytes written to nvs: -28 at ID 684
    Bytes written to nvs: -28 at ID 685
    Bytes written to nvs: -28 at ID 686
    Bytes written to nvs: -28 at ID 687
    Bytes written to nvs: -28 at ID 688
    Bytes written to nvs: -28 at ID 689
    Bytes written to nvs: -28 at ID 690
    Bytes written to nvs: -28 at ID 691
    Bytes written to nvs: -28 at ID 692
    Bytes written to nvs: -28 at ID 693
    Bytes written to nvs: -28 at ID 694
    Bytes written to nvs: -28 at ID 695
    Bytes written to nvs: -28 at ID 696
    Bytes written to nvs: -28 at ID 697
    Bytes written to nvs: -28 at ID 698
    Bytes written to nvs: -28 at ID 699
    Bytes written to nvs: -28 at ID 700
    Bytes written to nvs: -28 at ID 701
    Bytes written to nvs: -28 at ID 702
    Bytes written to nvs: -28 at ID 703
    Bytes written to nvs: -28 at ID 704
    Bytes written to nvs: -28 at ID 705
    Bytes written to nvs: -28 at ID 706
    Bytes written to nvs: -28 at ID 707
    Bytes written to nvs: -28 at ID 708
    Bytes written to nvs: -28 at ID 709
    Bytes written to nvs: -28 at ID 710
    Bytes written to nvs: -28 at ID 711
    Bytes written to nvs: -28 at ID 712
    Bytes written to nvs: -28 at ID 713
    Bytes written to nvs: -28 at ID 714
    Bytes written to nvs: -28 at ID 715
    Bytes written to nvs: -28 at ID 716
    Bytes written to nvs: -28 at ID 717
    Bytes written to nvs: -28 at ID 718
    Bytes written to nvs: -28 at ID 719
    Bytes written to nvs: -28 at ID 720
    Bytes written to nvs: -28 at ID 721
    Bytes written to nvs: -28 at ID 722
    Bytes written to nvs: -28 at ID 723
    Bytes written to nvs: -28 at ID 724
    Bytes written to nvs: -28 at ID 725
    Bytes written to nvs: -28 at ID 726
    Bytes written to nvs: -28 at ID 727
    Bytes written to nvs: -28 at ID 728
    Bytes written to nvs: -28 at ID 729
    Bytes written to nvs: -28 at ID 730
    Bytes written to nvs: -28 at ID 731
    Bytes written to nvs: -28 at ID 732
    Bytes written to nvs: -28 at ID 733
    Bytes written to nvs: -28 at ID 734
    Bytes written to nvs: -28 at ID 735
    Bytes written to nvs: -28 at ID 736
    Bytes written to nvs: -28 at ID 737
    Bytes written to nvs: -28 at ID 738
    Bytes written to nvs: -28 at ID 739
    Bytes written to nvs: -28 at ID 740
    Bytes written to nvs: -28 at ID 741
    Bytes written to nvs: -28 at ID 742
    Bytes written to nvs: -28 at ID 743
    Bytes written to nvs: -28 at ID 744
    Bytes written to nvs: -28 at ID 745
    Bytes written to nvs: -28 at ID 746
    Bytes written to nvs: -28 at ID 747
    Bytes written to nvs: -28 at ID 748
    Bytes written to nvs: -28 at ID 749
    Bytes written to nvs: -28 at ID 750
    Bytes written to nvs: -28 at ID 751
    Bytes written to nvs: -28 at ID 752
    Bytes written to nvs: -28 at ID 753
    Bytes written to nvs: -28 at ID 754
    Bytes written to nvs: -28 at ID 755
    Bytes written to nvs: -28 at ID 756
    Bytes written to nvs: -28 at ID 757
    Bytes written to nvs: -28 at ID 758
    Bytes written to nvs: -28 at ID 759
    Bytes written to nvs: -28 at ID 760
    Bytes written to nvs: -28 at ID 761
    Bytes written to nvs: -28 at ID 762
    Bytes written to nvs: -28 at ID 763
    Bytes written to nvs: -28 at ID 764
    Bytes written to nvs: -28 at ID 765
    Bytes written to nvs: -28 at ID 766
    Bytes written to nvs: -28 at ID 767
    Bytes written to nvs: -28 at ID 768
    Bytes written to nvs: -28 at ID 769
    Bytes written to nvs: -28 at ID 770
    Bytes written to nvs: -28 at ID 771
    Bytes written to nvs: -28 at ID 772
    Bytes written to nvs: -28 at ID 773
    Bytes written to nvs: -28 at ID 774
    Bytes written to nvs: -28 at ID 775
    Bytes written to nvs: -28 at ID 776
    Bytes written to nvs: -28 at ID 777
    Bytes written to nvs: -28 at ID 778
    Bytes written to nvs: -28 at ID 779
    Bytes written to nvs: -28 at ID 780
    Bytes written to nvs: -28 at ID 781
    Bytes written to nvs: -28 at ID 782
    Bytes written to nvs: -28 at ID 783
    Bytes written to nvs: -28 at ID 784
    Bytes written to nvs: -28 at ID 785
    Bytes written to nvs: -28 at ID 786
    Bytes written to nvs: -28 at ID 787
    Bytes written to nvs: -28 at ID 788
    Bytes written to nvs: -28 at ID 789
    Bytes written to nvs: -28 at ID 790
    Bytes written to nvs: -28 at ID 791
    Bytes written to nvs: -28 at ID 792
    Bytes written to nvs: -28 at ID 793
    Bytes written to nvs: -28 at ID 794
    Bytes written to nvs: -28 at ID 795
    Bytes written to nvs: -28 at ID 796
    Bytes written to nvs: -28 at ID 797
    Bytes written to nvs: -28 at ID 798
    Bytes written to nvs: -28 at ID 799
    Bytes written to nvs: -28 at ID 800
    Bytes written to nvs: -28 at ID 801
    Bytes written to nvs: -28 at ID 802
    Bytes written to nvs: -28 at ID 803
    Bytes written to nvs: -28 at ID 804
    Bytes written to nvs: -28 at ID 805
    Bytes written to nvs: -28 at ID 806
    Bytes written to nvs: -28 at ID 807
    Bytes written to nvs: -28 at ID 808
    Bytes written to nvs: -28 at ID 809
    Bytes written to nvs: -28 at ID 810
    Bytes written to nvs: -28 at ID 811
    Bytes written to nvs: -28 at ID 812
    Bytes written to nvs: -28 at ID 813
    Bytes written to nvs: -28 at ID 814
    Bytes written to nvs: -28 at ID 815
    Bytes written to nvs: -28 at ID 816
    Bytes written to nvs: -28 at ID 817
    Bytes written to nvs: -28 at ID 818
    Bytes written to nvs: -28 at ID 819
    Bytes written to nvs: -28 at ID 820
    Bytes written to nvs: -28 at ID 821
    Bytes written to nvs: -28 at ID 822
    Bytes written to nvs: -28 at ID 823
    Bytes written to nvs: -28 at ID 824
    Bytes written to nvs: -28 at ID 825
    Bytes written to nvs: -28 at ID 826
    Bytes written to nvs: -28 at ID 827
    Bytes written to nvs: -28 at ID 828
    Bytes written to nvs: -28 at ID 829
    Bytes written to nvs: -28 at ID 830
    Bytes written to nvs: -28 at ID 831
    Bytes written to nvs: -28 at ID 832
    Bytes written to nvs: -28 at ID 833
    Bytes written to nvs: -28 at ID 834
    Bytes written to nvs: -28 at ID 835
    Bytes written to nvs: -28 at ID 836
    Bytes written to nvs: -28 at ID 837
    Bytes written to nvs: -28 at ID 838
    Bytes written to nvs: -28 at ID 839
    Bytes written to nvs: -28 at ID 840
    Bytes written to nvs: -28 at ID 841
    Bytes written to nvs: -28 at ID 842
    Bytes written to nvs: -28 at ID 843
    Bytes written to nvs: -28 at ID 844
    Bytes written to nvs: -28 at ID 845
    Bytes written to nvs: -28 at ID 846
    Bytes written to nvs: -28 at ID 847
    Bytes written to nvs: -28 at ID 848
    Bytes written to nvs: -28 at ID 849
    Bytes written to nvs: -28 at ID 850
    Bytes written to nvs: -28 at ID 851
    Bytes written to nvs: -28 at ID 852
    Bytes written to nvs: -28 at ID 853
    Bytes written to nvs: -28 at ID 854
    Bytes written to nvs: -28 at ID 855
    Bytes written to nvs: -28 at ID 856
    Bytes written to nvs: -28 at ID 857
    Bytes written to nvs: -28 at ID 858
    Bytes written to nvs: -28 at ID 859
    Bytes written to nvs: -28 at ID 860
    Bytes written to nvs: -28 at ID 861
    Bytes written to nvs: -28 at ID 862
    Bytes written to nvs: -28 at ID 863
    Bytes written to nvs: -28 at ID 864
    Bytes written to nvs: -28 at ID 865
    Bytes written to nvs: -28 at ID 866
    Bytes written to nvs: -28 at ID 867
    Bytes written to nvs: -28 at ID 868
    Bytes written to nvs: -28 at ID 869
    Bytes written to nvs: -28 at ID 870
    Bytes written to nvs: -28 at ID 871
    Bytes written to nvs: -28 at ID 872
    Bytes written to nvs: -28 at ID 873
    Bytes written to nvs: -28 at ID 874
    Bytes written to nvs: -28 at ID 875
    Bytes written to nvs: -28 at ID 876
    Bytes written to nvs: -28 at ID 877
    Bytes written to nvs: -28 at ID 878
    Bytes written to nvs: -28 at ID 879
    Bytes written to nvs: -28 at ID 880
    Bytes written to nvs: -28 at ID 881
    Bytes written to nvs: -28 at ID 882
    Bytes written to nvs: -28 at ID 883
    Bytes written to nvs: -28 at ID 884
    Bytes written to nvs: -28 at ID 885
    Bytes written to nvs: -28 at ID 886
    Bytes written to nvs: -28 at ID 887
    Bytes written to nvs: -28 at ID 888
    Bytes written to nvs: -28 at ID 889
    Bytes written to nvs: -28 at ID 890
    Bytes written to nvs: -28 at ID 891
    Bytes written to nvs: -28 at ID 892
    Bytes written to nvs: -28 at ID 893
    Bytes written to nvs: -28 at ID 894
    Bytes written to nvs: -28 at ID 895
    Bytes written to nvs: -28 at ID 896
    Bytes written to nvs: -28 at ID 897
    Bytes written to nvs: -28 at ID 898
    Bytes written to nvs: -28 at ID 899
    Bytes written to nvs: -28 at ID 900
    Bytes written to nvs: -28 at ID 901
    Bytes written to nvs: -28 at ID 902
    Bytes written to nvs: -28 at ID 903
    Bytes written to nvs: -28 at ID 904
    Bytes written to nvs: -28 at ID 905
    Bytes written to nvs: -28 at ID 906
    Bytes written to nvs: -28 at ID 907
    Bytes written to nvs: -28 at ID 908
    Bytes written to nvs: -28 at ID 909
    Bytes written to nvs: -28 at ID 910
    Bytes written to nvs: -28 at ID 911
    Bytes written to nvs: -28 at ID 912
    Bytes written to nvs: -28 at ID 913
    Bytes written to nvs: -28 at ID 914
    Bytes written to nvs: -28 at ID 915
    Bytes written to nvs: -28 at ID 916
    Bytes written to nvs: -28 at ID 917
    Bytes written to nvs: -28 at ID 918
    Bytes written to nvs: -28 at ID 919
    Bytes written to nvs: -28 at ID 920
    Bytes written to nvs: -28 at ID 921
    Bytes written to nvs: -28 at ID 922
    Bytes written to nvs: -28 at ID 923
    Bytes written to nvs: -28 at ID 924
    Bytes written to nvs: -28 at ID 925
    Bytes written to nvs: -28 at ID 926
    Bytes written to nvs: -28 at ID 927
    Bytes written to nvs: -28 at ID 928
    Bytes written to nvs: -28 at ID 929
    Bytes written to nvs: -28 at ID 930
    Bytes written to nvs: -28 at ID 931
    Bytes written to nvs: -28 at ID 932
    Bytes written to nvs: -28 at ID 933
    Bytes written to nvs: -28 at ID 934
    Bytes written to nvs: -28 at ID 935
    Bytes written to nvs: -28 at ID 936
    Bytes written to nvs: -28 at ID 937
    Bytes written to nvs: -28 at ID 938
    Bytes written to nvs: -28 at ID 939
    Bytes written to nvs: -28 at ID 940
    Bytes written to nvs: -28 at ID 941
    Bytes written to nvs: -28 at ID 942
    Bytes written to nvs: -28 at ID 943
    Bytes written to nvs: -28 at ID 944
    Bytes written to nvs: -28 at ID 945
    Bytes written to nvs: -28 at ID 946
    Bytes written to nvs: -28 at ID 947
    Bytes written to nvs: -28 at ID 948
    Bytes written to nvs: -28 at ID 949
    Bytes written to nvs: -28 at ID 950
    Bytes written to nvs: -28 at ID 951
    Bytes written to nvs: -28 at ID 952
    Bytes written to nvs: -28 at ID 953
    Bytes written to nvs: -28 at ID 954
    Bytes written to nvs: -28 at ID 955
    Bytes written to nvs: -28 at ID 956
    Bytes written to nvs: -28 at ID 957
    Bytes written to nvs: -28 at ID 958
    Bytes written to nvs: -28 at ID 959
    Bytes written to nvs: -28 at ID 960
    Bytes written to nvs: -28 at ID 961
    Bytes written to nvs: -28 at ID 962
    Bytes written to nvs: -28 at ID 963
    Bytes written to nvs: -28 at ID 964
    Bytes written to nvs: -28 at ID 965
    Bytes written to nvs: -28 at ID 966
    Bytes written to nvs: -28 at ID 967
    Bytes written to nvs: -28 at ID 968
    Bytes written to nvs: -28 at ID 969
    Bytes written to nvs: -28 at ID 970
    Bytes written to nvs: -28 at ID 971
    Bytes written to nvs: -28 at ID 972
    Bytes written to nvs: -28 at ID 973
    Bytes written to nvs: -28 at ID 974
    Bytes written to nvs: -28 at ID 975
    Bytes written to nvs: -28 at ID 976
    Bytes written to nvs: -28 at ID 977
    Bytes written to nvs: -28 at ID 978
    Bytes written to nvs: -28 at ID 979
    Bytes written to nvs: -28 at ID 980
    Bytes written to nvs: -28 at ID 981
    Bytes written to nvs: -28 at ID 982
    Bytes written to nvs: -28 at ID 983
    Bytes written to nvs: -28 at ID 984
    Bytes written to nvs: -28 at ID 985
    Bytes written to nvs: -28 at ID 986
    Bytes written to nvs: -28 at ID 987
    Bytes written to nvs: -28 at ID 988
    Bytes written to nvs: -28 at ID 989
    Bytes written to nvs: -28 at ID 990
    Bytes written to nvs: -28 at ID 991
    Bytes written to nvs: -28 at ID 992
    Bytes written to nvs: -28 at ID 993
    Bytes written to nvs: -28 at ID 994
    Bytes written to nvs: -28 at ID 995
    Bytes written to nvs: -28 at ID 996
    Bytes written to nvs: -28 at ID 997
    Bytes written to nvs: -28 at ID 998
    Bytes written to nvs: -28 at ID 999
    NVS offset: 000fa000
    NVS ate_wra: 00010d00
    NVS data_wra: 00010cda
    NVS Sector Size: 4096
    NVS sector_count: 3
    NVS write_block_size: 1
    NVS ready: 1
    Remaining free space in nvs sector is 92 Bytes
    [00:08:28.430,328] <dbg> fs_nvs.nvs_gc: Moving 157, len 35
    --- 9999 messages dropped ---
    [00:08:28.431,701] <dbg> fs_nvs.nvs_gc: Moving 158, len 35
    [00:08:28.433,044] <dbg> fs_nvs.nvs_gc: Moving 159, len 35
    [00:08:28.434,478] <dbg> fs_nvs.nvs_gc: Moving 160, len 35
    [00:08:28.435,943] <dbg> fs_nvs.nvs_gc: Moving 161, len 35
    [00:08:28.437,347] <dbg> fs_nvs.nvs_gc: Moving 162, len 35
    [00:08:28.438,690] <dbg> fs_nvs.nvs_gc: Moving 163, len 35
    [00:08:28.440,185] <dbg> fs_nvs.nvs_gc: Moving 164, len 35
    [00:08:28.441,650] <dbg> fs_nvs.nvs_gc: Moving 165, len 35
    [00:08:28.443,084] <dbg> fs_nvs.nvs_gc: Moving 166, len 35
    [00:08:28.444,458] <dbg> fs_nvs.nvs_gc: Moving 167, len 35
    [00:08:28.445,953] <dbg> fs_nvs.nvs_gc: Moving 168, len 35
    [00:08:28.447,479] <dbg> fs_nvs.nvs_gc: Moving 169, len 35
    [00:08:28.448,944] <dbg> fs_nvs.nvs_gc: Moving 170, len 35
    [00:08:28.450,347] <dbg> fs_nvs.nvs_gc: Moving 171, len 35
    [00:08:28.451,873] <dbg> fs_nvs.nvs_gc: Moving 172, len 35
    [00:08:28.453,399] <dbg> fs_nvs.nvs_gc: Moving 173, len 35
    [00:08:28.454,895] <dbg> fs_nvs.nvs_gc: Moving 174, len 35
    [00:08:28.456,329] <dbg> fs_nvs.nvs_gc: Moving 175, len 35
    [00:08:28.457,885] <dbg> fs_nvs.nvs_gc: Moving 176, len 35
    [00:08:28.459,442] <dbg> fs_nvs.nvs_gc: Moving 177, len 35
    [00:08:28.460,937] <dbg> fs_nvs.nvs_gc: Moving 178, len 35
    [00:08:28.462,402] <dbg> fs_nvs.nvs_gc: Moving 179, len 35
    [00:08:28.463,989] <dbg> fs_nvs.nvs_gc: Moving 180, len 35
    [00:08:28.465,576] <dbg> fs_nvs.nvs_gc: Moving 181, len 35
    [00:08:28.467,102] <dbg> fs_nvs.nvs_gc: Moving 182, len 35
    [00:08:28.468,597] <dbg> fs_nvs.nvs_gc: Moving 183, len 35
    [00:08:28.470,214] <dbg> fs_nvs.nvs_gc: Moving 184, len 35
    [00:08:28.471,801] <dbg> fs_nvs.nvs_gc: Moving 185, len 35
    [00:08:28.473,388] <dbg> fs_nvs.nvs_gc: Moving 186, len 35
    [00:08:28.474,914] <dbg> fs_nvs.nvs_gc: Moving 187, len 35
    [00:08:28.475,585] <dbg> fs_nvs.nvs_flash_erase_sector: Erasing flash at fc000, len 4096

  • Oh hahaha whoops I know why your getting errors in that sample. Change the for loop from 1000 to 10. Your flash sectors are being overflowed. It's writing 1000*35 bytes to a storage space of only 8100 bytes. I thought I edited that out for you but I must have .zip'ed the wrong main.c. My apologies.

    Here is the correct one I meant to upload. You don't need any of the other files as they have no effect on the NVS tester, you can just delete the other one and use this. They were just test stuff.

    2656.nvs_storage_checker.zip

    Like I said, I edited my partitions to allow this but your default ones will not be equiped for this. Default partition size allows for 6 flash sectors max. I use 103.

    Maybe take a look at the prj.conf and cmakelist, might be something in there but I'm glad that we at least have your NVS system working. :)

Related