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

esp8266 chip- Framework taking 91% of max firmware size on 64bit systems a jump from about 78% on 32 bit #254

Open
tichaonax opened this issue Aug 25, 2021 · 9 comments

Comments

@tichaonax
Copy link

I am experiencing a new problem possibly due to data types for long and pointers sizes between 32bit and 64bit systems.

This is resulting in a bigger firmware size on 64bit systems leaving no room for the actual project particularly on esp8266 unit

I do not know if there is any optimization that can be done but I am having to stop using the esp8266 and move to esp32 chip which has more memory to circumvent this issue.

Please take a look at https://docs.oracle.com/cd/E19205-01/819-5265/bjami/index.html

to see data size comparison, I think the long and pointer are killing us.

@proddy
Copy link

proddy commented Aug 25, 2021

compiling for Arduino (whether it's the ESP8266 or ESP32) is always 32-bit, using gcc. I think the problem is the size of SPIFFS and not the program size since you're trying to serialize 8 byte values into JSON (your time_t's). I also see you're using int's which uses 3 bytes. It's better to use uint8_t for single unsigned bytes and uint32_t for longs.

To make it fit you could adjust the partitions (Rick shows how in the README) to allocate more of the flash space.

I would also strongly recommend to switch to ESP32's if you can. The ESP8266 is about 8 years old now and starting to age, and the ESP32's have so much headroom for the same price. The web UI will be so much responsive too.

@tichaonax
Copy link
Author

Will give it a try thanks!

@tichaonax
Copy link
Author

It did not help much. But something happened the framework alone used to compile to about 78% a month ago now its at 91%. The only change is library updates.

@tichaonax
Copy link
Author

I disabled PROGMEM and now it fits, not sure what other problems I will run into.

@proddy
Copy link

proddy commented Aug 28, 2021

Ok so if I get this right, a few weeks ago building on ESP8266 worked fine but now the image size is too large? esp8266-react hasn't been modified so it's most likely the external libraries, including the latest arduino core. If that's the case you can modify the platformio.ini to go back and use the previous versions, e.g. platform = [email protected] will use the older arduino core 2.7.4. See if that makes a difference to the image size.

@rjwats
Copy link
Owner

rjwats commented Aug 28, 2021 via email

@proddy
Copy link

proddy commented Aug 28, 2021

Do you still target 8266 proddy?

Nope, I'm exclusive ESP32 now. Made the switch a year ago. I was spending too much time tweaking my code to make it fit into the ESP8266's 4MB ram. And an ESP32 is only like 4 euros now. https://github.com/emsesp/EMS-ESP32/tree/dev

@tichaonax
Copy link
Author

It used to be 78% so something did happen.

@tichaonax
Copy link
Author

In June l had a branch that compiled to 78%. Now the same branch compiles to 91% looks there might have been some changes in Arduino libraries or something

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

3 participants