Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#26423] Issue with PSRAM #2451

Closed
luc-github opened this issue Sep 21, 2018 · 4 comments
Closed

[TW#26423] Issue with PSRAM #2451

luc-github opened this issue Sep 21, 2018 · 4 comments
Assignees

Comments

@luc-github
Copy link
Contributor

luc-github commented Sep 21, 2018

Hi I post here instead of arduino-esp32 by request of @me-no-dev as it is PSRAM issue, and the idf core is the latest
When uploading file using sample code and enabling PSRAM the system crash, and no issue if PSRAM is disabled.
FYR: with previous IDF upload crashed or was corrupted.

I use TTGO ESP32 4MB PSRAM TF CARD 3D ANTENNA WiFi Module Bluetooth ESP32-WROVER
the crash report:

Connecting to NETGEAR_2GEXT_OFFICE2
...
Connected! IP address: 192.168.1.59
HTTP server started
handleFileUpload Name: /boards.txt
abort() was called at PC 0x400e41b4 on core 1

Backtrace: 0x40091b98:0x3ffb1630 0x40091d6d:0x3ffb1650 0x400e41b4:0x3ffb1670 0x400de9fc:0x3ffb1690 0x40081c4e:0x3ffb16b0 0x400decc5:0x3ffb1700 0x400e4fdd:0x3ffb1720 0x400e9235:0x3ffb1750 0x400e6e09:0x3ffb1780 0x400e81b9:0x3ffb17c0 0x400e509d:0x3ffb1830 0x400e5afe:0x3ffb1850 0x400e4d82:0x3ffb1880 0x400dc316:0x3ffb18a0 0x4000bd83:0x3ffb18c0 0x4000117d:0x3ffb18e0 0x40058af1:0x3ffb1900 0x400ddfcc:0x3ffb1930 0x400de015:0x3ffb1970 0x400d78e5:0x3ffb1990 0x4014f639:0x3ffb19b0 0x400d2085:0x3ffb19d0 0x4014f419:0x3ffb1ab0 0x400d6f2f:0x3ffb1ad0 0x400d6f5e:0x3ffb1af0 0x400d428e:0x3ffb1b20 0x400d4ee5:0x3ffb1b50 0x400d5e11:0x3ffb1d30 0x400d7132:0x3ffb1f40 0x400d2d3e:0x3ffb1f90 0x40130cae:0x3ffb1fb0 0x4008dbe1:0x3ffb1fd0

Rebooting...
ets Jun  8 2016 00:22:57

Here the decoded stack:

Decoding 33 results
0x400e41b4: esp_ota_get_running_partition at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/app_update/esp_ota_ops.c line 518
0x40091b98: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 660
0x40091d6d: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 660
0x400e41b4: esp_ota_get_running_partition at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/app_update/esp_ota_ops.c line 518
0x400de9fc: is_safe_write_address at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spi_flash/flash_ops.c line 116
0x40081c4e: spi_flash_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spi_flash/flash_ops.c line 314
0x400decc5: esp_partition_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spi_flash/partition.c line 273
0x400e4fdd: spiffs_api_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/spiffs_api.c line 47
0x400e9235: spiffs_phys_wr at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/spiffs/src/spiffs_cache.c line 215
0x400e6e09: spiffs_page_allocate_data at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/spiffs/src/spiffs_nucleus.c line 1164
0x400e81b9: spiffs_object_modify at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/spiffs/src/spiffs_nucleus.c line 1564
0x400e509d: spiffs_hydro_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/spiffs/src/spiffs_hydrogen.c line 964
0x400e5afe: SPIFFS_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/spiffs/src/spiffs_hydrogen.c line 964
0x400e4d82: vfs_spiffs_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/spiffs/esp_spiffs.c line 326
0x400dc316: esp_vfs_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/vfs/vfs.c line 970 (discriminator 1)
0x400ddfcc: _fwrite_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fwrite.c line 170
0x400de015: fwrite at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fwrite.c line 211
0x400d78e5: VFSFileImpl::write(unsigned char const*, unsigned int) at c:\users\luc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits/shared_ptr_base.h line 127 (discriminator 1)
0x4014f639: fs::File::write(unsigned char const*, unsigned int) at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\FS\src/FS.cpp line 258
0x400d2085: handleFileUpload() at C:\Users\luc\Desktop\FSBrowser\SimpleUpl/SimpleUpl.ino line 46
0x4014f419: std::_Function_handler ::_M_invoke(std::_Any_data const&) at c:\users\luc\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 1871
0x400d6f2f: std::function ::operator()() const at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/WebServer.cpp line 240
0x400d6f5e: FunctionRequestHandler::upload(WebServer&, String, HTTPUpload&) at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/WebServer.cpp line 240
0x400d428e: WebServer::_uploadWriteByte(unsigned char) at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/Parsing.cpp line 355
0x400d4ee5: WebServer::_parseForm(WiFiClient&, String, unsigned int) at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/Parsing.cpp line 485
0x400d5e11: WebServer::_parseRequest(WiFiClient&) at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/Parsing.cpp line 222 (discriminator 1)
0x400d7132: WebServer::handleClient() at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/WebServer.cpp line 240
0x400d2d3e: loop() at C:\Users\luc\Desktop\FSBrowser\SimpleUpl/SimpleUpl.ino line 236
0x40130cae: loopTask(void*) at C:\Users\luc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\cores\esp32/main.cpp line 17 (discriminator 1)
0x4008dbe1: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 353 (discriminator 1)

here the MCVE:
SimpleUpl.zip
Per @me-no-dev request it include a checksum check to verify Upload

Here the file I use (it must be over 200K to be sure to reproduce issue)
boards.txt

@luc-github luc-github changed the title PSRAM Issue with PSRAM Sep 21, 2018
@luc-github luc-github reopened this Sep 21, 2018
@Alvin1Zhang Alvin1Zhang changed the title Issue with PSRAM [TW#26423] Issue with PSRAM Sep 21, 2018
@mahavirj mahavirj self-assigned this Sep 29, 2018
@mahavirj
Copy link
Member

@luc-github
We found root cause of the issue (in another project context), fix will appear soon in ESP-IDF.

@luc-github
Copy link
Contributor Author

Excellent thank you ^_^

@luc-github
Copy link
Contributor Author

@mahavirj Anything you need me to test ?

@igrr igrr closed this as completed in b3aff63 Oct 19, 2018
@mahavirj
Copy link
Member

@luc-github Please try with b3aff63 (though this issue is closed, if you observe it in your setup, please feel free to open new one)

igrr pushed a commit that referenced this issue Oct 25, 2018
Routine `spi_flash_cache2phys` sometimes return incorrect value,
resulting in failure in getting currently running ota partition.
This in turn aborts firmware update process.This issue was more
prominent with SPIRAM enabled cases.

Fix ensures proper cache guards during `spi_flash_cache2phys`, and
also for few other similar APIs.

In addition, `esp_ota_get_running_partition` has also been optimized
to save currently running partition for subsequent invocations.

Fixes #2451
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
Routine `spi_flash_cache2phys` sometimes return incorrect value,
resulting in failure in getting currently running ota partition.
This in turn aborts firmware update process.This issue was more
prominent with SPIRAM enabled cases.

Fix ensures proper cache guards during `spi_flash_cache2phys`, and
also for few other similar APIs.

In addition, `esp_ota_get_running_partition` has also been optimized
to save currently running partition for subsequent invocations.

Fixes espressif/esp-idf#2451
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
Routine `spi_flash_cache2phys` sometimes return incorrect value,
resulting in failure in getting currently running ota partition.
This in turn aborts firmware update process.This issue was more
prominent with SPIRAM enabled cases.

Fix ensures proper cache guards during `spi_flash_cache2phys`, and
also for few other similar APIs.

In addition, `esp_ota_get_running_partition` has also been optimized
to save currently running partition for subsequent invocations.

Fixes espressif/esp-idf#2451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants