512kb module memory map & LD file question
512kb module memory map & LD file question
Postby sharkx » Mon Jan 11, 2016 3:37 pm
Context : trying to build user1/user2 files for updating an 512 Kb module.
The LD file states that the irom0_0_seg size is 0x2B000 which is 172k. The flash.bin file size is just a bit under 32k. This adds up to 204k, which is considerably less than the 236k described in the documentation.
Seems like this is quite a waste of memory space given the 176k space barely leaves any space for your code.
Can anyone share some info about why this is configured like this or how and what impact would have increasing the irom0_0_seg size to get closer to the 236k limit ?
Thanks in advance.
The LD file states that the irom0_0_seg size is 0x2B000 which is 172k. The flash.bin file size is just a bit under 32k. This adds up to 204k, which is considerably less than the 236k described in the documentation.
Seems like this is quite a waste of memory space given the 176k space barely leaves any space for your code.
Can anyone share some info about why this is configured like this or how and what impact would have increasing the irom0_0_seg size to get closer to the 236k limit ?
Thanks in advance.
Re: 512kb module memory map & LD file question
Postby sharkx » Wed Jan 13, 2016 4:15 pm
Thanks for the reply.
I was planning to try and see what happens... I just hope I don't brick my modules.
Is the bootloader still capable of performing a flash update via the UART0 ? Or it just does the OTA update ?
I was planning to try and see what happens... I just hope I don't brick my modules.
Is the bootloader still capable of performing a flash update via the UART0 ? Or it just does the OTA update ?
Re: 512kb module memory map & LD file question
Postby ESP_Faye » Mon Jan 18, 2016 2:46 pm
Hi,
Sorry that I do not really understand your question.
You can download the firmware into Flash through UART0 by ESP Flash Download Tool.
Or you can update the firmware through OTA function (OTA needs boot.bin).
Sorry that I do not really understand your question.
You can download the firmware into Flash through UART0 by ESP Flash Download Tool.
Or you can update the firmware through OTA function (OTA needs boot.bin).
Re: 512kb module memory map & LD file question
Postby sharkx » Mon Jan 18, 2016 6:56 pm
So, to sum it up, in case someone else needs this info; this applies to the 4MBit flash modules (512 Kb), but I guess others will behave in the same manner; however, one should not reach the flash size limit as easily as with the 512 Kb module.
1. According to the "Flash Map" section in the document 2A-ESP8266__IOT_SDK_User_Manual__EN_v1.5.pdf, for a 512 Kb module, the max size for a userX.bin file is 236 Kb
2. the userX.bin files are built from flash.bin and irom0text.bin
3. irom0text.bin is limited to 172 Kb according to the eagle.app.v6.new.512.appX.ld files
4. flash.bin is expected to be max 64 Kb, but in my case it was about 32 Kb
5. this leads to a userX.bin of a maximum 204 Kb, which wastes about 32 Kb of valuable memory space
6. didn't dig too deep into the compiling and linking procedure, but it looks to me that flash.bin and irom0text.bin are both combined into an assembler text file that is then processed to get get the userX.bin file. One can conclude that as long as the "concatenation" of flash.bin and irom0text.bin stays below the 236 Kb limit, the module will behave correctly.
So ...
Once my irom0text.bin file passed the 172 Kb limit, I tried to extend it to 192 Kb by modifying the eagle.app.v6.new.512.appX.ld files (there's a "len = 0x2B0000" parameter at the beginning of the file that I changed to "len = 0x30000")
The compiler didn't complain, and the userX.bin files went past the 204 Kb limit (see [5] above).
Sucessfully flashed those to the module using both the ESP Flash Download Tool and my own custom OTA updater. The module works as expected so far.
Conclusion : One can safely increase the irom0text.bin size as long as the userX.bin stays below the 236 Kb limit (which was also stated in this post)
1. According to the "Flash Map" section in the document 2A-ESP8266__IOT_SDK_User_Manual__EN_v1.5.pdf, for a 512 Kb module, the max size for a userX.bin file is 236 Kb
2. the userX.bin files are built from flash.bin and irom0text.bin
3. irom0text.bin is limited to 172 Kb according to the eagle.app.v6.new.512.appX.ld files
4. flash.bin is expected to be max 64 Kb, but in my case it was about 32 Kb
5. this leads to a userX.bin of a maximum 204 Kb, which wastes about 32 Kb of valuable memory space
6. didn't dig too deep into the compiling and linking procedure, but it looks to me that flash.bin and irom0text.bin are both combined into an assembler text file that is then processed to get get the userX.bin file. One can conclude that as long as the "concatenation" of flash.bin and irom0text.bin stays below the 236 Kb limit, the module will behave correctly.
So ...
Once my irom0text.bin file passed the 172 Kb limit, I tried to extend it to 192 Kb by modifying the eagle.app.v6.new.512.appX.ld files (there's a "len = 0x2B0000" parameter at the beginning of the file that I changed to "len = 0x30000")
The compiler didn't complain, and the userX.bin files went past the 204 Kb limit (see [5] above).
Sucessfully flashed those to the module using both the ESP Flash Download Tool and my own custom OTA updater. The module works as expected so far.
Conclusion : One can safely increase the irom0text.bin size as long as the userX.bin stays below the 236 Kb limit (which was also stated in this post)
Who is online
Users browsing this forum: No registered users and 18 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.