Replies: 2 comments 4 replies
-
I don't entirely understand what you are doing, but it seems you are trying to implement concurrency on an ESP32. There are two ways to achieve this in MicroPython: one is threading using the In most cases, and certainly for tasks like handling a UART, the answer is |
Beta Was this translation helpful? Give feedback.
-
We can only speculate as to the problem from the limited information. From your message, I assume:
I can imagine this could be caused by some locking of a resource that is being held by your UART thread which eventually releases it, enabling the python thread to complete. Or possibly, you are misundertanding the nature of threading. Eg, rather than call the function from python, you should instead send a message to the UART thread to execute the function for you. It is really hard to help without more information. Also - how did you ascertain that your UART thread is "Locked"? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am facing a problem and I want to better understand what's happening.
I have created a new module and imported into my micropython project. This module is interfacing to a device via UART.
This module implements a task that manages the UART messages. The task is created with the xTaskCreatePinnedToCore to the CORE 1 (the same where micropython should be running) and priority is 7.
There are some more functions that are part of the module and that I've mapped to Micropython.
Everything is working correctly, I mean the module is called, the task is created and I'm able to see some log that confirm that everything is working correctly.
The problem is that when I try to call one of the mapped function the task seems to be Locked and I am not able to do anything on the REPL until the called function finishes to run.
I am not able to understand why this function is not locking when executed from the task itself but becomes locking when executed from micropython.
Can you please suggest to me what I'm doing wrong?
Thank you very much!
Greetings,
Andrea
Beta Was this translation helpful? Give feedback.
All reactions