Skip to content
Discussion options

You must be logged in to vote

Interpreting Python requires memory, and the resulting bytecode requires memory too. There's no way around it.

Step 1 is to pre-compile the code, i.e. upload as .mpy files instead of .py. They'll still be in RAM because littlefs doesn't support mapping to memory (AFAIK it cannot guarantee that the data is contiguous and most MCUs don't have a memory manager), but at least there's no more overhead for the interpreter.

If that doesn't help enough, you need to freeze them into the MicroPython image, which requires that you build your own. The manual describes how to do that.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ctimmer
Comment options

@Flipje1955
Comment options

Answer selected by Flipje1955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants