Chat freely about anything...

User avatar
By bjpirt
#12546 Hello all,
I've been banging my head against this for a little while now and this post follows on from my previous one (viewtopic.php?t=1413). At the moment, the memory map separates out the user code from the libraries like this:

Code: Select allAddr     Size   Used for
-----------------------------------
00000h   4k     Bootloader
01000h   64k    User application, slot 1
11000h   180k   SDK libraries, slot 1
3E000h   8k     OTA device key
40000h   4k     Unused
41000h   64k    User application, slot 2
51000h   180k   SDK libraries, slot 2
7E000h   8k     WiFi configuration.


Because the user code and the libraries are separated out into two areas there's a lot of wasted space which could be used to do other interesting things. Ideally what I'd like to be able to do is to combine the user code and libraries into one chunk of code so we could do the following:

Code: Select allAddr     Size   Used for
-----------------------------------
00000h   4k     Bootloader
01000h   200k   User app + libs, slot 1
33000h   56k    Spare space
41000h   200k   User app + libs, slot 2
73000h   44k    More spare space
7E000h   8k     WiFi configuration.


At the moment my user code + libs is coming in at 193k so there's enough room in the 200k of space, although this could be expanded slightly if necessary.

So, my question is: Is it possible to combine the user and libs code into one chunk of binary, without padding it with zeroes to combine it.

If anyone knows how to do this or can point me in the right direction it would be hugely appreciated.
Cheers,
Ben
User avatar
By bjpirt
#12787 Digging into the compilation process a little further, I'm not quite sure which stage the memory sizes are defined at - is it the linker stage or the point at which the elf image gets turned into the two files to flash?

Even if I don't create one combined image for both the user app and libs I'd still settle for doing something like just adjusting the size for the user app because it still creates more usable space for other things.

Given that different sizes of flash chips are supported, it must be possible to make the different sections different sizes, I just can't figure out where this configuration is located.

Any help, or even just pointers to where I should search for the answers would be massively appreciated!

Cheers,
Ben
User avatar
By picstart
#12814 The memory maps are for 512k byte flash. Some pcbs esp-xxx have 4 mega byte flash.
The flash size can be set in the makefile.
What is needed is a solid electrical engineering description of the esp8266 an internal memory map ( registers, code space) and the DMA interface to external FLASH.
I hope I'm wrong but it seems electrical info about hardware is obtained by digging into software examples that use it. Sadly this won't tell you you can blow the ADC pin if it gets enough electrons with energies of more than 1v.
User avatar
By bjpirt
#12816 Well we do have a lot of the memory map worked out over on:

https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map

All I want to do is compile to code so that the offset of the libs is at a slightly lower address space. There's a post on the Espressif BBS that points in the right direction I think:

http://bbs.espressif.com/viewtopic.php?f=10&t=166

but it still doesn't say how or if it's possible to change the offset, just the length of the libs section.