From gniibe at fsij.org Mon Jul 22 04:51:48 2024 From: gniibe at fsij.org (NIIBE Yutaka) Date: Mon, 22 Jul 2024 11:51:48 +0900 Subject: WCH CH32V203 and my talk at Debconf24 Message-ID: <87v80ycf5n.fsf@akagi.fsij.org> Hello, I will have a short talk on July 29, 16:30+0900: https://debconf24.debconf.org/talks/19-gnuk-22-and-gnuk-next/ For Gnuk NEXT, I have just started my work for WCH CH32V203. A branch for WCH CH32V203 is available for Chopstx. Currently, the RISC-V core runs at 144MHz, LED1 and LED2 can blink, and... USART2 works to emit a message "Hello" periodically (while it can simply echo back input). The branch name is "wch". https://salsa.debian.org/gnuk-team/chopstx/chopstx/-/tree/wch?ref_type=heads It has 64KiB flash and 20KiB SRAM. You see, GD32VF103 has more (128KiB flash and 32KiB SRAM). My decision is use of WCH CH32V203, since I condider that the flash access to GD32VF103 seems easier by its USB ISP bootloader. (Easier access of flash ROM content is good for development, but not good when you have a private key on the chip.) CH32V203 has two USB peripherals: USBD and USBFS. It seems that USBD is compatible to STM32F103. Note that WCH CH32V203 also has USB ISP bootloader. It looks like it's a bit safer than GD32VF103. I think that it would be OK (using WCH CH32V203 to build a Gnuk Token), for the use case of Ed25519/Curve25519 key. WCH CH32V203 has the QingKe V4B core. A possible concern for this decision would be the semiconductor industry supply chain issue. CH32V203 would be difficult to get outside Mainland China. I'm not sure if it's related this issue, I observed that a board from Adafruit is not yet available. Adafruit QT Py CH32V203 Dev Board with STEMMA QT: https://www.adafruit.com/product/5996 Now, I'm using the evaluation board CH32V203G8R6-EVT-R0 from WCH (available from Aliexpress). I'll try to implement USBFS driver for Chopstx. Since the ISP bootloader uses USBFS, for evaluation boards, the physical support of USB is usually with USBFS. It's true for the CH32V203G8R6-EVT-R0 USB connection, too. Another concern would be... Currently for Japanese, it's a bit difficult to visit China, since visa waiver program is stopped now. But, I've found that we can use visa-on-arrival for ShenZhen from Hong Kong. So, it's not an issue for ShenZhen. --