From 5b240d9a7e1c4f87b33fc20754e27d09b4e50a94 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Tue, 13 May 2025 13:22:20 +0200 Subject: [PATCH] Increase stack size to 32KB for camera Perhaps this could be done on a per-app basis, where apps can specify in their manifest how much they would like? --- internal_filesystem/lib/mpos/apps.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal_filesystem/lib/mpos/apps.py b/internal_filesystem/lib/mpos/apps.py index 4de9d46e..a31f06b5 100644 --- a/internal_filesystem/lib/mpos/apps.py +++ b/internal_filesystem/lib/mpos/apps.py @@ -66,9 +66,11 @@ def execute_script_new_thread(scriptname, is_file, is_launcher, is_graphical): try: # 168KB maximum at startup but 136KB after loading display, drivers, LVGL gui etc so let's go for 128KB for now, still a lot... # But then no additional threads can be created. A stacksize of 32KB allows for 4 threads, so 3 in the app itself, which might be tight. - # 16KB allows for 10 threads in the apps, but seems too tight for urequests on unix (desktop) targets + # 16KB allows for 10 threads in the apps, but seems too tight for urequests on unix (desktop) targets + # 32KB seems better for the camera, but it forced me to lower other app threads from 16 to 12KB #_thread.stack_size(24576) # causes camera issue... - _thread.stack_size(16384) + #_thread.stack_size(16384) + _thread.stack_size(32*1024) _thread.start_new_thread(execute_script, (scriptname, is_file, is_launcher, is_graphical)) except Exception as e: print("main.py: execute_script_new_thread(): error starting new thread thread: ", e)