The ESP8266 -- SPI Flash
On all of my devices so far, when I probe for the type of flash, I get:
esptool -p /dev/ttyUSB0 flash_id
Manufacturer: e0
Device: 4016
This (sort of) indicates a Winbond W25Q32 flash chip (32 Mbit, 4 Mbyte).
The "sort of" is because an actual Winbond device would have a manufacturer ID
of 0xef not 0xe0. My guess is that this is a Chinese clone of a Winbond device,
especially given the price point that ESP8266 modules sell for.
Winbond is in Taiwan by the way.
When I first started with the ESP8266, I was ignorant and expected flash to be
interfaces like a RAM memory chip, i.e. just mapped into the address space
somewhere. This is most definitely not the case. An SPI interfaced flash chip
is more like a disk drive. It has sectors and these sectors can be read and
written. In fact a typical SPI device supports the following 15 commands:
- 0x01 -- write status register
- 0x02 -- page program
- 0x03 -- read data
- 0x04 -- write disable
- 0x06 -- write enable
- 0x05 -- read status register 1
- 0x0b -- fast read
- 0x3b -- fast read dual output
- 0xbb -- fast read dual i/o
- 0x6b -- fast read quad output
- 0xeb -- fast read quad i/o
- 0x35 -- read status register 2
- 0x32 -- quad page program
- 0xd8 -- block erase (64k)
- 0x52 -- block erase (32k)
- 0x20 -- sector erase
- 0xc7 -- chip erase
- 0x60 -- chip erase
- 0x75 -- erase suspend
- 0x7a -- erase resume
- 0xb9 -- power down
- 0xA3 -- high performance mode
- 0xff -- mode bit reset
- 0xab -- release power down (or HPM, device ID)
- 0x90 -- Manufacturer device ID
- 0x4b -- read unique id
- 0x9F -- JEDEC id
I count 27 commands, so who knows why the data sheet claims 15.