How to install MicroPython to different flash size? (ESP_ERR_FLASH_NOT_INITIALISED) #10156
-
Hello, I am using MicroPython on many different boards, but now I have problem with the new one.. It is LilyGO T-QT Pro with ESP32-S3 and 4 MiB flash size. It has also 2 MiB of SPIRAM, so I have used Generic ESP32-S3 (SPIRAM) image. It is working, but I can't save any file to device. It says an error after boot: It seems like the image is designed for 8 MiB flash size and when I have flashed it, device reports back incorrect size -
Is there a way to solve that without compilation? (I have never compiled such project.) |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 15 replies
-
I believe you will need to recompile (unless someone else corrects me - or there are some precompiled 4MiB S3 images around): You can set the flashsize in
Compiling ain't so hard with docker (thanks to @mattytrentini): git clone [email protected]:micropython/micropython.git
cd micropython
# Edit ports/esp32/boards/GENERIC_S3/sdkconfig.board as described above
docker run -ti --rm -v $(pwd):/micropython -w /micropython espressif/idf:release-v4.4 bash -c "make -C mpy-cross && make -C ports/esp32 submodules all BOARD=GENERIC_S3 -j4" |
Beta Was this translation helpful? Give feedback.
-
You're right; I had the same issue. It's only a straightforward change but it does necessitate compilation. In GENERIC_S3_SPIRAM/sdkconfig.board you need to make the following changes: CONFIG_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_AFTER_NORESET=y
CONFIG_SPIRAM_MEMTEST=
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y # This was unset
CONFIG_ESPTOOLPY_FLASHSIZE_8MB= # This was set
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" # This pointed to 'partitions-8MiB.csv' I think we should follow-up with two options: a) Add a board definition for the T-QT Pro with this configuration. b) Add variants to allow multiple builds of the GENERIC_S3_SPIRAM for the common flash sizes... |
Beta Was this translation helpful? Give feedback.
-
Excellent, thank you both! I had to use However, I have some questions (maybe not very clever, I have never used that):
|
Beta Was this translation helpful? Give feedback.
-
Whoops, my version is for ssh auth to GitHub, which is what I use, but only useful if you have setup SSH access.
Yes, from within your micropython folder execute
This is the idf version that is used to build the production esp32s2/3 images. The 5.x idf is only recently released. The IDF is the integrated development framework provided by espressif, the manufacturer of the esp32 devices. The Micropython esp32 port is built on top of that.
Looks like you found the answer to that one with the manifest file. |
Beta Was this translation helpful? Give feedback.
-
I have an ESP32-s3 4R8 and tried everything here and while I can use the flashed firmware I have 0 storage so can't save anything. The module works perfectly in Arduino so my hardware setup is just fine. |
Beta Was this translation helpful? Give feedback.
-
I don't have that specific module, but this utility program; https://github.com/glenn20/mp-image-tool-esp32 allows you to set the flash size without needing to recompile Micropython. It worked well for me for an ESP32-S3 N8R8 and N16R8 with SPIRAM starting with the standard image for octal SPIRAM from https://micropython.org/download/ESP32_GENERIC_S3/ If not, you will have to install Esp-idf and recompile Micropython, see https://github.com/micropython/micropython/blob/master/ports/esp32/README.md |
Beta Was this translation helpful? Give feedback.
-
we use ESP32-S3-WROOM-1U-N16R8 for micropython |
Beta Was this translation helpful? Give feedback.
I believe you will need to recompile (unless someone else corrects me - or there are some precompiled 4MiB S3 images around):
You can set the flashsize in
ports/esp32/boards/GENERIC_S3/sdkconfig.board
and select the default partition table for a 4MB flash:Compiling ain't so hard with docker (thanks to @mattytrentini):