Page 1 of 1

SPI mode promotion?

Posted: Wed Jul 27, 2022 3:11 pm
by cruvus
The SPI mode (40/80 MHz, DOUT/QIO and so on) is compiled into the bootloader and also the app. Is that right?
I wonder if it is somehow possible to first boot into a fail-safe mode (40 MHz, DOUT) and later switch to the fastest possible mode.

Let's say of the devices in the field some are capable of QIO, some are DOUT only. The bootloaders are flashed accordingly.
So if I flash an app image (compiled with DOUT; because there is only one version for all devices) OTA on a device with a QIO compiled bootloader, what happens? Does the app run on QIO or DOUT? If DOUT, what is necessary to switch to QIO mode?

Re: SPI mode promotion?

Posted: Fri Jul 29, 2022 3:52 pm
by cruvus
Is there a way to get the currently active SPI flash mode from inside the app?

Re: SPI mode promotion?

Posted: Tue Aug 09, 2022 7:40 pm
by cruvus
Today I looked at the header of my compiled .bin files. In menuconfig I chose "qio" mode, however spi_mode (third byte) is 2, which is "dio". Then I tried to compile the other modes using menuconfig, one after the other. In mode "dout" the value changes to 3, which is correct. All other modes result in value 2, in both the bootloader and the app binary.
I cannot reach spi_mode 0.
What would be the correct way to do this? I need an OTA flashable .bin file (esptool not possible).

Re: SPI mode promotion?

Posted: Wed Aug 10, 2022 3:26 pm
by cruvus
Looking at file "sdkconfig", CONFIG_ESPTOOLPY_FLASHMODE is either "dout" or "dio". The other two modes are not being used despite the drop-down menu in menuconfig lists them. Is that a bug or a limitation of some kind (and I overlooked it in the manual somewhere)?

Re: SPI mode promotion?

Posted: Wed Aug 10, 2022 11:14 pm
by cruvus