{"id":20536660,"url":"https://github.com/islandcontroller/hello-ch32v103","last_synced_at":"2025-07-14T15:07:18.841Z","repository":{"id":153360545,"uuid":"460509589","full_name":"islandcontroller/hello-ch32v103","owner":"islandcontroller","description":"A simple \"Hello World\"-like project for the WCH CH32V103 RISC-V MCU","archived":false,"fork":false,"pushed_at":"2025-02-23T16:16:23.000Z","size":594,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T07:43:52.192Z","etag":null,"topics":["ch32v103","hello-world","openwch","risc-v"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/islandcontroller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-17T16:10:46.000Z","updated_at":"2025-02-23T16:16:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"1512c19a-59e6-4339-832e-95c11e3f4228","html_url":"https://github.com/islandcontroller/hello-ch32v103","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/islandcontroller/hello-ch32v103","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fhello-ch32v103","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fhello-ch32v103/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fhello-ch32v103/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fhello-ch32v103/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islandcontroller","download_url":"https://codeload.github.com/islandcontroller/hello-ch32v103/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fhello-ch32v103/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265311843,"owners_count":23745152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ch32v103","hello-world","openwch","risc-v"],"created_at":"2024-11-16T00:37:26.223Z","updated_at":"2025-07-14T15:07:18.794Z","avatar_url":"https://github.com/islandcontroller.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello-ch32v103 [![GitHub license](https://img.shields.io/github/license/islandcontroller/hello-ch32v103?style=flat-square)](LICENSE) [![Discord server link](https://img.shields.io/badge/discord-WCH%20Community-white?style=flat-square\u0026logo=discord)](https://t.co/Qbblvmfbae)\n\nA simple \"Hello World\"-like project for the WCH CH32V103 RISC-V MCU.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"scr.png\" /\u003e\u003c/p\u003e\n\nThis project contains a simple set of modules to get the MCU running in a minimal configuration:\n  - Serial I/O on USART1 (connected to WCH-Link VCP)\n  - SysTick enabled and using empty dummy interrupt handler\n  - TIM3 Channel 1 configured for PWM output to LED\n  - ADC1 internal temperature sensor and Vrefint readout\n  - I2C2 interface with 24C64 EEPROM read and write access\n\n## Requirements\n\n* Hardware\n  * WCH CH32V103R8T6-EVT-R1 Evaluation Kit (available from LCSC, [PartNr `C2943982`](https://lcsc.com/product-detail/Development-Boards-Kits_WCH-Jiangsu-Qin-Heng-CH32V103R8T6-EVT-R1_C2943982.html)) + USB-A to USB-C Cable\n  * (optional) Female-female jumper wires\n  * (optional) AT24C64 EEPROM IC + Solderless breadboard + 2x 10k Resistors\n* Software\n  * Linux OS or WSL installation\n  * [Docker Engine](https://docs.docker.com/engine/install/debian/) (running within WSL if applicable)\n  * VSCode [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension\n  * (WSL only) [usbipd-win](https://learn.microsoft.com/en-us/windows/wsl/connect-usb)\n\n## Hardware Setup (optional)\n\n* Connect the `LED1` and `PA6` pins on header `J3` using a female-female jumper wire\n* Connect the 24C64 EEPROM to `PB10` and `PB11` and add 10k pull-up resistors to SDA and SCL:\n  ```\n       .___________.  VCC   VCC VCC       VCC  .________________\n      1|    |_|    |8  |     |   |         |   |\n   +---| A0    VCC |---+    .|. .|.        +---| VCC (3V3)\n   |  2|           |7       | | | | R1,R2      |\n   o---| A1     WP |---+    |_| |_| 10k    +---| GND\n   |  3|           |6  |     |   |         |   |\n   o---| A2    SCL |---(-----o---(---------(---| PB10 (I2C2_SCL)\n   |  4|           |5  |         |         |   |\n   o---| GND   SDA |---(---------o---------(---| PB11 (I2C2_SDA)\n   |   |___________|   |                   |   |________________\n  GND  U2             GND                 GND  U1\n       AT24C64 (DIP8)                          CH32V103R8T6\n  ```\n\n## Usage\n\n* Clone this repository using the following command. Note the use of the `--recursive` tag.\n  ```\n  git clone --recursive https://github.com/islandcontroller/hello-ch32v103\n  ```\n* Open the folder in VSCode\n* Connect WCH-Link debug probe\n  * (WSL only) attach to WSL using `usbipd attach --wsl --busid \u003c...\u003e`. **This needs to be completed before starting the Dev Container.**\n* Run the command \"**Dev Containers: Reopen in Container**\"\n  * Check if the board is recognised as a connected USB device by running `lsusb`.\n  * On first launch, you may need to install some udev rules on your host machine. Copy the files to your workspace by running `setup-devcontainer` inside the container.\n  * Re-open the workspace on your host and run the `install-rules` script inside the `.vscode/setup` folder.\n\n        cd .vscode/setup\n        sudo ./install-rules\n\n  * Afterwards, restart the devcontainer.\n* If prompted, select the \"`WCH RISC-V Toolchain x.x`\" CMake Kit. \n* Run \"**CMake: Configure**\"\n* Build using \"**CMake: Build [F7]**\"\n* Open a new terminal and launch the serial monitor:\n\n      cu -l /dev/ttyACM0 -s 115200\n\n  **To close the connection later on, press ESC/ENTER, type `~.` (tilde, dot) and wait for 3 seconds.**\n\n* Start debugging using \"**Debug: Start Debugging [F5]**\"\n* Continue execution once the breakpoint in `main()` is reached.\n* Type `?` in the serial monitor Terminal tab to show available commands.\n\nIf you want to use the EEPROM demo, remove the comment at the start of the `#define USE_EEPROM_DEMO` line at the top of `main.c`. The demo is disabled by default.\n\n### WCH-Link Firmware Update\nIf the debugger fails to program the target device, try updating the firmware of your debugger. The `wchisp` utility is included in the package, and compatible firmware files are provided in the `/opt/wch/firmware` directory inside the container. See the [WCH-Link User Manual](https://www.wch-ic.com/downloads/WCH-LinkUserManual_PDF.html) for more information.\n\nIn order to update the on-board debugger on a CH32V103R-R1-1v1 eval board, follow the firmware update procedure:\n* Disconnect the board from USB\n* Short-circuit the pads of `J1` usind pliers\n* Re-connect the board via USB\n* (WSL only) Re-attach the CH549 device to WSL\n* Flash the firmware file\n\n      wchisp flash /opt/wch/firmware/WCH-Link_APP_IAP_RV.bin\n\n* Restart the board\n\n## Licensing\n\nIf not stated otherwise in the specific file, the contents of this project are licensed under the MIT License. The full license text is provided in the [`LICENSE`](LICENSE) file.\n\n    SPDX-License-Identifier: MIT\n\n## Help and References\n\n* [openwch/ch32v103](https://github.com/openwch/ch32v103) Manufacturer EVT demos and documentation\n* [WCH-IC: CH32V103DS0.pdf](http://www.wch-ic.com/downloads/CH32V103DS0_PDF.html) MCU Datasheet\n* [WCH-IC: CH32xRM.pdf](http://www.wch-ic.com/downloads/CH32xRM_PDF.html) MCU Reference Manual\n* [WCH-IC: QingKeV3_Processor_Manual.pdf](http://www.wch-ic.com/downloads/QingKeV3_Processor_Manual_PDF.html) Processor Core Manual\n\nIf you're looking for further information about WCH products, check out their community Discord server: \n[![Discord server link](https://img.shields.io/badge/discord-WCH%20Community-white?style=flat-square\u0026logo=discord)](https://t.co/Qbblvmfbae)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislandcontroller%2Fhello-ch32v103","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislandcontroller%2Fhello-ch32v103","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislandcontroller%2Fhello-ch32v103/lists"}