Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LilyGo T-Display S3 - Memory allocation error #32

Open
andreyk72 opened this issue Aug 3, 2024 · 1 comment
Open

LilyGo T-Display S3 - Memory allocation error #32

andreyk72 opened this issue Aug 3, 2024 · 1 comment

Comments

@andreyk72
Copy link

andreyk72 commented Aug 3, 2024

Hi, I have a project Micropython 1.23/esp-idf-v5.2 /s3lcd where I randomly get the following error on calling init() for s3lcd.ESPLCD object. The configuration I use (tft_config.py) is the recommended one for the LilyGo T-Display S3 device.

MemoryError: memory allocation failed, allocating 108800 bytes

After some investigation with esp32.idf_heap_info() i found that the heap size initially is 256k and to the moment of starting main.py only the 147k bytes free left. So when i start relatively basic program that uses s3lcd, aioble, and couple of asyncio extensions i'm basically already in a short of RAM.

What is strange for me that the TTGO S3 device has 8MB PSRAM on board and in theory if this RAM is used somehow by micropython or s3lcd however I don't see it is available by analysing by esp32.idf_heap_info() call.

Is there any way to enable more memory for micropython in the heap? Or maybe compile s3lcd a way it does require less memory with possibly shot down of some features I don't use?

@andreyk72
Copy link
Author

andreyk72 commented Aug 3, 2024

Well, it looks I found the solution. The problem was in wrong arguments compiling micropython, as a result it does not see the PSRAM. The right arguments are the following:

make \
	BOARD=ESP32_GENERIC_S3 \
	BOARD_VARIANT=SPIRAM_OCT \
	USER_C_MODULES=../../../../s3lcd/src/micropython.cmake \
	FROZEN_MANIFEST=../../../../s3lcd/manifest.py \
	clean submodules all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant