{"id":20536670,"url":"https://github.com/islandcontroller/wch-riscv-devcontainer","last_synced_at":"2026-02-10T21:10:28.386Z","repository":{"id":205177523,"uuid":"699308037","full_name":"islandcontroller/wch-riscv-devcontainer","owner":"islandcontroller","description":"VSCode Devcontainer for WCH RISC-V microcontroller development","archived":false,"fork":false,"pushed_at":"2025-07-27T00:56:57.000Z","size":443,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T03:39:23.583Z","etag":null,"topics":["openocd","openwch","risc-v","riscv-toolchain","vscode-devcontainer","wch-link"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/islandc/wch-riscv-devcontainer","language":"Dockerfile","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":"2023-10-02T11:28:51.000Z","updated_at":"2025-07-27T00:56:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2b9cabf-14a5-403b-b0a5-87a7aea6e3c3","html_url":"https://github.com/islandcontroller/wch-riscv-devcontainer","commit_stats":null,"previous_names":["islandcontroller/wch-riscv-devcontainer"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/islandcontroller/wch-riscv-devcontainer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fwch-riscv-devcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fwch-riscv-devcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fwch-riscv-devcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fwch-riscv-devcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islandcontroller","download_url":"https://codeload.github.com/islandcontroller/wch-riscv-devcontainer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islandcontroller%2Fwch-riscv-devcontainer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29316611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["openocd","openwch","risc-v","riscv-toolchain","vscode-devcontainer","wch-link"],"created_at":"2024-11-16T00:37:28.383Z","updated_at":"2026-02-10T21:10:28.371Z","avatar_url":"https://github.com/islandcontroller.png","language":"Dockerfile","readme":"# wch-riscv-devcontainer\n[![License](https://img.shields.io/github/license/islandcontroller/wch-riscv-devcontainer)](LICENSE) [![GitHub](https://shields.io/badge/github-islandcontroller%2Fwch--riscv--devcontainer-black?logo=github)](https://github.com/islandcontroller/wch-riscv-devcontainer) [![Docker Hub](https://shields.io/badge/docker-islandc%2Fwch--riscv--devcontainer-blue?logo=docker)](https://hub.docker.com/r/islandc/wch-riscv-devcontainer) ![Docker Image Version (latest semver)](https://img.shields.io/docker/v/islandc/wch-riscv-devcontainer?sort=semver)\n\n*WCH-IC RISC-V development and debugging environment inside a VSCode devcontainer.*\n\n![Screenshot](scr.PNG)\n\n### Packages\n* [MounRiver Studio II (MRS2)](http://www.mounriver.com/download) Version 2.3.0\n  * WCH-custom GNU toolchain for RISC-V Version 12.2.0\n  * WCH-custom OpenOCD Version 0.11.0\n  * ISP Firmware Version `v40`\n  * SVD files\n* [CH32X035 PIOC Assembler](https://github.com/openwch/ch32x035/tree/main/EVT/EXAM/PIOC/Tool_Manual/Tool) Version 3.1\n\n* [CMake](https://cmake.org/download) Version 4.2.3\n* [ch32-rs/wchisp](https://github.com/ch32-rs/wchisp/) Version 0.3.0\n* [ch32-rs/wlink](https://github.com/ch32-rs/wlink/) Version 0.1.1\n\n## System Requirements\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## Usage\n* Include this repo as `.devcontainer` in the root of your project\n* Connect 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* Select `Dev Containers: Reopen in Container`\n\nFor CMake projects:\n* Upon prompt, select the `WCH RISC-V Toolchain x.x` CMake Kit. \n  * The toolchain file is located at [`/opt/gcc-riscv-none-elf/gcc-riscv-none-elf.cmake`](gcc-riscv-none-elf.cmake)\n  * The CMake Kit definition for VS Code is located at [`/opt/devcontainer/cmake-tools-kits.json`](cmake-tools-kits.json)\n* Run `CMake: Configure`\n* Build using `CMake: Build [F7]`\n\n### CMake+IntelliSense Notes\nUpon first run, an error message may appear in Line 1, Column 1. Try re-running CMake configuration, or run a build. If the file is a `.h` header file, it needs to be `#include`'d into a C module.\n\n### UDEV Rules installation\nIn order to use USB debug probes within the container, some udev rules need to be installed on the **host** machine. A setup script has been provided to aid with installation.\n* Run `setup-devcontainer` inside the **container**\n* Close the container, and re-open the work directory on your **host**\n* Run the `install-rules` script inside `.vscode/setup/` on your host machine\n\n      cd .vscode/setup\n      sudo ./install-rules\n\n### WCH-Link Firmware Update\n**Firmware update files** are provided in `/opt/wch/firmware/` and can be programmed using the `wchisp` utility. See the [`wchisp` GitHub repository](https://github.com/ch32-rs/wchisp/) for more information.\n\n\nSee the [WCH-Link User Manual](https://www.wch-ic.com/downloads/WCH-LinkUserManual_PDF.html) about updating your programmer and to determine which firmware file to use.\n\n    wchisp flash /opt/wch/firmware/\u003cisp-specific firmware file\u003e\n\n### OpenOCD Config File\nConfiguration files for the OpenOCD debugger are included in `/opt/openocd/bin/`. To start the debugger, run the following command inside the devcontainer terminal:\n\n    openocd -f /opt/openocd/bin/wch-riscv.cfg\n\n### Peripheral Description Files Notes\nPeripheral description files (SVD) for RISC-V MCUs are provided in `/opt/wch/`.\n\n### Serial Monitor\nTo access the WCH-Link serial monitor inside the devcontainer, use the `cu` command as shown below:\n\n    cu -l \u003cserial port device\u003e -s \u003cbaudrate\u003e\n\ne.g. \"`cu -l /dev/ttyACM0 -s 115200`\".\n\nTo close the connection, press RETURN/ESC/Ctrl-C, type \"`~.`\" (tilde, dot) and wait for 3 seconds.\n\n### Flashing a target with pre-built image\n\nTo flash a target with a pre-built firmware image, use the included `wlink` utility. See the [`wlink`GitHub repository](https://github.com/ch32-rs/wlink/) for more information.\n\n    wlink flash \u003chexfile\u003e\n\n### Running PIOC (CH53x) assembler\nThe CH32X035 *PIOC* uses a custom CPU architecture, hence at the moment only the WCH-provided assembler can be used to build PIOC binaries.\nIn order to run the assembler, a 32-bit WINE installation inside the container is required (~1 GiB installation).\n* Run `setup-devcontainer --install-wine` inside the container.\n* Run the compiler with \n\n      wasm53b \u003casm file name\u003e\n\n* Convert output binary to C-array\n\n      xxd -i \u003cbinary file name\u003e \u003cC source file name\u003e\n\n## Building\n\nTo build the image yourself, either download the [Linux MounRiver Studio II (MRS2)](http://www.mounriver.com/download) package manually and place it in the build directory, or enable the download in the [dockerfile](Dockerfile#L59-L68):\n\n```dockerfile\nARG MOUNRIVER_URL=\"http://file-oss.mounriver.com/upgrade/MounRiverStudio_Linux_X64_V${MOUNRIVER_VERSION}.tar.xz\"\n#ARG MOUNRIVER_URL=\"/tmp/MounRiverStudio_Linux_X64_V${MOUNRIVER_VERSION}.tar.xz\"\n...\n\n# Download and install package\nRUN curl -sLO ${MOUNRIVER_URL}\n#COPY MounRiverStudio_Linux_X64_V${MOUNRIVER_VERSION}.tar.xz /tmp\n...\n```\n\n## Licensing\n\nIf not stated otherwise, 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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislandcontroller%2Fwch-riscv-devcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislandcontroller%2Fwch-riscv-devcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislandcontroller%2Fwch-riscv-devcontainer/lists"}