-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Sketch too big, but identical sources are compiling and flashing under esp-idf environment #339
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
bluetooth and wifi use a whole lot of flash and in Arduino's partition config there are 2 sketch partitions 1MB each. I guess you went over that, which means that it will step into the next partition. I've seen report before and I have hit the limit myself. Taking more space for sketch means that it will be twice that much less available for SPIFFS when it comes. I might try to 1.25MB and have 0.5MB less SPIFFS |
I have the same problem when using BLE and WiFi. Is tweaking the partition size something simple to do which I can try locally? |
Here is the partition definition: https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv |
I can't work out the partition definitions! Changing app0 to 2M - "app0, app, ota_0, 0x10000, 2M" I still get the Sketch to big error and "Sketch uses 1068755 bytes (102%) of program storage space. Maximum is 1044464 bytes.". Could you show me an example default.csv for if I don't use OTA or SPIFFS and just want a big enough 1 sketch partition? |
stupidity on my end... you need to change the maximum size in the board definitions also |
Ok yes changing that too does get the compile working again. Thanks! |
Long term is to increase the partition size :) BT stack is huge |
Its a bit of a pain to have to manually fiddle about updating system files so I hope you mean increase the default? That would be good, even the small change you mention above - 1.25MB and have 0.5MB less SPIFFS - would be enough to get this sketch working. |
Yes i will increase it :) |
How to increase the partition size? I have tried changing the csv file but it didn't work. Please give me an example. |
what did you change it to? what was the error that you got? |
how did you change those numbers? please help |
@shahabmusic @Nakul93 Small tutorial: Change partition size |
I followed the tutorial and chanted the default.csv and board. txt. Since then none of my sketches. I tried to revert back all the changes to the original. However I no longer can run any sketch. so I stuck. rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) |
|
I am using Arduino. I have esp32_core_board_v2 that has a wroom-32 module soldered on it. so I assume it has 4MB flash.
I also changed these two lines of board.txt:
I also tried to erase flash using: |
Did you loose the format of the CSV file when you copied it or does it look like above? It needs newline at the end of each entry, or all would be a comment and no partition created.
make sure in your default.csv there are newline (CR or CR/NL) at the end of each entry. |
I made a copy of the csv file before editing it. I just copied it back to partitions folder so no I did not loose the format. |
So I just downloaded boards.txt and default.csv from git repository and replaced the old files and I am still having issue. However I could successfully upload an example using esp-idf. |
Not sure about your problem. I tested all 3 possibilities to change partition sizes and they worked for me. Maybe you need to reinstall the complete arduino-esp32 to get back to normal. |
I managed to change it back to default by reinstalling the arduino-rsp32. However it stops working as soon as I make even a minor change in default.csv |
@shahabmusic can you post here an example of a changed default.csv that doesn't work. |
I have had success using the following default.csv based off of minimal.csv:
and boards.txt to have modified values of Wasn't sure if we can omit the otadata or spiffs partitions altogether if we aren't directly using those features. It appears that some of the Personally I wouldn't partition for ota updates as default, peripheral libraries add a lot to the compiled size, at least would be nice to have more dynamic partitioning. |
So I finally managed to fix it. Thank you guys for helping me. |
Wow, some spare time so I had a play with ESP32's this afternoon to see how things have progressed ... and still, after almost a year, using BLE and Wifi together fail with Sketch too big and I have to fiddle about changing with the partition sizes. Surely BLE and Wifi is the Big Thing for the ESP32 so this should just work out-of-the-box? |
Just digging into ESP 32 and my use case demands both BT and Wi-Fi (of course!). Has any progress been made toward fitting both stacks without resizing partitions? I suppose I could go through the Bluetooth stack and purge everything I don't need from it, but that's a lot of work! Perhaps there's a lighter Bluetooth implementation out there that just dumps raw signal data? I'd be ok with that for my project. |
Same here, we have developed a product on ESP32, we have put over a year of development, and yesterday, the last part has been added. |
Ok, so i have solved the problem in some way, hope this help others. To get more space for your sketch, yo have to go: C:\Users[YOUR_USER_NAME]\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\tools\partitions [YOUR_USER_NAME] - is your home catalog name You should make backup of orginal defaiult.csv , as you see i have zipped it. That is not the end. As you may see in the partition table You have sizez in hex, so in my case it is 1E0000. C:\Users[YOUR_USER_NAME]\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\ You need to find Your board, and change the for 1E0000 you will get 1966080 So for my board dOIT DEVKIT V1 it should look like this: esp32doit-devkit-v1.upload.maximum_size=1966080 save and start arduino, compile the skect and you see that you have plenty of space now :) if You publish the code on Github, or share it to someone remember to tell how to solve that stupid size problem, and even provide the config info for the boards file and partition sizes. That will help a lot. Hope this helps |
The easiest way to increase size of the sketch is within Arduino IDE go to "Tools->Partition Scheme" and then instead of "Default" select either "Minimal SPIFFS (Large APPS with OTA)" or "No OTA (Large APP)" In this way you can have sketch size up to 1966080 bytes or 2097152 bytes respectively (the sizes actually depend on the board you use). If this is not enough, do what Netoperz recommended. Of course, doing so you sacrifice size of SPIFFS or OTA. For the actual sizes of sketches, SPIFFS, etc. if you select those Schemes, look in the csv files mentioned by Netoperz. Disclaimer: I tested it on vMicro within Visual Studio (which has similar feature), not in Arduino IDE, but I assume it must work the same way there. |
Just a note for anyone else who is looking for do this on platformio, you can change the partition with a simple line in platformio.ini: To use Minimal SPIFFS Huge app: Complete list of pre-defined partition tables can be found at: |
I am writing a program which uses following capabilities of the ESP32: Blufi protocol, reception of BLE advertisings, HTTPS post (WiFiClientSecure), and WiFi.
I have written such program using Eclipse/esp-idf and it is compiling/flashing fine.
I wanted to try the Arduino way, and I am stuck with size of sketch too big error.
The functionalities are very identical, I don't include unused #includes.
As concern Blufi, I have written a lib for ESP32-Arduino from the Blufi example found in esp-idf.
How could I workaround this error and make my sketch flashable?
The text was updated successfully, but these errors were encountered: