-
-
Notifications
You must be signed in to change notification settings - Fork 686
Boot loop if platform == espressif32 if using default_16MB.csv partition table #788
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
Comments
I have exactly the same issue. This was also the case in 4.1.0.
|
First of all, let's verify that this behavior has nothing to do with the framework itself? Any chance you could try Arduino IDE with your custom partition table? |
But you can not use |
Could you please simply back up the original |
I could do that, but none of them works. I tested with the following csv files:
My custom csv looks like this # Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x280000,
app1, app, ota_1, 0x290000,0x280000,
spiffs, data, spiffs, 0x510000,0xAF0000, None of them works. But if i comment out entierly the |
I was hoping you could try your custom partition in Arduino IDE. |
Oh sorry. i will try that. |
Nah, iam struggeling with this stupid partitioning in Arduino IDE. I replaced my custom csv with the default csv, put new sizes into the boards.txt and my flash is still 1.5mb. god... |
oh fine, it works in Arduino IDE. Sketch i tried with on both PIO and Arduino IDE: #include "FS.h"
#include <LittleFS.h>
long lastInfoCheckMS = 0;
boolean hasPSRAM = false;
boolean fsMounted = false;
void printInfos() {
Serial.println("\n********* INFOS *********");
if( fsMounted ){
Serial.printf("FS - USED: %d - byte\n", LittleFS.usedBytes());
Serial.printf("FS - TOTAL: %d - byte\n", LittleFS.totalBytes());
}else{
Serial.println("File system is not mounted. No info");
}
if ( hasPSRAM ) {
Serial.printf("ESP - PS RAM: %d - byte\n", ESP.getPsramSize());
Serial.printf("ESP - FREE PS RAM: %d - byte\n", ESP.getFreePsram());
}else{
Serial.println("There is no external ram information.");
}
Serial.printf("ESP - RAM: %d - byte\n", ESP.getHeapSize());
Serial.printf("ESP - FREE RAM: %d - byte\n", ESP.getFreeHeap() );
}
void periodicInfoPrint(){
if ( millis() - lastInfoCheckMS >= 10000 ) {
lastInfoCheckMS = millis();
printInfos();
}
}
void littleFsBegin() {
if (!LittleFS.begin()) {
Serial.println("FS - Failed to mount the filesystem");
fsMounted = false;
} else {
Serial.println("FS - Filesystem mounted");
fsMounted = true;
}
}
void checkPS_RAM() {
char * psRam = (char *) ps_malloc (500 * sizeof (char));
if (psRam == NULL) {
Serial.println ("PS_RAM: ERROR");
hasPSRAM = false;
} else {
Serial.println ("PS_RAM: OK");
free(psRam);
hasPSRAM = true;
}
}
void setup() {
Serial.begin(115200);
vTaskDelay(1000);
Serial.println("Hello from ARDUINO IDE!");
checkPS_RAM();
littleFsBegin();
printInfos();
}
void loop() {
periodicInfoPrint();
} Serial output on Arduino IDE: ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_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:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0
Hello from ARDUINO IDE!
PS_RAM: OK
FS - Filesystem mounted
********* INFOS *********
FS - USED BYTES: 1617920
FS - TOTAL BYTES: 11468800
ESP - HEAP SIZE: 364592
ESP - PS RAM SIZE: 4192139
ESP - FREE PS RAM SIZE: 4192139
********* INFOS *********
FS - USED BYTES: 1617920
FS - TOTAL BYTES: 11468800
ESP - HEAP SIZE: 364592
ESP - PS RAM SIZE: 4192139
ESP - FREE PS RAM SIZE: 4192139 Custom Partition table used:
Default large spiffs partition table:
|
@zekageri could you please compile your sketch in Arduino IDE in verbose mode and upload the log to https://pastebin.com ? |
Yes, in a minute. |
Verbose sketch upload with compile logs: Verbose sketch upload with compile logs: |
I see you're using 2.0.3-RC in Arduino IDE, while PlatformIO uses the latest stable 2.0.2. Anyway, could you please also upload to https://pastebin.com/ two verbose logs from PlatformIO? |
Yes. I don't know how, i assume i can set -DCORE_DEBUG_LEVEL to 4 or 5? |
nvm i found it. pio run --verbose |
PIO Compile PIO Upload |
Ah sorry it is in the Project tasks. But PIO verbose build does not fit into my terminal. It is tooo long. |
Please upload your app in verbose mode as well. To redirect the output, just open the IDE terminal and run the following command: pio run -e esp-wrover-kit -t upload --verbose > upload-log.txt |
okay, thanks |
Try to attach it to your comment on Github |
https://drive.google.com/drive/folders/1FdsFFuFN_0Q7Qb00IG0dGz6FMi1nHqpX?usp=sharing is it ok on google drive? |
OK, thanks. First of all, I see that you're still using different configurations. In PlatformIO you use 4MB and the |
What do you mean by 4mb? This is my pio thingy Flash mode is qio, yes, but i configured qio on arduino ide too. In fact i have tried with dio and qio too. I have tried with every possible scenario. 40mhz flash, qio/dio, slower uploads, different boards, pio built in little fs compiler and extra scripts one, with empty data folder. In my PIO ini there is 16mb flash setup. I can adjust flash mode to dio however |
Can it be the problem? No matter what board i define, and what flash_size i set up, when compile, the HARDWARE will always be 4mb flash.
COMPILE: Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.2.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)PACKAGES:
- framework-arduinoespressif32 3.20002.0 (2.0.2)
- tool-esptoolpy 1.30300.0 (3.3.0)
- toolchain-xtensa-esp32 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies... |
Result of (esp32dev board) With the following PIO INI: ;[env:esp-wrover-kit]
[env:arduino-esp32]
platform = espressif32
board = esp32dev ;esp-wrover-kit
framework = arduino
board_build.filesystem = littlefs
board_build.f_cpu = 240000000L
upload_port = COM8
upload_speed = 921600
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
board_build.flash_size = 16MB
board_build.flash_mode = dio
board_build.partitions = large_spiffs_16MB.csv ;./hsh_Partition.csv
board_build.f_flash = 80000000L
build_flags = -DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-mfix-esp32-psram-cache-strategy=memw
-DCORE_DEBUG_LEVEL=5
;-D CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
;-D CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
;extra_scripts = mklittlefs/replace_fs.py Result of (esp-wrover-kit board) With the same PIO INI which is |
I can see that on PIO the HARDWARE is always this: |
Actually, it's an error in your project configuration, as it should be |
With this configuration:
The hardware is still the same: |
But the boot loop is gone. |
So, does it work as expected now? |
Yes, it looks like the problem was that it should be Closing this. |
I had a particular project which failed with this bootloop when switched to newest 2.0.3 framework. I've been doing cleaning, restarting, whatever and still had bootloop. Switched to 2.0.2 and it started working. With 2.0.3 using these lines the bootloop is gone, so the fix is indeed confirmed!
|
I upgraded to
Espressif 4.2.0
using PIO.My chip is ESP32_WROVER_E ( 16 mb flash and 8mb external ram )
My sketch worked fine with custom partition table before. I used this platform and package:
Now with this INI:
Now my ESP bootloops with the following message:
If i comment out the
board_build.partitions = default_16MB.csv
so the compiler use the default csv file, my board is working fine.I have tried with different flash_mode, flash frequency and board. Tried to erase the flash, upload empty data folder. Deleted .platformio folder. Nothing helps. If i use default_16MB.csv ( or maybe if it is bigger than 4mb?? ) my esp boot loops.
Tested with two ESP32_WROVER-E boards. Both with external ram and 16mb flash size. The upload monitor confirms that these chips has 16mb flash. ( and i know that for sure because i used the exact same sketch and partition before )
Uploading output:
Here is my platform update output:
Minimal example:
Platformio Latest Espressif 4.2.0 .
Created data folder.
Pio Ini:
Main.cpp:
The text was updated successfully, but these errors were encountered: