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 'save()' issue #773

Closed
olliephillips opened this issue Dec 29, 2015 · 9 comments
Closed

ESP8266 'save()' issue #773

olliephillips opened this issue Dec 29, 2015 · 9 comments

Comments

@olliephillips
Copy link

olliephillips commented Dec 29, 2015

Build: 1v84.tve_master_c8c854e

Originally reported in Gitter, there is an error which occurs on save(). I have the above build.

When connected over serial, the error message gets chops so there is not much to help, but when connected via IDE and wifi, concole gives me the following error information.

Writing..................
ERROR: Too big to save to flash (15805 vs 12284 bytes)

I had an earlier build to hand (1v84.tve_master_9bf51d3) on another ESP8266 and this issue does not occur with the same program/sketch.

Erasing Flash.....
Writing............
Compressed 12276 bytes to 9774
@gfwilliams
Copy link
Member

gfwilliams commented Jan 4, 2016

@tve looks like the amount of flash pages dedicated to saving needs to be increased now that the RAM dedicated to variables has gone up. Probablye just something in BOARD.py?

I guess moving to 16 byte vars from 12 has meant that some code takes more space. Currently it's only RLE compression, which isn't ideal.

@tve
Copy link
Contributor

tve commented Jan 4, 2016

yup, which means moving some other stuff around and reducing the space available for code.

@gfwilliams
Copy link
Member

gfwilliams commented Jan 4, 2016

There is the LZ4_COMPRESS branch, which will do a much better job of compression - it does however use more flash for the compression algorithm. I was really hoping to find a very small compressor, but I haven't seen anything... Everyone seems more obsessed with speed than code size :)

@tve
Copy link
Contributor

tve commented Jan 4, 2016

@gfwilliams
Copy link
Member

gfwilliams commented Jan 5, 2016

Yes, that looks good... I'd seen that before, I'm not sure why I didn't use it in the branch :(

@gfwilliams
Copy link
Member

gfwilliams commented Jan 5, 2016

Ok, just added it (under LZ4_COMPRESS). It adds 1.5kB to the flash on ARM compiles. Do you reckon it's worth including it by default?

edit: Just tested with require("ws");require("MQTT");require("ESP8266WiFi_0v25"); to give it something to chew on, and RLE uses 69153 bytes on Pico (too much) but Heatshrink gets it into 47812.

@tve
Copy link
Contributor

tve commented Jan 5, 2016

sounds like it pays for itself! :-)

@gfwilliams
Copy link
Member

gfwilliams commented Jan 5, 2016

Ok, just added - SAVE_ON_FLASH disables it though, as if you have only a small amount of RAM, the extra 1.5kB flash used to save 500 bytes isn't worth it :)

Also it has a neat hack now that will go back, delete the command history and try again if it runs out of space in Flash.

@olliephillips
Copy link
Author

olliephillips commented Jan 5, 2016

Hi Guys, thanks for attention on this issue, I'm reading this as circa 30% better compression, so code in my original post (15805) would fit in the 12284 space with no tweaking to flash pages or impact on code space as mentioned, when @tve merges from upsteam ? Or is there more to it?

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