esp8266: Support up to 16 MB of flash
The ESP8266 supports up to 16 megabytes of SPI flash (source, page 12). NodeMCU has supported this much flash for about two months now, and I notice that MicroPython does not. I don't know all the nuances of the ESP8266, but from what I understand there are three things that should all encode the same size: the flash chip's ID, the SpiFlashChip structure from the SDK, and the bootloader size ID. They might not all agree about the flash chip's size, so we try to make them all agree in flashbdev.py. It looks like in the similar routine from NodeMCU, they use size IDs 8 and 9 for 8 MB and 16 MB, respectively. Setting these IDs in MicroPython seems to make mpy think that it has only 512 kB of flash, and I'm not sure why. Ignoring the bootloader size ID and only calculating flash size from the flash chip's ID seems to work, but somehow that seems like the wrong thing to do.
Long story short, I want to add support for 8 and 16 MB of flash to MicroPython, but I don't know what the right way to do it is. Any advice would be greatly appreciated.
Support for Dual Out flash mode (Support for ESP8285)
Hi,
the ESP8285 is basically and ESP8266 with 1MiB of flash integrated. Thus, the MicroPython ESP8266 port should support it out of the box. Sadly, the integrated flash can only be used in Dual Out mode according to its data sheet. This behavior is also observed in the Tasmota firmware.
The good thing about DOUT flash mode is, that it seems to be supported by every ESP82* device and flash combination, according to the Tasmota Wiki. Sadly, it seems to be also the slowest.
So it would be nice to be able to configure the build to use a specific flash mode. The FLASH_MODE variable in the Makefile is only used in the deploy target so far. (By the way, recent versions of the esptool don't provide the ) Maybe this variable could be used to control which flash mode micropython is using?--flash_mode= parameter any more.
Kind regards,
Marian
Update: esptool still supports --flash_mode, it is just not listed when running esptool.py --help. Running esptool.py write_flash --help lists it.