How to set ware levelling Safety mode in Arduino ESP add on

drmpf321
Posts: 9
Joined: Thu Dec 10, 2015 10:33 pm

How to set ware levelling Safety mode in Arduino ESP add on

Postby drmpf321 » Thu Oct 24, 2019 8:59 am

I found the
#if CONFIG_WL_SECTOR_MODE == 1
in esp-idf wear_levelling.cpp

but a search of ESP 1.0.2 package for Arduino does not include this define.

How can I set Safety mode for ware levelling in the Arduino ESP32 add on?

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

Re: How to set ware levelling Safety mode in Arduino ESP add on

Postby idahowalker » Thu Oct 24, 2019 1:57 pm

I guess you are refering to the https://docs.espressif.com/projects/esp ... lling.html Wear Leveling API? The examples are not helping?

drmpf321
Posts: 9
Joined: Thu Dec 10, 2015 10:33 pm

Re: How to set ware levelling Safety mode in Arduino ESP add on

Postby drmpf321 » Thu Oct 24, 2019 10:42 pm

I am using the Arduino IDE ESP32 add on V1.0.2.
A search of the code supplied with that package does not find CONFIG_WL_SECTOR_MODE which sets the performance/safe leveling when the sector size is 512, so I cannot change the from the default Performance setting in this case, the SD case.

I dug a bit deeper into esp-idf/components/wear_levelling/wear_levelling.cpp
and found that CONFIG_WL_SECTOR_SIZE sets the wl_flash object

I found
#define CONFIG_WL_SECTOR_SIZE 4096
in the Arduino ESP32 package in sdkconfig.h

so looking at the wear_levelling.cpp code is seems that the wl_flash object is WL_Flash();
as opposed to WL_Ext_Safe(); or WL_Ext_Perf(); when the CONFIG_WL_SECTOR_SIZE is 512.

So does that mean for CONFIG_WL_SECTOR_SIZE 4096 , i.e. the onboard flash IC, that the wear leveling is ALWAYS safe?

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

Re: How to set ware levelling Safety mode in Arduino ESP add on

Postby idahowalker » Sun Oct 27, 2019 3:10 pm

After a bit of searching, wear leveling is part of the ESP32 API's.

lbernstone
Posts: 637
Joined: Mon Jul 22, 2019 3:20 pm

Re: How to set ware levelling Safety mode in Arduino ESP add on

Postby lbernstone » Sun Oct 27, 2019 3:33 pm

Safety mode will be introduced in ESP-IDF v4.0. Arduino-esp32 v1.0.4 uses IDF v3.2. When v4.0 is released and stable, arduino will update to that upstream version. However, using an advanced feature like this will always require you to compile your own libraries. There are no guarantees that all the arduino libraries will be compatible with safety mode (I think FFat should work).
https://github.com/espressif/arduino-es ... mponent.md
https://github.com/espressif/esp32-ardu ... ster/tools

Who is online

Users browsing this forum: Bing [Bot] and 59 guests