esp32-c3: run uasyncio in thread: maximum recursion depth? #10026
-
The same code is for ESP32 and STM32. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Running this program on a ESP32-C3 shows that the maximum recursion depth is about 25. def doit(count):
print(count)
doit(count + 1)
doit(1)
If a thread is used the maximum recursion depth is about 6. import utime
import _thread
def doit(count):
print(count)
doit(count + 1)
def my_thread():
doit(1)
_thread.start_new_thread(my_thread, ())
while True:
utime.sleep(1)
if import utime
import _thread
_thread.stack_size(1024 * 16)
def doit(count):
print(count)
doit(count + 1)
def my_thread():
doit(1)
_thread.start_new_thread(my_thread, ())
while True:
utime.sleep(1)
This means it should be possible to resolved the issue by calling |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information. I grow the stack size to 16. |
Beta Was this translation helpful? Give feedback.
Running this program on a ESP32-C3 shows that the maximum recursion depth is about 25.