Using MicroPython with 16 MB of flash #9911
Replies: 2 comments 3 replies
-
The memory error is about RAM, not flash. So you either need a device with more RAM, like one using a WROVER module, not the WROOM module. Or you could freeze your code into flash, freeing RAM for data. That requires, that you build the firmware yourself. |
Beta Was this translation helpful? Give feedback.
-
That is different. When you copy a .py source file to the board, it is stored in the board's file system. When you run it, it will be compiled and the compiled to bytecode, placed in RAM and executed from there, using RAM for the data as well. Frozen bytecode will be stored in flash and executed from flash. But embedding frozen bytecode happens, when a firmware is built. That may be similar to your PIC scenario, where you had that build & flash step as well. The Arduino IDE does that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My initial hardware was an ESP32 module with 4MB of flash memory.
I started code development with MicroPython (esp32-20220618-v1.19.1.bin) and Thonny 3.3.13 as the development environment.
All went well but as the code grew larger I started getting these errors:
MemoryError: memory allocation failed, allocating 3070 bytes
NB! Thonny could not execute 'get_globals'.
I assumed that I could overcome this but changing to another ESP32 module but with 16 MB of flash.
This is the 16 MB ESP32 module
https://www.sparkfun.com/products/15663
The first thing I did was to use Thonny to run:
Does MicroPython know how to use the increase in flash memory?
I don't know how to proceed.
I am running Thonny with a Windows 10 PC and don't have access to a Linux PC
Any help appreciated.
Beta Was this translation helpful? Give feedback.
All reactions