paulober / MicroPico

MicroPico (aka Pico-W-Go) is a Visual Studio Code extension designed to simplify and speed up the development of MicroPython projects for the Raspberry Pi Pico and Pico W boards.
https://marketplace.visualstudio.com/items?itemName=paulober.pico-w-go
Mozilla Public License 2.0
256 stars 25 forks source link

Sync/Connection breaks on stopping multi-threaded program in Pico #225

Open SmallhillCZ opened 2 months ago

SmallhillCZ commented 2 months ago

What are the steps to reproduce this issue?

  1. Create a program that creates another thread on the second CPU core
  2. Run the program, wait for the second core to start
  3. Hit Stop in the status bar
  4. Try to upload a file or refresh the Pico-W-FS

What happens?

What were you expecting to happen?

Stop the program, allow me to make a change and be able to start it again

Any logs, error output, etc?

2024-06-04 10:57:41.731 [info] [Activator] Connection to wrapper successfully established
2024-06-04 10:59:11.288 [error] [Activator] Pyboard exited with code 1
2024-06-04 10:59:12.224 [info] [Activator] Connection to wrapper successfully established

Any other comments?

Which version of MicroPico are you using?

v3.7.8

Support info

Version: 1.89.1 (user setup)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.26100
Mitch0S commented 1 month ago

Having the same issue. It seems that when I duplicate the workspace, it reconnects correctly. Just putting this here to help with debugging. Maybe some sort of halt/stop code isn't being sent on reconnect but is sent on initial connect/extension start?

Mitch0S commented 1 month ago

@SmallhillCZ on the microcontroller side, add a small delay (e.g. 3s) before creating the secondary thread. Helps quite a bit while we wait for this to be fixed.

anthonybrunelle commented 1 week ago

I am also having this issue, running on a Pi Pico W with latest micropython firmware flashed. Windows 11