You've seen the warnings that you definitely can't use this QT Py with CircuitPython or MicroPython. What you can do though is use the arduino_core_ch32 board support package to write code in the Arduino IDE.
Support for the CH32V203 in the Arduino IDE is very new and Adafruit has contributed some changes to make interfacing with the QT Py easier. As a result, the steps on this page are more involved than what you may be used to when setting up the Arduino IDE for a new development board.
Install Arduino IDE
The first thing you will need to do is to download the latest release of the Arduino IDE. You will need to be using version 1.8 or higher for this guide.
Install the arduino_core_ch32 Board Support Package
After you have downloaded and installed the latest version of Arduino IDE, you will need to start the IDE and navigate to the Preferences menu. You can access it from the File menu in Windows or Linux, or the Arduino menu on OS X.
A dialog will pop up just like the one shown below.
We will be adding a URL to the new Additional Boards Manager URLs option. The list of URLs is comma separated, and you will only have to add each URL once. New Adafruit boards and updates to existing boards will automatically be picked up by the Board Manager each time it is opened. The URLs point to index files that the Board Manager uses to build the list of available & installed boards.
To find the most up to date list of URLs you can add, you can visit the list of third party board URLs on the Arduino IDE wiki. We will only need to add one URL to the IDE in this example, but you can add multiple URLS by separating them with commas. Copy and paste the link below into the Additional Boards Manager URLs option in the Arduino IDE preferences.
https://github.com/openwch/board_manager_files/raw/main/package_ch32v_index.json
If you have multiple boards you want to support, say ESP8266 and Adafruit, have both URLs in the text box separated by a comma (,)
Once done click OK to save the new preference settings.
Installation Prerequisites
Before you install the board support package via the Arduino IDE, make sure to check the toolchain prerequisites for your operating system in the board support package repository. It's very important that you follow the steps listed in the README before installing the board support package in the Arduino IDE.
Follow the steps listed in the GitHub README for your operating system before installing the board support package in the Arduino IDE.
Install with the Board Manager
The next step is to actually install the Board Support Package (BSP). Go to the Tools → Board → Boards Manager submenu. A dialog should come up with various BSPs. Search for ch32.
Click the Install button and wait for it to finish. Once it is finished, you can close the dialog. This takes care of installing all of the backend dependencies and toolchain for the WCH chips.
Install the Adafruit TinyUSB Arduino Library
A lot of effort and time has been put into updating the TinyUSB Arduino library to support the CH32V203 QT Py. These updates allow you to upload code easily to the QT Py over USB. You'll need to install version 3.3.3 or newer to use these changes.
Version 3.3.3 or newer of the Arduino TinyUSB Library is required to properly interface with the QT Py
Click the Manage Libraries ... menu item, search for Adafruit TinyUSB, and select the Adafruit TinyUSB library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
Manually Install the arduino_core_ch32 Board Support Package
A pull request was recently merged to the CH32 board support package to add a board definition for the QT Py CH32V203. Until a new release is made, you'll want to manually install the board support package to get these newest features. To do this, you'll need to git clone the repository into the hardware folder inside of your Arduino folder in your filesystem.
You can do this using the GitHub Desktop app or by using git
in the terminal:
cd /path/to/Arduino/hardware git clone https://github.com/openwch/arduino_core_ch32.git
There is one final step to have the manual installation of the board support package appear in the Arduino IDE. Navigate to the arduino_core_ch32 folder inside of the hardware folder. You'll need to create a new folder called WCH. Move the contents of the arduino_core_ch32 folder that you just cloned into that WCH folder.
Your new folder hierarchy should be Arduino/hardware/arduino_core_ch32/WCH
Restart the Arduino IDE to be sure that it grabs the forked board support package in the hardware folder.
Code Upload Options
In the Tools → Board submenu you should see CH32V EVT Boards Support (in sketchbook). This is the manual installation that you just cloned into your hardware folder.
Under Board, select CH32V20x.
Under Board Select, select Adafruit QTPy CH32V203G6. Under USB Support, select Adafruit TinyUSB with USBD. These settings will work with the CH32V203 QT Py.
If you're not able to upload to the board, you may need to 'manually' put it into bootloader mode and use the WCHISP tool. Check this page https://learn.adafruit.com/adafruit-qt-py-ch32v203/bootloader-mode
Text editor powered by tinymce.