-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Size is not correctly calculated and results in a bootloop for big programs #10678
Comments
Unfortunately there is nothing we can do about PlatformIO. It's an external tool with it's own support and tooling |
We are looking into this issue on our side too, but that will not translate to fix on PlatformIO side |
Yep, I understand, but they refused to fix it on their side to avoid discrepancy between this framework and their variant of it, so if this ends up being solved here I'll go bug them again :-) |
csv Name, Type, SubType, Offset, Sizenvs, data, nvs, 0x9000, 0x6000 bash ini ini python def before_upload(source, target, env):
env.AddPreAction("upload", before_upload) |
@yuvashrikarunakaran if you could please format the code using the code block ( Also, your solution checks upon upload, and mine checks after build — the latter might be crucial if you are building in CI and then distributing the firmware via OTA (which is what my project is doing). For only local work, either solution is equally good |
If a fix is made for ArduinoIDE i will add to pioarduino |
Board
ESP32 boards (presumably any)
Device Description
Tested on a devkitC from Taobao and on a bare module from Espressif
Hardware Configuration
Doesn't matter
Version
latest master (checkout manually)
IDE Name
PlatformIO + VSCode
Operating System
Windows 10
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
921600
Description
I have a partitions.csv with two 0x180000-byte partitions.
When building, the build pipeline finds the partition size correctly (1,572,864 bytes) and claims that the program fits:
However the actual file created is 1,575,056 bytes (file size, not size on disk) — that is, 0x180890 bytes, which is much bigger than the 0x180000 byte partition. And so esptool tries to flash exactly that, which leads to the firmware crashing on startup:
Which is kind of expected, since the flash was written correctly, but is being mapped into the memory according to the partition table — so part of the program ends up being not available, the code jumps somewhere into the uninitialized RAM, and things explodify.
Why does it think the program is smaller than it actually is? Could this be a Windows-specific issue? (I don't have a Linux or Mac machine to test)
I presumed it was a platformio-specific issue, but they seem to be following this repo closely, so it is occurring here too.
Checking in at the ESP32 forums, it seems that the
size
tool for checking the ELF program size should not be used, as it doesn't include the ESP app header which is added intofirmware.bin
which is actually used for flashing.Sketch
https://github.com/vladkorotnev/plasma-clock/tree/9e8c9c064f9b426d3d3e29dfb94840891712d719 — enable feature flags enough to bring the flash usage to 99.5%+, then try to flash it into the memory
Debug Message
Other Steps to Reproduce
Using this script between build and flash I can catch such conditions and stop the build, but this is a hacky workaround basically: https://github.com/vladkorotnev/plasma-clock/blob/develop/helper/check-size-correctly.py
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: