Hello everyone, I’m having trouble running my LVGL project on an ESP32S3 with Octal PSRAM. The same project formally works on an ESP32S3 with Quad SPI PSRAM, but when I upload the code to an ESP32S3 with Octal, it simply keeps restarting. Commenting out the Octal PSRAM initialization in the PlatformIO ini file makes everything work fine. This is my ini file. This is my setup function.
This is the memory configuration of lv_conf that I’m using. Notice that I’m not using PSRAM allocation, and yet it keeps restarting. When I initialize from PSRAM, everything works.
By chance are you using GPIO pins 35, 36, or 37? Those pins are reserved for octal psram when it is enabled. Using those pins when octal psram is enabled will result in crashes
The other thing is you MUST make sure that the RAM is actually Octal. There are a lot of shady board manufacturers out there that will call a board an espressif devkit when it actually isn’t. I have been duped with this more than once. You will typically see it with the FLASH but it does also happen with the PSRAM. The board manufacturer will use an 8mb quad SPI chip instead of an octal and they use the model number that espressif has for a devkit along with a model number for the esp32s3 that leads you to believe what you are getting is something that has octal SPIRAM or octal FLASH when you really aren’t
The size of the SPIRAM is detected automatically and there are only a few settings for the SPIRAM to adjust the type of bus it is using.
For octal you need to change the following settings…
The SPIRAM size is automatically detected. typically if you have 2MB or 4MB of SPIRAM it will be quad and anything larger will be octal.
The flash can get a little bit wonky. Usually these settings are needed for quad flash…
# FLASH size. typically with the s3 line of MCU's
# if the size is either 2MB or 4MB it will be quad SPI
# if it is 8MB or 16MB it can be either quad or octal
# and 32MB I have only seen at octal
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=v
# dual SPI FLASH
CONFIG_ESPTOOLPY_FLASHMODE_DIO=n
CONFIG_ESPTOOLPY_FLASHMODE_DOUT=n
# quad SPI FLASH
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHMODE_QOUT=n
# octal SPI FLASH
CONFIG_ESPTOOLPY_FLASHMODE_OPI=n
# SPI speed for the flash. You want the RAM speed
# and the FLASH speed to be the same
CONFIG_ESPTOOLPY_FLASHFREQ_15M=n
CONFIG_ESPTOOLPY_FLASHFREQ_16M=n
CONFIG_ESPTOOLPY_FLASHFREQ_20M=n
CONFIG_ESPTOOLPY_FLASHFREQ_24M=n
CONFIG_ESPTOOLPY_FLASHFREQ_26M=n
CONFIG_ESPTOOLPY_FLASHFREQ_30M=n
CONFIG_ESPTOOLPY_FLASHFREQ_32M=n
CONFIG_ESPTOOLPY_FLASHFREQ_40M=n
CONFIG_ESPTOOLPY_FLASHFREQ_48M=n
CONFIG_ESPTOOLPY_FLASHFREQ_60M=n
CONFIG_ESPTOOLPY_FLASHFREQ_64M=n
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHFREQ_120M=n
setting CONFIG_ESPTOOLPY_FLASHSIZE_*MB=y for the size flash you have.
To use octal SPI FLASH you change CONFIG_ESPTOOLPY_FLASHMODE_QIO to n and change CONFIG_ESPTOOLPY_FLASHMODE_OPI to y
Don’t set the FLASH or the RAM speed higher than 80. There are special things that need to be done in order to us the higher speed and they need to be done in a very specific manner depending on the IC you are using.