You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import time, _thread, machine
def task(n, delay):
led = machine.Pin("LED", machine.Pin.OUT)
for i in range(n):
led.high()
time.sleep(delay)
led.low()
time.sleep(delay)
print('done')
# _thread.start_new_thread(task, (10, 0.5)) # runs on core 1
task(10, 0.5) # runs on core 0
Running the procedure on core 0 is OK.
But if I run the same code on core 1, (toggling "#" over the last two lines), the result is:
>>> %Run -c $EDITOR_CONTENT
MPY: soft reboot
PROBLEM IN THONNY'S BACK-END: Exception while handling 'Run' (thonny.plugins.micropython.mp_back.ManagementError: Command output was not empty).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.
Process ended with exit code 1.
──────────────────────────────────────────────────────────────────────────────────
and pushing the STOP/Restart button in Thonny, the result is:
Device is busy or does not respond. Your options:
- wait until it completes current work;
- use Ctrl+C to interrupt current work;
- reset the device and try again;
- check connection properties;
- make sure the device has suitable MicroPython / CircuitPython / firmware;
- make sure the device is not in bootloader mode.
What went wrong?
The text was updated successfully, but these errors were encountered:
Printing in a thread is likely to cause problems, as it can confuse Thonny's ability to detect, whether a program has completed or not. When using threads, it is recommended to block the main thread until all other threads have completed.
Execution of the example-code (on an RPI pico):
Running the procedure on core 0 is OK.
But if I run the same code on core 1, (toggling "#" over the last two lines), the result is:
──────────────────────────────────────────────────────────────────────────────────
and pushing the STOP/Restart button in Thonny, the result is:
Device is busy or does not respond. Your options:
What went wrong?
The text was updated successfully, but these errors were encountered: