If you need to verify which version of CircuitPython is running on your board, you can check it through the serial REPL (Read-Evaluate-Print Loop).
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and select CircuitPython: Open Serial Monitor.
Click inside the terminal window at the bottom of your screen.
Press Ctrl+C on your keyboard. This will interrupt any currently running code and enter the REPL.
The first line printed in the terminal will display the active version (e.g., Adafruit CircuitPython 9.x.x on 2024-xx-xx; Adafruit Metro M0 Express with samd21g18).
To exit the REPL and restart your code, press Ctrl+D.
Do not use the standard Python "Play" button (Run Python File) in the top right corner of VS Code. This attempts to run the code locally on your computer's CPU, which cannot access the microcontroller's hardware or CircuitPython-specific libraries.
To run code on the board: Ensure your file is saved on the CIRCUITPY drive as code.py. Simply saving the file (Ctrl+S / Cmd+S) automatically triggers the board to execute the code. View the results by opening the CircuitPython Serial Monitor.
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
Type CircuitPython and select CircuitPython: Close Serial Monitor from the list.
Open the Command Palette again and select CircuitPython: Open Serial Monitor to establish a fresh connection.
Alternative Fix: If the port remains stuck after attempting the steps above, you can force VS Code to reset. Open the Command Palette, type Reload, and select Developer: Reload Window. Once the application refreshes, try opening the serial monitor again.