ESP8266 Developer Zone The Official ESP8266 Forum 2015-11-11T09:52:09+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=1351 2015-11-11T09:52:09+08:00 2015-11-11T09:52:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1351&p=4531#p4531 <![CDATA[Re: How does SDK1.4 determine flash size?]]> Statistics: Posted by tve — Wed Nov 11, 2015 9:52 am


]]>
2015-11-10T22:47:18+08:00 2015-11-10T22:47:18+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1351&p=4527#p4527 <![CDATA[Re: How does SDK1.4 determine flash size?]]>
tve wrote:
Mhh, that wasn't my question, I know that.
My question is where does the SDK get the flash map from ? Is it from the header in the boot sector?

I believe by reading SPI FLASH ID - spi_flash_get_id().

Statistics: Posted by tito — Tue Nov 10, 2015 10:47 pm


]]>
2015-11-10T19:20:08+08:00 2015-11-10T19:20:08+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1351&p=4525#p4525 <![CDATA[Re: How does SDK1.4 determine flash size?]]>
Start from Flash 0x00000

Code:

struct flash_hdr {
   char magic;
   char blocks;
   char spi_mode;
   char spi_speed: 4;  // low
   char spi_size: 4;
   unsigned int entry_addr;
};


The "spi_size" is corresponding to the enum below:

Code:

enum flash_size_map {
    FLASH_SIZE_4M_MAP_256_256 = 0,
    FLASH_SIZE_2M,
    FLASH_SIZE_8M_MAP_512_512,
    FLASH_SIZE_16M_MAP_512_512,
    FLASH_SIZE_32M_MAP_512_512,
    FLASH_SIZE_16M_MAP_1024_1024,
    FLASH_SIZE_32M_MAP_1024_1024
};


Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Tue Nov 10, 2015 7:20 pm


]]>
2015-11-09T16:56:55+08:00 2015-11-09T16:56:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1351&p=4515#p4515 <![CDATA[Re: How does SDK1.4 determine flash size?]]> My question is where does the SDK get the flash map from ? Is it from the header in the boot sector?

Statistics: Posted by tve — Mon Nov 09, 2015 4:56 pm


]]>
2015-11-09T14:54:39+08:00 2015-11-09T14:54:39+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1351&p=4507#p4507 <![CDATA[Re: How does SDK1.4 determine flash size?]]>
Yes, the system_get_flash_size_map can get the flash size & map.

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Mon Nov 09, 2015 2:54 pm


]]>
2015-11-07T13:55:56+08:00 2015-11-07T13:55:56+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1351&p=4475#p4475 <![CDATA[[SOLVED]How does SDK1.4 determine flash size?]]> I know that the flash size is stored in two places: in the header of the bootloader (at flash address 0) and in the header of the boot-mode 2 user1.bin/user2.bin files (this is put there by gen_appbin.py). From my tests it seems that the header of the bootloader is what the SDK uses, at least that's what system_get_flash_size_map returns. Is the flash size in the header of the user1.bin/user2.bin used for anything?

Statistics: Posted by tve — Sat Nov 07, 2015 1:55 pm


]]>