Creating larger ROMs
Posted: Sun Jul 07, 2019 8:03 pm
micropython commit 5c34c2ff7f0c44ec9e1d77059162584c6bd99c92
My ESP8266 has 4MB of flash, and though my ROM is just over 1MB in size, my ESP8266 will not boot when I load that ROM.
Here is some build output from a build that will not boot:
And here is some build output from a build that will boot. This build is the same as the build above, but one of my frozen modules was removed to get the size down:
When I first got this irom0_0_seg error over a year ago...
... I updated esp8266.ld per this issue to give me give some more room:
It seems that I can make irom0_0_seg equal any sufficiently large value up to 0x3BFFFF to make the irom0_0_seg error go away. Anything larger than 0x3BFFFF prevents boot.py from being created. Regardless, even when the irom0_0_seg error is gone, the build will not boot.
Given that, I have a few questions:
1.) What is the largest ROM that can be built for an ESP8266 with a 4MB flash using micropython?
2.) Is there some place other than esp8266.ld where memory sizes should be adjusted?
3.) I'm currently storing pictures as frozen modules using data_to_py.py as described here. Is there a better way?
4.) Is there a way to build the ROM so that arbitrary files (like pictures) appear as siblings of boot.py when the ROM is flashed?
If I'm asking the wrong questions, please feel free to volunteer any helpful info.
My ESP8266 has 4MB of flash, and though my ROM is just over 1MB in size, my ESP8266 will not boot when I load that ROM.
Here is some build output from a build that will not boot:
Code: Select all
text data bss dec hex filename
1141216 1084 68544 1210844 1279dc build/firmware.elf
Create build/firmware-combined.bin
esptool.py v2.6
Creating image for ESP8266...
('flash ', 32944)
('padding ', 3920)
('irom0text', 1109396)
('total ', 1146260)
('md5 ', 'ce1d26c571d870e57d7b050dc66829cb')
Code: Select all
text data bss dec hex filename
1022404 1084 68544 1092032 10a9c0 build/firmware.elf
Create build/firmware-combined.bin
esptool.py v2.6
Creating image for ESP8266...
('flash ', 32944)
('padding ', 3920)
('irom0text', 990584)
('total ', 1027448)
('md5 ', 'a52a78532b1989da99b1939371723057')
Code: Select all
xtensa-lx106-elf-ld: build/firmware.elf section `.irom0.text' will not fit in region `irom0_0_seg'
xtensa-lx106-elf-ld: region `irom0_0_seg' overflowed by 190441 bytes
Code: Select all
/* GNU linker script for ESP8266 */
MEMORY
{
dport0_0_seg : org = 0x3ff00000, len = 0x10
dram0_0_seg : org = 0x3ffe8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40209000, len = 0xFFFFF /* https://github.com/micropython/micropython/issues/2700 */
}
/* define common sections and symbols */
INCLUDE esp8266_common.ld
Given that, I have a few questions:
1.) What is the largest ROM that can be built for an ESP8266 with a 4MB flash using micropython?
2.) Is there some place other than esp8266.ld where memory sizes should be adjusted?
3.) I'm currently storing pictures as frozen modules using data_to_py.py as described here. Is there a better way?
4.) Is there a way to build the ROM so that arbitrary files (like pictures) appear as siblings of boot.py when the ROM is flashed?
If I'm asking the wrong questions, please feel free to volunteer any helpful info.