Reduce flash requirements by removing parser?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
salami08
Posts: 1
Joined: Fri Aug 10, 2018 3:20 pm

Reduce flash requirements by removing parser?

Post by salami08 » 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?

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: Reduce flash requirements by removing parser?

Post by jickster » Sun Aug 12, 2018 10:15 pm

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.

Post Reply