Memory allocation error with nanogui and Waveshare 2.8 Pico Res

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
webbandrew
Posts: 1
Joined: Sat Aug 13, 2022 11:57 am

Memory allocation error with nanogui and Waveshare 2.8 Pico Res

Post by webbandrew » Sat Aug 13, 2022 12:30 pm

Hi all,

I wonder if anyone can help. I'm new to micropython but from a programming background. I'm trying to get Peter Hinch's nano-gui working on my pi pico with this 2.8 screen from Waveshare: https://www.waveshare.com/wiki/Pico-ResTouch-LCD-2.8

I have 'Hello world' working from the examples. I have cloned the nano-gui to PC and copied the files to appropriate places on the pi, retaining the tree structure. When I try the demo files, eg, color15.py I'm getting a 'memory allocation failed, allocating 232 bytes'.

I checked mem_free() before running the module: 179,184. After the error, 16,176.

It's a minimal copy of files to the pico, just the relevant driver, device setup file, core, widgets and 2 fonts. Can anyone shed any light on it?

Cheers

Andrew

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Memory allocation error with nanogui and Waveshare 2.8 Pico Res

Post by pythoncoder » Sun Aug 14, 2022 8:28 am

I assume you're using the ws_pico_res_touch.py setup, renamed to color_setup.py on the target. I have just run the color15.py test and it runs to completion. I modified it to display free RAM after each test and in each case it reported > 100KiB free.

So I'm baffled how we can run the same test on the same hardware with such different results. Are you sure you haven't modified color15.py in some way?
Peter Hinch
Index to my micropython libraries.

Post Reply