Page 1 of 1

Reduce flash requirements by removing parser?

Posted: Fri Aug 10, 2018 3:28 pm
by salami08
Hi,

I'm thinking about adding MicroPython support to another project. However, one issue is that it needs quite a lot of flash memory (about 256kB AFAIK). Is it possible to reduce the flash requirements by e.g. building micropython without the parser/compiler, i.e., .py files would be compiled into .mpy files before loading them into the target? If so, by how much does this reduce the required flash space? Also, are there any other ways to "slim down" MicroPython?

Re: Reduce flash requirements by removing parser?

Posted: Sun Aug 12, 2018 10:15 pm
by jickster
salami08 wrote:
Fri Aug 10, 2018 3:28 pm
Hi,

I'm thinking about adding MicroPython support to another project. However, one issue is that it needs quite a lot of flash memory (about 256kB AFAIK). Is it possible to reduce the flash requirements by e.g. building micropython without the parser/compiler, i.e., .py files would be compiled into .mpy files before loading them into the target? If so, by how much does this reduce the required flash space? Also, are there any other ways to "slim down" MicroPython?
Yes.

Code: Select all

// Whether to include the compiler
#define MICROPY_ENABLE_COMPILER (1)
mpconfig.h is full of MACROs to include/exclude functionality.
Select the options you want, build and compare the output executable.