How to erase flash memory from terminal

SombraRPK
Posts: 18
Joined: Wed Jul 04, 2018 2:37 am

How to erase flash memory from terminal

Postby SombraRPK » Fri Jan 18, 2019 1:28 am

Hi, guys! I'm having a big trouble in my board. When I upload my program it just restart over and over. I'm working with Arduino IDE and Mac OS Mojave. When I open my serial port it shows:

[Codebox]
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11572
entry 0x40078a5c
assertion "false && "item should have been present in cache"" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_item_hash_list.cpp", line 85, function: void nvs::HashList::erase(size_t)
abort() was called at PC 0x4015a46b on core 0

Backtrace: 0x4008dcb4:0x3ffd12f0 0x4008de8f:0x3ffd1310 0x4015a46b:0x3ffd1330 0x401650f4:0x3ffd1360 0x401657ae:0x3ffd1380 0x40165add:0x3ffd13d0 0x40164ba0:0x3ffd1430 0x401646ca:0x3ffd1480 0x40164763:0x3ffd14a0 0x401647ae:0x3ffd14c0 0x400dd271:0x3ffd14e0 0x400d2fd0:0x3ffd1500 0x4015cdf3:0x3ffd1530

Rebooting...[/Codebox]

I was reading on the web that this issue could be solved by erasing the flash memory of the board before uploading the firmware. So, what do you guys recommend me? I'm stucked :(. Thanks!

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Re: How to erase flash memory from terminal

Postby mikemoy » Fri Jan 18, 2019 2:02 pm

Well, I dont use a mac. There is a Flash Download Tool you can get from Espressif here:
https://www.espressif.com/en/products/h ... /resources

But its only for a PC. Another option is you install the toolchain following these directions:
https://espressif-docs.readthedocs-host ... index.html

If going this route, when in your project folder you can open the msys32 terminal and type
make erase_flash (dont forget to run make menuconfig first to have the correct com port set).

I also dont use Arduino-IDF, but in ESP-IDF you can add this line in your app_main(void), to wipe it.
ESP_ERROR_CHECK(nvs_flash_erase());

I'm not saying these are the only ways, just ones that I know about.

SuperTechSaiyan3
Posts: 14
Joined: Tue Jan 01, 2019 6:59 pm

Re: How to erase flash memory from terminal

Postby SuperTechSaiyan3 » Sun Jan 20, 2019 12:10 am

on linux the only way I found is to install the esp idf and run "make erase_flash" I suggest doing the same for your mac

SombraRPK
Posts: 18
Joined: Wed Jul 04, 2018 2:37 am

Re: How to erase flash memory from terminal

Postby SombraRPK » Mon Jan 21, 2019 7:29 pm

Thank you all, guys! I could solve my problem by changing the defalut.csv values on my board and uploading the sketch again, for if you have this issue sometime.

Thanks again!

wankhede.ajinkya
Posts: 1
Joined: Mon Apr 08, 2019 11:00 am

Re: How to erase flash memory from terminal

Postby wankhede.ajinkya » Mon Apr 08, 2019 11:03 am

Hi, i am not be able to get changes in default.csv, can you post them.
thanks in advanced.
SombraRPK wrote:
Mon Jan 21, 2019 7:29 pm
Thank you all, guys! I could solve my problem by changing the defalut.csv values on my board and uploading the sketch again, for if you have this issue sometime.

Thanks again!

saracms
Posts: 1
Joined: Mon Feb 11, 2019 6:50 pm

Re: How to erase flash memory from terminal

Postby saracms » Tue Apr 07, 2020 6:40 pm

I got erase flash by using the command make erase from .../ports/esp32 after installing micropython. Installing Micropython is easy, I think it's worth!

Who is online

Users browsing this forum: No registered users and 58 guests