1. When reading the data in the structure, it told me for an ESP-01 with 1MByte flash, the the flash size is 1 MByte but the chip ID is 1640ef (which is wrong), whereas esp.flash_id() returns 1440C8 (which is right). Flashing the same device as an 4 MByte model changes the size info, which is interesting for a value which is told to reside in ROM. Since this seemed to be the major obstacle for allowing 16MByte flash.
2. The function esp_flash_size() could be simplified into:
Code: Select all
STATIC mp_obj_t esp_flash_size(void) {
extern SpiFlashChip *flashchip;
return mp_obj_new_int_from_uint(flashchip->chip_size);
}
P.S.: I did not raise a PR because: a) it works as it is b) me and git will never git frinds
P.P.S: According to a esp8266 wiki, address 0x3fffc714 is in ETS RAM. That explains why it's value changes, but now, why it flash_id is set to a wrong value..