Memory Issues - Adafruit ESP32-S3 Manual

Tft feather
Table of Contents

Advertisement

My RGB NeoPixel/DotStar LED is blinking funny colors -
what does it mean?
The status LED can tell you what's going on with your CircuitPython board.
more here for what the colors

Memory Issues

What is a MemoryError?
Memory allocation errors happen when you're trying to store too much on the
board. The CircuitPython microcontroller boards have a limited amount of memory
available. You can have about 250 lines of code on the M0 Express boards. If you
try to
too many libraries, a combination of large libraries, or run a program
import
with too many lines of code, your code will fail to run and you will receive a
in the serial console.
MemoryError
What do I do when I encounter a MemoryError?
Try resetting your board. Each time you reset the board, it reallocates the memory.
While this is unlikely to resolve your issue, it's a simple step and is worth trying.
Make sure you are using .mpy versions of libraries. All of the CircuitPython libraries
are available in the bundle in a .mpy format which takes up less memory than .py
format. Be sure that you're using
CircuitPython.
If that does not resolve your issue, try shortening your code. Shorten comments,
remove extraneous or unneeded code, or any other clean up you can do to
shorten your code. If you're using a lot of functions, you could try moving those
into a separate library, creating a .mpy of that library, and importing it into your
code.
You can turn your entire file into a .mpy and
you will be unable to edit your code live on the board, but it can save you space.
Can the order of my
It can because the memory gets fragmented differently depending on allocation
order and the size of objects. Loading .mpy files uses less memory so its
recommended to do that for files you aren't editing.
©Adafruit Industries
mean! ()
the latest library
import
statements affect memory?
import
bundle ()
for your version of
that into code.py. This means
Read
Page 95 of 263

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S3 and is the answer not in the manual?

Table of Contents

Save PDF