Page 1 of 1

Saving Space for Frozen Code

Posted: Thu Feb 07, 2019 7:19 am
by bitninja
I have been building the esp8266 version of MicroPython for some time now and have noticed some limitations of how much I can fit before it fails to build. I am at a point now where I have to choose between two important apps and was wondering if I can trim elsewhere to get them both to fit. Is everything else in the Modules folder fair game? Is there anything obviously "extra weight"?

Thanks!

Re: Saving Space for Frozen Code

Posted: Thu Feb 07, 2019 7:24 am
by kevinkk525
I change the irom0 size with the following command (on linux, run on an unmodified file, you can edit the file manually though):

sed -i 's/irom0_0_seg : org = 0x40209000, len = 0x8f000/irom0_0_seg : org = 0x40209000, len = 0xe7000/' ~/micropython/ports/esp8266/esp8266.ld

For manually editing:
search for the string: irom0_0_seg : org = 0x40209000, len = 0x8f000
and replace it with: irom0_0_seg : org = 0x40209000, len = 0xe7000

This gives me plenty of flash size for frozen modules.

Re: Saving Space for Frozen Code

Posted: Thu Feb 07, 2019 6:17 pm
by bitninja
Thanks for that!

I will give a try when I get home.

Tell me, does this take space away from the integrated flash file system?

Re: Saving Space for Frozen Code

Posted: Thu Feb 07, 2019 7:49 pm
by kevinkk525
It probably does.