Using MicroPython with 16MB Flash and 8MB PSRAM #10078
-
I use the D32 Pro (V 2) Modul from WEMOS which has 16MB Flash and 8MB PSRAM. But I can’t see the Memory in MicroPython. Neither do I see the 16MB flash with I think I have a fundamental problem understanding this. Is it at all possible to use more than 4MB heap RAM in MicroPython? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I copied these instructions off a posting on the old forum. Best to search the archives as I have not tried these myself. a) create a partition table for that 8 MB flash and place it in the esp32 directory. The name is arbitrary. I named it partitions_8mb.csv. My copy: Name, Type, SubType, Offset, Size, FlagsNote: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuildnvs, data, nvs, 0x9000, 0x6000, set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) make BOARD=<new_board_name> deploy |
Beta Was this translation helpful? Give feedback.
-
I'll address the RAM query. No, the ESP32 can only address 4MB of memory. Even with 8MB PSRAM fitted only 4MB of it will be accessible. It's why there's a number of 'red note alerts' on the AliExpress Wemos page for the D32 Pro: There actually is a way to make some use of the additional memory but it's awkward, of limited use, and not supported in MicroPython. I mention it here only for completeness but I wouldn't suggest using it. Espressif provide the himem allocation API. It allows you to split your general memory, allocating a portion of it to be bank-switched at runtime. Himem is probably not worthwhile pursuing, especially with the newer ESP32-S2/S3 able to address more than 4MB RAM. |
Beta Was this translation helpful? Give feedback.
-
Sorry I confused extending the RAM with extending the FLASH. |
Beta Was this translation helpful? Give feedback.
I'll address the RAM query. No, the ESP32 can only address 4MB of memory. Even with 8MB PSRAM fitted only 4MB of it will be accessible. It's why there's a number of 'red note alerts' on the AliExpress Wemos page for the D32 Pro:
There actually is a way to make some use of the additional memory but it's awkward, of limited use, and not supported in MicroPython. I mention it here only for completeness but I wouldn't suggest using it. Espressif provide the himem allocation API. It allows you to split your general memory, allocating a portion of it to be bank-switched at runtime.
Himem is probably not worthwhile pursuing, especially with the newer ESP32-S2/S3 able to address more than 4MB RAM.