Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By xtal
#32028 Just a thought...
I would think that when flashing FW a 1st check would be to determine Flash size .
Most memory's I'm familiar with addresses wrap, if the flash work the same , I would think
you could write a byte starting with highest page then check address 0 to see if it was written ,
repeat by writing byte to next highest page, check address 0 etc.. until size determined...

Then there is the possibility that the flash size may already exist somewhere in the boot loader ?
User avatar
By martinayotte
#32034
xtal wrote:Then there is the possibility that the flash size may already exist somewhere in the boot loader ?


The FlashID is not written in the memory space itself, it is part of the electronic of the Flash as 3 bytes, like a small ROM, every manufacturer of Flash chips need to provide those according to specs, one of the 3 bytes is manufacturer ID, another one is the Flash size, and the 3rd one is not really documented, but some people says that it is the Flash speed.

Here are comments from ArduinoESP code :
Code: Select all    /**
     * Chip ID
     * 00 - always 00 (Chip ID use only 3 byte)
     * 17 - ? looks like 2^xx is size in Byte ?     //todo: find docu to this
     * 40 - ? may be Speed ?                        //todo: find docu to this
     * C8 - manufacturer ID
     */