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?
This commit is contained in:
Thomas Farstrike
2025-05-13 13:22:20 +02:00
parent f7a42f1da8
commit 5b240d9a7e
+4 -2
View File
@@ -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)