[{"element_type":"product","content":"https://www.adafruit.com/product/5996","metadata":{}},{"element_type":"text","content":"\n        \u003cp\u003eThe \u003ccode\u003eAdafruit QT Py CH32V203 Dev Board with STEMMA QT\u003c/code\u003e (Product ID: \u003ccode\u003e5996\u003c/code\u003e) is very similar to the \u003ccode\u003eLANA-TNY-01\u003c/code\u003e board (which will soon be for sale on Adafruit as well). Both have the exact same MCU: the \u003ccode\u003eCH32V203G6U6\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eProgramming this chip is not easy. Most people get stuck with the vendor-provided Mounriver Studio IDE. However, you can also program it with Embeetle IDE. For the complete guide, check out this page:\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://embeetle.com/#supported-hardware/wch/boards/lana-tny-01\"\u003ehttps://embeetle.com/#supported-hardware/wch/boards/lana-tny-01\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eBelow we'll go through the most basic steps.\u003c/p\u003e\n\u003ch2\u003eSTEP 1: Download Embeetle IDE\u003c/h2\u003e\n\u003cp\u003eFirst download Embeetle:\u003cbr\u003e\u003ca href=\"https://embeetle.com/#embeetle-ide/download\"\u003ehttps://embeetle.com/#embeetle-ide/download\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eYou can download it for either \u003cstrong\u003eWindows\u003c/strong\u003e or \u003cstrong\u003eLinux\u003c/strong\u003e. We don't have MAC support yet.\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003ch2\u003e\n\u003cbr\u003eSTEP 2: Launch the Project\u003c/h2\u003e\n\u003cp\u003eLaunch Embeetle and click \u003cstrong\u003eCREATE PROJECT\u003c/strong\u003e:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003eThen select \u003ccode\u003eWCH\u003c/code\u003e for the vendor (that's the vendor of the microcontroller) and look for the project\u0026nbsp;\u003ccode\u003elana-tny-01\u003c/code\u003e:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eNow click \u003cstrong\u003eCREATE \u003c/strong\u003eat the bottom. Embeetle IDE downloads the sample project and also all the required tools automatically. Then the project opens:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003ch2\u003e\n\u003cbr\u003eSTEP 3: Plug in the board\u003c/h2\u003e\n\u003cp\u003eFIRST press the \u003ccode\u003eBOOT\u003c/code\u003e switch, THEN plug your board into the computer with a USB-C cable (while keeping the \u003ccode\u003eBOOT\u003c/code\u003e switch pressed):\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003eWhen the board is plugged in, you can release the \u003ccode\u003eBOOT\u003c/code\u003e switch. This procedure ensures that your board is now in \"bootloader mode\". That means the microcontroller is ready to receive a new firmware!\u003c/p\u003e\n\u003ch2\u003eSTEP 4: Flash the firmware\u003c/h2\u003e\n\u003cp\u003eNow click the \u003ccode\u003eflash\u003c/code\u003e button at the top in Embeetle IDE. Embeetle will try to flash the firmware to the board. However, you might experience the following error now:\u003c/p\u003e\n\u003cpre\u003eFailed to open USB device: Bus 001 Device 008: ID 4348:55e0\u003cbr\u003eError: Failed to open USB device on Windows\u003c/pre\u003e\n\u003cp\u003e\u003cbr\u003eOn Linux you might experience another issue:\u003c/p\u003e\n\u003cpre\u003eFailed to open USB device: Bus 003 Device 010: ID 4348:55e0\u003cbr\u003eError: Failed to open USB device on Linux due to no enough permission\u003c/pre\u003e\n\u003cp\u003eLet's fix this.\u003c/p\u003e\n\u003ch2\u003eSTEP 5a: Install Zadig (Windows only)\u003c/h2\u003e\n\u003cp\u003eYou must install \u003ca href=\"https://zadig.akeo.ie/\"\u003eZadig\u003c/a\u003e and replace the driver for the USB device with the WinUSB driver. First, \u003ca href=\"https://zadig.akeo.ie/\"\u003edownload Zadig\u003c/a\u003e:\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003eThen, open Zadig and select \u003ccode\u003eOptions -\u0026gt; List All Devices\u003c/code\u003e:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003eSelect \u003ccode\u003eUSB Module\u003c/code\u003e from the list of devices and choose \u003ccode\u003eWinUSB\u003c/code\u003e as the driver. Then click \u003ccode\u003eReplace Driver\u003c/code\u003e:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003eMaybe you didn't find\u0026nbsp;\u003ccode\u003eUSB Module\u003c/code\u003e in the list of devices? In that case, you might find \u003ccode\u003eUnknown Device #1\u003c/code\u003e instead. Take that one and choose \u003ccode\u003eWinUSB\u003c/code\u003e as the driver. Then click \u003ccode\u003eReplace Driver\u003c/code\u003e:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003eWait for the driver installation to complete:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003eSuccess:\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003eTry again in Embeetle IDE. It should work now:\u003c/p\u003e\n\u003cpre\u003e\"C:/Users/krist/EMBEETLE IDE/embeetle/beetle_tools/windows/wchisp_0.2.2_64b/wchisp.exe\" flash application.elf\u003cbr\u003e14:57:06 [INFO] Chip: CH32V203G6U6[0x3619] (Code Flash: 32KiB)\u003cbr\u003e14:57:06 [INFO] Chip UID: CD-AB-19-97-D0-BC-B6-FF\u003cbr\u003e14:57:06 [INFO] BTVER(bootloader ver): 02.70\u003cbr\u003e14:57:06 [INFO] Code Flash protected: false\u003cbr\u003e14:57:06 [INFO] Current config registers: a55aff0000ff00ffffffffff00020700cdab1997d0bcb6ff\u003cbr\u003eRDPR_USER: 0x00FF5AA5\u003cbr\u003e\u0026nbsp; [7:0] \u0026nbsp; RDPR 0xA5 (0b10100101)\u003cbr\u003e\u0026nbsp; \u0026nbsp; `- Unprotected\u003cbr\u003e\u0026nbsp; [16:16] IWDG_SW 0x1 (0b1)\u003cbr\u003e\u0026nbsp; \u0026nbsp; `- IWDG enabled by the software, and disabled by hardware\u003cbr\u003e\u0026nbsp; [17:17] STOP_RST 0x1 (0b1)\u003cbr\u003e\u0026nbsp; \u0026nbsp; `- Disable\u003cbr\u003e\u0026nbsp; [18:18] STANDBY_RST 0x1 (0b1)\u003cbr\u003e\u0026nbsp; \u0026nbsp; `- Disable, entering standby-mode without RST\u003cbr\u003e\u0026nbsp; [23:22] SRAM_CODE_MODE 0x3 (0b11)\u003cbr\u003e\u0026nbsp; \u0026nbsp; `- CODE-228KB + RAM-32KB / CODE-160KB + RAM-32KB depending on the chip\u003cbr\u003eDATA: 0xFF00FF00\u003cbr\u003e\u0026nbsp; [7:0] \u0026nbsp; DATA0 0x0 (0b0)\u003cbr\u003e\u0026nbsp; [23:16] DATA1 0x0 (0b0)\u003cbr\u003eWRP: 0xFFFFFFFF\u003cbr\u003e\u0026nbsp; `- Unprotected\u003cbr\u003e14:57:06 [INFO] Read application.elf as ELF format\u003cbr\u003e14:57:06 [INFO] Found loadable segment, physical address: 0x00000000, virtual address: 0x00000000, flags: 0x5\u003cbr\u003e14:57:06 [INFO] Section names: [\".init\", \".vector\", \".text\"]\u003cbr\u003e14:57:06 [INFO] Found loadable segment, physical address: 0x00000dbc, virtual address: 0x20000000, flags: 0x6\u003cbr\u003e14:57:06 [INFO] Section names: [\".data\"]\u003cbr\u003e14:57:06 [INFO] Firmware size: 4096\u003cbr\u003e14:57:06 [INFO] Erasing...\u003cbr\u003e14:57:06 [WARN] erase_code: set min number of erased sectors to 8\u003cbr\u003e14:57:06 [INFO] Erased 8 code flash sectors\u003cbr\u003e14:57:07 [INFO] Erase done\u003cbr\u003e14:57:07 [INFO] Writing to code flash...\u003cbr\u003e██████████████████████████████████████ 4096/409614:57:07 [INFO] Code flash 4096 bytes written\u003cbr\u003e14:57:08 [INFO] Verifying...\u003cbr\u003e██████████████████████████████████████ 4096/409614:57:08 [INFO] Verify OK\u003cbr\u003e14:57:08 [INFO] Now reset device and skip any communication errors\u003cbr\u003e14:57:08 [INFO] Device reset\u003c/pre\u003e\n\u003cp\u003eIf it didn't work, pull out the LANA module and plug it back into your computer while pressing the \u003ccode\u003eBOOT\u003c/code\u003e switch (release the button a few seconds after you plugged it into the computer), to ensure it really is in \"bootloader mode\". If it still doesn't work, don't hesitate to contact us:\u003cbr\u003e\u0026nbsp;- Email: kristof@embeetle.com\u003cbr\u003e\u0026nbsp;- Discord: @kristof-at-embeetle\u003c/p\u003e\n\u003ch2\u003eSTEP 5b: Add device to plugdev group (Linux only)\u003c/h2\u003e\n\u003cp\u003eOn Linux you'll have to add the device to the \u003cstrong\u003eplugdev\u003c/strong\u003e group. First check groups related to the current user:\u003c/p\u003e\n\u003cpre\u003e$ groups `whoami`\u003cbr\u003ekristof : kristof adm cdrom sudo dip plugdev lpadmin lxd sambashare\u003c/pre\u003e\n\u003cp\u003eIf \u003ccode\u003eplugdev\u003c/code\u003e would not be listed, add the current user to that group: \u003c/p\u003e\n\u003cpre\u003e$ sudo useradd -G plugdev `whoami`\u003c/pre\u003e\n\u003cp\u003eFigure out your device's Vendor ID and Product ID through the \u003ccode\u003e$ lsusb\u003c/code\u003e command: \u003c/p\u003e\n\u003cpre\u003e$ lsusb\u003cbr\u003eBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\u003cbr\u003eBus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub\u003cbr\u003eBus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\u003cbr\u003eBus 003 Device 002: ID 046d:c548 Logitech, Inc. Logi Bolt Receiver\u003cbr\u003eBus 003 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub\u003cbr\u003eBus 003 Device 004: ID 04f2:b75c Chicony Electronics Co., Ltd FHD Webcam\u003cbr\u003eBus 003 Device 005: ID 1a2c:4324 China Resource Semico Co., Ltd USB Keyboard\u003cbr\u003eBus 003 Device 006: ID 048d:6005 Integrated Technology Express, Inc. ITE Device(8291)\u003cbr\u003eBus 003 Device 007: ID 1bcf:2701 Sunplus Innovation Technology Inc. HD 720P webcam\u003cbr\u003eBus 003 Device 008: ID 048d:ce00 Integrated Technology Express, Inc. ITE Device(8291)\u003cbr\u003eBus 003 Device 009: ID 8087:0026 Intel Corp. AX201 Bluetooth\u003cbr\u003eBus 003 Device 011: ID 4348:55e0 WinChipHead\u003cbr\u003eBus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub\u003cbr\u003eBus 004 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Card Reader\u003c/pre\u003e\n\u003cp\u003eLook for the line with \u003ccode\u003eWinChipHead\u003c/code\u003e (third to last). As you can see, the ID for my device consists of two 4-digit hex numbers: \u003ccode\u003eID 4348:55e0\u003c/code\u003e. The first one is the Vendor ID, the second one the Product ID. Do not confuse them!\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eIn the console, navigate to \u003ccode\u003e/etc/udev/rules.d\u003c/code\u003e and list the contents of the directory:\u003c/p\u003e\n\u003cpre\u003e$ cd /etc/udev/rules.d\u003cbr\u003e$ ls\u003cbr\u003e70-snap.core.rules\u003cbr\u003e70-snap.firefox.rules\u003cbr\u003e70-snap.snap-store.rules\u003c/pre\u003e\n\u003cp\u003eNow create a new file, for example with the gedit editor:\u0026nbsp;\u003c/p\u003e\n\u003cpre\u003e$ sudo gedit 10-probe.rules\u003c/pre\u003e\n\u003cp\u003eYou can name this file whatever you want, so long as it ends in \u003ccode\u003e.rules\u003c/code\u003e. Rules files by convention begin with a number. Linux parses rules files in lexical order, and the number makes it easy to see which files will be parsed first. Choosing a low number (like 10, as above) means that your file will be parsed before system rules files.\u003c/p\u003e\n\u003cp\u003eNow you need to add a line in the file that represents your device. If the file already existed (from a previous device you added this way), you can leave all the content as-is and just add a line at the bottom. The line you need to add is:\u003c/p\u003e\n\u003cpre\u003eATTRS{idVendor}==\"4348\", ATTRS{idProduct}==\"55e0\", MODE=\"666\", GROUP=\"plugdev\"\u003c/pre\u003e\n\u003cblockquote\u003e\n\u003cp\u003eNote: In older Ubuntu/Linux installations, you might need to replace 'ATTRS' with 'SYSFS' in the line below.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eOf course, fill in your own Vendor ID and Product ID! (although the ones above should be correct).\u003cbr\u003eSave the file and close it. Now you need to tell Linux to reload the udev rules:\u003c/p\u003e\n\u003cpre\u003e$ sudo udevadm trigger\u003c/pre\u003e\n\u003cp\u003eAny member of the \u003cstrong\u003eplugdev\u003c/strong\u003e group should now be able to run \u003ccode\u003ewchisp\u003c/code\u003e without using sudo.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eTry again to flash in Embeetle IDE.\u003cbr\u003eIf it doesn't work, pull out the LANA module and plug it back into your computer while pressing the \u003ccode\u003eBOOT\u003c/code\u003e switch (release the button a few seconds after you plugged it into the computer), to ensure it really is in \"bootloader mode\". If it still doesn't work, don't hesitate to contact us:\u003cbr\u003e\u0026nbsp;- Email: kristof@embeetle.com\u003cbr\u003e\u0026nbsp;- Discord: @kristof-at-embeetle\u003c/p\u003e\n      ","metadata":{}}]