Uploading directly to the QT Py USB port with the Arduino IDE is very convenient. However, if you find that you can't access the COM port or have problems with your toolchain then you may need to utilize uploading code in bootloader mode with the WCHISP tool. The WCHISP tool is a command line implementation of the WCHISP tool in Rust.
You can get your QT Py CH32V203 into bootloader mode by unplugging the USB port, holding down the Boot button and plugging the USB cable back in.
Install WCHISP Tool
There are prebuilt binaries of the WCHISP tool on the GitHub repository. Navigate to the releases page and download the binary for your operating system. After installing, the tool will be available in a folder:
cd /path/to/wchisp
Place the QT Py into bootloader mode by holding down the BOOT button and plugging it in via USB. To confirm that your board is connected, you can run wchisp
in the terminal. You should see that the tool has found the device:
To flash code onto the board, you'll need a compiled binary file. These files can be compiled in the Arduino IDE by going to Sketch - Export compiled Binary. The binary file will be exported to the Sketch folder. Make sure to use the same board settings that are described on the Arduino IDE pages in this guide.
Compiled binary files are available for the examples in this guide in the Learn repository. You can also use the Factory Reset binary, which is the NeoPixel swirl example that the boards ship with.
To upload the code to the board, run the following command in the terminal:
wchisp flash /path/to/binary_file.bin
You should see an output like this in the terminal after the binary has been successfully uploaded:
Text editor powered by tinymce.