- opening NVS Write handle Done
- I (1171) NVS: Write Commit Done!
- W (1171) NVS: Show Value-> name: BLE_NVS, key: Test BLE, len: 4
- opening NVS Read handle Done
- Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
- Stack dump detected
- Core 0 register dump:
- MEPC : 0x40058eb6 RA : 0x420fcbd4 SP : 0x3fc9ca20 GP : 0x3fc8e888
- 0x420fcbd4: _vfprintf_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/vfprintf.c:1528
- TP : 0x3fc66e44 T0 : 0x4005890e T1 : 0x10000000 T2 : 0xffffffff
- S0/FP : 0x00000000 S1 : 0x00000004 A0 : 0x00000000 A1 : 0xffffffff
- A2 : 0x00000004 A3 : 0x7f7f7f7f A4 : 0x00000000 A5 : 0x00000004
- A6 : 0xa0000000 A7 : 0x0000000a S2 : 0x00000000 S3 : 0x3fc9a8a4
- S4 : 0x3fc9d058 S5 : 0x00000009 S6 : 0x00000003 S7 : 0x00000003
- S8 : 0x3c114f6c S9 : 0x00000000 S10 : 0x3fc9caf4 S11 : 0xffffffff
- T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
- MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x00000000
- 0x40380001: _vector_table at ??:?
- MHARTID : 0x00000000
- Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'e:\\test-esp32\\c3-example\\my_first_ble5_test\\build\\my_First_BLE5_test.elf', '-ex', 'target remote | "C:\\ESP32\\.espressif\\python_env\\idf4.3_py3.8_env\\Scripts\\python.exe" "C:/ESP32/esp-idf/tools\\..\\tools\\gdb_panic_server.py" --target esp32c3 "C:\\Users\\Xarrin\\AppData\\Local\\Temp\\tmpw_10kq3y"', '-ex', 'bt']' returned non-zero exit status 3221225781.
- b''
- Core 0 register dump:
- MEPC : 0x40058eb6 RA : 0x420fcbd4 SP : 0x3fc9ca20 GP : 0x3fc8e888
- TP : 0x3fc66e44 T0 : 0x4005890e T1 : 0x10000000 T2 : 0xffffffff
- S0/FP : 0x00000000 S1 : 0x00000004 A0 : 0x00000000 A1 : 0xffffffff
- A2 : 0x00000004 A3 : 0x7f7f7f7f A4 : 0x00000000 A5 : 0x00000004
- A6 : 0xa0000000 A7 : 0x0000000a S2 : 0x00000000 S3 : 0x3fc9a8a4
- S4 : 0x3fc9d058 S5 : 0x00000009 S6 : 0x00000003 S7 : 0x00000003
- S8 : 0x3c114f6c S9 : 0x00000000 S10 : 0x3fc9caf4 S11 : 0xffffffff
- T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
- MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x00000000
- MHARTID : 0x00000000
- Stack memory:
- 3fc9ca20: 0x0000001e 0x00000073 0x00000004 0x3c114f6e 0x3c143c08 0x00000000 0x00000000 0x00000000
- 3fc9ca40: 0x00000000 0x00000037 0x00000001 0x00000006 0x00000000 0x3c14161c 0x00000000 0x00000000
- 3fc9ca60: 0x00000000 0x00000000 0xffffffff 0x7fefffff 0x00000000 0x3fe00000 0x00000003 0x3c114e3a
- 3fc9ca80: 0x00000000 0x3fc00000 0x00000000 0x40300000 0x000003ad 0x00000000 0x00000020 0x3fc9cc4c
- 3fc9caa0: 0x00000020 0x0000c080 0x0000c060 0x3fc9cebc 0x3fc9cd40 0x00000000 0x700000bb 0x00000004
- 3fc9cac0: 0x00000000 0x00676f6c 0x00000000 0x40388abe 0x000003c1 0x00000020 0x3fc8fefc 0x420687a4
- 3fc9cae0: 0x3fc9caec 0x00000001 0x00000016 0x3c114f56 0x00000016 0x3c1123b0 0x00000006 0x008c2008
- 3fc9cb00: 0x00000017 0x00000000 0x00000020 0x3fc9cc2c 0x00001a00 0x0000c0a0 0x0000c080 0x4038daa6
- 3fc9cb20: 0x00000000 0x00000020 0x00000000 0x00010003 0xffffffff 0xffffffff 0xffffffff 0x40388abe
- 3fc9cb40: 0x00000411 0x00000020 0x3fc8fefc 0x420687a4 0x3c130608 0xffffffff 0x3fc8fefc 0x40381374
- 3fc9cb60: 0x000005a0 0xffffffff 0xffffffff 0x403811c2 0xffffffff 0xffffffff 0x00000001 0x403837b0
- 3fc9cb80: 0x00000020 0x00000000 0x00000000 0x31383131 0xffffffff 0x00000020 0x00000000 0x4038352e
- 3fc9cba0: 0x00000020 0x3fc9dfc0 0x00000001 0x3fc8fedc 0x00000002 0x3fc9dfc0 0x00000001 0x3fc9cc6c
- 3fc9cbc0: 0x3fc99510 0x00000000 0x3fc9dfc0 0x3fc99510 0x3fc9cc2c 0x00000020 0x00000002 0x420686e4
- 3fc9cbe0: 0x00000001 0x0000007e 0x3c14171c 0x00000000 0x00000004 0x00000004 0x00000002 0x4206a6c4
- 3fc9cc00: 0x3fc99510 0x00000001 0x3fc9dfc0 0x4206b5e4 0x0000049d 0x00000004 0x00000042 0x4206bc00
- 3fc9cc20: 0x3c114e7c 0x3fc99510 0x700000bb 0x008c2008 0x3c1123b0 0x00000000 0x00000020 0x3fc9cdec
- 3fc9cc40: 0x00000000 0x00009300 0x700000bb 0x008c2008 0x00000004 0x00000000 0x00000020 0x3fc9ce30
- 3fc9cc60: 0x00000020 0x00009300 0x000092e0 0x4038daa6 0x00000000 0x00000020 0x3fc8fefc 0xff022105
- 3fc9cc80: 0xbf310ff3 0x74736554 0x454c4220 0x40388abe 0x00000000 0x00000020 0x3fc8fefc 0x420687a4
- 3fc9cca0: 0xffffffff 0xffffffff 0x3fc8fefc 0x40381374 0xffffffff 0xffffffff 0xffffffff 0x403811c2
- 3fc9ccc0: 0x00000020 0x00000020 0x3c114e6c 0x403837b0 0x00000020 0x00000000 0x00000000 0x403836fe
- 3fc9cce0: 0x00000020 0x00000020 0x00000000 0x4038352e 0xffffffff 0xffffffff 0x3fc8fefc 0x3fc8fedc
- 3fc9cd00: 0xffffffff 0xffffffff 0xffffffff 0x40389606 0x00000005 0x00000017 0x3c114e6c 0x3fc9ce30
- 3fc9cd20: 0x3fc9ce30 0x00000020 0x00000015 0x420686e4 0x00000020 0x00000020 0x00000000 0x00000000
- 3fc9cd40: 0x00000016 0x3fc9dec4 0x00000015 0x4206a6c4 0xffffffff 0x00000000 0x00000000 0x4206b5e4
- 3fc9cd60: 0x0000000a 0x3fc9dec4 0x00000015 0x4206ba6c 0x3fc9cdcc 0x00000004 0x3fc8e518 0x3fc9cdec
- 3fc9cd80: 0xff002105 0x3fc9ce94 0x74736554 0x454c4220 0x00000000 0x00000000 0xffffffff 0xffffffff
- 3fc9cda0: 0x00000004 0x3fc9d058 0x3fc9aa38 0x00000000 0x00000000 0x00000000 0x00000000 0x3fc9ce2c
- 3fc9cdc0: 0x00000005 0x00000021 0x3c114e6c 0x3fc9ce30 0x000000ff 0x000000ff 0x3fc9dec4 0x40389606
- 3fc9cde0: 0x0000001f 0x00000000 0x3fc9ab50 0x40387290 0x00000000 0x00000000 0x3fc9ab50 0x403878b6
- 3fc9ce00: 0x00000000 0x00000000 0x3fc9ab50 0x00000000 0x00000005 0x00000021 0x3fc9de54 0x00000000
- ELF file SHA256: 00828b55ea266189
- ELF file SHA256: 00828b55ea266189
- Rebooting...
- �`ESP-ROM:esp32c3-api1-20210207
new problem again and I need your help
I write two function for read and write string data (for save wifi pass and user name and change ble device name with an app).
the write function work good and without problem
but read function make panic
I change my data value type &... many try but without good result
my function are :
- void NVS_Write_String(const char* name, const char* key, const char* stringVal)
- {
- nvs_handle_t nvsHandle;
- esp_err_t retVal;
- retVal = nvs_open(name, NVS_READWRITE, &nvsHandle);
- if(retVal != ESP_OK)
- {
- ESP_LOGE("NVS", "Error (%s) opening NVS handle for Write", esp_err_to_name(retVal));
- }
- else
- {
- printf("opening NVS Write handle Done \r\n");
- retVal = nvs_set_str(nvsHandle, key, stringVal);
- if(retVal != ESP_OK)
- {
- ESP_LOGE("NVS", "Error (%s) Can not write/set value: %s", esp_err_to_name(retVal), stringVal);
- }
- retVal = nvs_commit(nvsHandle);
- if(retVal != ESP_OK)
- {
- ESP_LOGE("NVS", "Error (%s) Can not commit - write", esp_err_to_name(retVal));
- }
- else
- {
- ESP_LOGI("NVS", "Write Commit Done!");
- }
- }
- nvs_close(nvsHandle);
- }
and
- char* NVS_Read_String(const char* name, const char* key)
- {
- nvs_handle_t nvsHandle;
- esp_err_t retVal;
- size_t len;
- char* savedData = NULL;
- len = sizeof(savedData);
- ESP_LOGW("NVS", "Show Value-> name: %s, key: %s, len: %d", name, key, len);
- retVal = nvs_open(name, NVS_READWRITE, &nvsHandle);
- if(retVal != ESP_OK)
- {
- ESP_LOGE("NVS", "Error (%s) opening NVS handle for Write", esp_err_to_name(retVal));
- }
- else
- {
- printf("opening NVS Read handle Done \r\n");
- retVal = nvs_get_str(nvsHandle, key, savedData, &len);
- if(retVal == ESP_OK)
- {
- ESP_LOGW("NVS", "*****(%s) Can read/get value: %s", esp_err_to_name(retVal), savedData);
- }
- else
- ESP_LOGE("NVS", "Error (%s) Can not read/get value: %s", esp_err_to_name(retVal), savedData);
- retVal = nvs_commit(nvsHandle);
- if(retVal != ESP_OK)
- {
- ESP_LOGE("NVS", "Error (%s) Can not commit - read", esp_err_to_name(retVal));
- }
- else
- {
- ESP_LOGI("NVS", "Read Commit Done!");
- }
- }
- nvs_close(nvsHandle);
- return savedData;
- }
- #define BLE_NVS_Data "BLE_NVS"
- #define BLE_Dev_Name "Test BLE"
- #define Wifi_NVS_Data "wifi_nvs"
- #define wifi_ssid "ssid"
- #define wifi_pass "pass"
- void main(void)
- {
- char* temp = NULL;
- NVS_Write_String(BLE_NVS_Data, BLE_Dev_Name, "Helloooooo");
- temp = NVS_Read_String(BLE_NVS_Data, BLE_Dev_Name);
- printf("Read NVS String Value ........... %s \r\n", temp);
- }
.
I want to use these functions
anyone know where that little bug ? I think somewhere of my code is wrong but I dont know
thank you all
regards