-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DIO / DOUT / QIO #11
Comments
I based it on tasmota - https://github.com/arendst/Sonoff-Tasmota/blob/c768f7d610c2bb5c915d6dda1b204246e0638ede/platformio.ini You can see here that yes I did mess up and DIO should have said DOUT. So 8266 = QIO and 8255=Dout. In anycase I have now followed tasmota lead and everything is using DOUT - as it greatly simplifies the build process (and the sontota side as well. |
Ah, ok, so if it's QIO on the Sonoffs using ESP8266 the external flash on the Sonoffs appears indeed quad wired.
However - without having it checked properly . I think that's tasmota hacking DOI/QIO into DOUT, if an ESP 8285 is detected - wouldn't that exclude other firmwares? Don't get me wrong, if you focus on tasmota that's totally fine. This concern just popped up in my head. |
I'm a little out past my area of expertise but I believe DOUT is basically universally supported by all esp 82** chips, its the lowest common denominator. Tasmota just generates one DOUT only build now for all devices - so i don't think its a hack (other than, some devices could flash faster with QIO mode). Best write up i saw when looking into it was here https://www.esp32.com/viewtopic.php?t=1250 DIO - SPI host uses the "Dual I/O Fast Read" command (BBh). Two SPI pins are used to write the flash address part of the command, and to read flash data out. Therefore these phases need half the clock cycles compared to standard SPI. In terms of performance: QIO > QOUT > DIO > DOUT. I'm fairly sure the flash cache issues 32 byte reads each time, so QOUT or QIO are substantially faster than DIO or DOUT. |
The defines for respective public images are:
which suggests DIO is used by ESP8285 (AFAIK wrong) and QIO by ESP8266 (AFAIK semi-wrong).
ESP8266 can be flashed using DIO/QIO - where 'D' stands for 'dual' (flash is wired with 2 cables) and 'Q' for 'quad' (flash is wire with 4 cables). As far as I know in Sonoffs the flash is wired with 2 cables (I might be wrong here) so QIO for the Sonoffs wouldn't make sense.
For the ESP8285 DOUT / QOUT are used instead of DIO/QIO (however since the flash is built-in, you shouldn't have much choice, however I'm uncertain whether it's wired internally by 2 or 4).
From my understanding ESPs being abled to flash via Q* and always also be flashed by its respective D* method. While *OUT and *IO are significantly different and that's what makes the difference in terms of flashing for ESP8285 and ESP8266.
As you see I'm not sure in several points myself, however I'm pretty sure the names of the defines lead to false implications (both using *IO).
The text was updated successfully, but these errors were encountered: