Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4824

MicroPython • Re: Error on Raspberry Pico with Micropython

$
0
0
The OP's source code is about 200,000 bytes. If a 'print("Started")' is put at the very start of the code it never shows, never gets executed, so it looks like it's failing during compilation, never gets to execute.

If it is 'mpy-cross' compiled on the host to become a '.mpy' file, it's about 30,000 bytes of executable. Copied to the MicroPython file system it does load and execute when an 'import' is issued, prints "Started" as expected, doesn't crash, but I didn't check operation beyond that.

So I guess it's either do that, pre-compile the code, or refactor the code to use smaller files which can be imported and compiled on import, on the fly, without running out of memory.

Basically, it's just too much for a constrained device like RP2040 running MicroPython to handle as a monolithic program.

Statistics: Posted by hippy — Fri Feb 09, 2024 12:24 pm



Viewing all articles
Browse latest Browse all 4824

Trending Articles