Tufty 2040 v.1.19.12

Here is an interesting one…

I am using the main.py (nothing modified, other then changing the pen_type to RGB565). It works no issues.

Then I wrote a quick program to display a photo, same basic items. Pen_Type = 565, no progressive jpeg. It works, no issues; displays correctly in all its 565 colour photo glory.

Now when I “call” that same photo program from main.py, it somehow reverts to 332. But if you run it, straight out (in Thony) it is works nicely.

Has the new firmware changed how it ‘passes’ the pen_type? (which really it shouldn’t – as both main.py and the photo program are 565.

(( I removed all of the extra blank lines so you can see the entire photo program )) –

(( Updated w/ testing using 1.19.12 code ))

Fixed that issue by reflashing the unit. Now I get the (standard) error - which I can understand:

Traceback (most recent call last):
File “”, line 122, in
File “”, line 64, in launch_application
File “lego_badge.py”, line 25, in
MemoryError: memory allocation failed, allocating 17824 bytes

I know I can rename my (photo) program → main.py and it runs just fine in 565.


Is there a way to launch a program from main.py clearing out some of its used memory for the new process/application?

Did you solve this at all? I’m trying to call different photos depending on which button I press and seem to be coming up with the same error.

Yes, the memory allocation error was resolved, I believe in 1.19.18. However, if you upgrade to 1.21.0 that should work. In addition, to adding additional features you can program with.

In a nutshell…

I can run main.py using 565, and call another program also in 565 - with no issues. Thanks to the dedication of several programmers who re-wrote the code, for memory allocation and clean-up…