SPI mode promotion?

cruvus
Posts: 50
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

SPI mode promotion?

Postby cruvus » Wed Jul 27, 2022 3:11 pm

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?
ESP32 / ESP-IDF 5.1.3

cruvus
Posts: 50
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

Re: SPI mode promotion?

Postby cruvus » Fri Jul 29, 2022 3:52 pm

Is there a way to get the currently active SPI flash mode from inside the app?
ESP32 / ESP-IDF 5.1.3

cruvus
Posts: 50
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

Re: SPI mode promotion?

Postby cruvus » Tue Aug 09, 2022 7:40 pm

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).
ESP32 / ESP-IDF 5.1.3

cruvus
Posts: 50
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

Re: SPI mode promotion?

Postby cruvus » Wed Aug 10, 2022 3:26 pm

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)?
ESP32 / ESP-IDF 5.1.3

cruvus
Posts: 50
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

Re: SPI mode promotion?

Postby cruvus » Wed Aug 10, 2022 11:14 pm

ESP32 / ESP-IDF 5.1.3

Who is online

Users browsing this forum: No registered users and 101 guests