{"id":13288228,"url":"https://github.com/h1romas4/m5stamp-c3dev","last_synced_at":"2025-10-25T02:30:39.679Z","repository":{"id":53576815,"uuid":"443270774","full_name":"h1romas4/m5stamp-c3dev","owner":"h1romas4","description":"This is a development board for the M5Stamp C3 (RISC-V/FreeRTOS).","archived":false,"fork":false,"pushed_at":"2024-07-21T07:31:12.000Z","size":5165,"stargazers_count":23,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T05:03:14.860Z","etag":null,"topics":["arduino","arduino-esp32","assemblyscript","esp32","esp32c3","jtag","m5stack","m5stamp","risc-v","riscv","wasm3","webassembly"],"latest_commit_sha":null,"homepage":"https://another.maple4ever.net/archives/2979/","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/h1romas4.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}},"created_at":"2021-12-31T06:17:55.000Z","updated_at":"2024-12-31T07:00:11.000Z","dependencies_parsed_at":"2023-02-18T02:01:15.182Z","dependency_job_id":"4adffb5f-1230-4e72-afa5-c6bbf31201b4","html_url":"https://github.com/h1romas4/m5stamp-c3dev","commit_stats":{"total_commits":338,"total_committers":2,"mean_commits":169.0,"dds":"0.023668639053254448","last_synced_commit":"61b7518d04d9f6b2f4266120f3d504028b748c07"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stamp-c3dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stamp-c3dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stamp-c3dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stamp-c3dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h1romas4","download_url":"https://codeload.github.com/h1romas4/m5stamp-c3dev/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238059129,"owners_count":19409601,"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":["arduino","arduino-esp32","assemblyscript","esp32","esp32c3","jtag","m5stack","m5stamp","risc-v","riscv","wasm3","webassembly"],"created_at":"2024-07-29T16:55:00.832Z","updated_at":"2025-10-25T02:30:33.576Z","avatar_url":"https://github.com/h1romas4.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# m5stamp-c3dev\n\n![](https://github.com/h1romas4/m5stamp-c3dev/workflows/Build/badge.svg)\n\n![Main Board](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_01.jpg)\n\nThis is a development board for the [M5Stamp C3](https://shop.m5stack.com/products/m5stamp-c3-mate-with-pin-headers) (RISC-V/FreeRTOS).\n\n**Hardware**\n\n- External USB-C port for JTAG debugging\n- Support for LCD panel and SD card\n- Selecting a power supply\n- Switch(GPIO9) to enter loader mode\n- Pin headers to expose usable GPIOs to the outside\n- The size is just Japanese business card\n\n**Sample Sources Included**\n\n![AssemblyScript and Wasm3](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_04.jpg)\n\n![AssemblyScript and Wasm3](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_05.jpg)\n\n- TrueType font with Japanese output to LCD - [test_freetype.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_freetype.cpp)\n- Output PNG images in SD card to LCD - [test_tinypng.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_tinypng.cpp)\n- NTP synchronization via WiFi connection - [test_nvs_wifi.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_nvs_wifi.cpp)\n- Test ADC on GPIO0\n    - UNIT Light - [main.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/main.cpp#L108-L111)\n- Test I2C on GPIO18, 19\n    - UNIT ENV III - [test_i2c_gpio1819.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_i2c_gpio1819.cpp#L43-L50)\n    - UNIT ULTRASONIC - [test_i2c_gpio1819.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_i2c_gpio1819.cpp#L52-L61)\n- Test UART on GPIO18, 19\n    - UNIT GPS - [test_uart_gpio1819.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_uart_gpio1819.cpp)\n- WebAssembly execution with Wasm3\n    - Analog clock using AssemblyScript - [test_wasm3_clockenv.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_wasm3_clockenv.cpp)\n    - GPS GSV viewer using AssemblyScript - [test_wasm3_gpsgsv.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_wasm3_gpsgsv.cpp)\n    - 3D Cube Demo using AssemblyScript - [test_wasm3_imu6886.cpp](https://github.com/h1romas4/m5stamp-c3dev/blob/main/main/test_wasm3_imu6886.cpp)\n- Usage of SPIFFS, which stores TrueType fonts and .wasm binaries (parttool.py and spiffsgen.py tools)\n- Use of NVS (cryptographically enabled key value store) that stores WiFi passwords (nvs_partition_gen.py tool)\n- Building libraries and managing dependencies using the esp-idf build system\n- Visual Studio Code C/C++ Extension configuration and JTAG debugging configuration in conjunction with openocd\n- AssembyScript sharing method between web browser and microcontroller - [wasm](https://github.com/h1romas4/m5stamp-c3dev/tree/main/wasm)\n\nThis repository contains MIT Licensed PCB data and example programs.\n\n## Demo\n\n### Video\n\n- 📼 [Demo(LCD)](https://youtu.be/46I3Uo5Xivg)\n- 📼 [Demo(Wasm3)](https://youtu.be/TagQuPtwKCg)\n- 📼 [Demo(3D Cube)](https://twitter.com/h1romas4/status/1610228824607985664)\n\n### Web Simulation\n\n- 🕸 [AssemblyScript Analog Clock](https://h1romas4.github.io/m5stamp-c3dev/asclock/)\n- 🕸 [AssemblyScript GPS GSV Viewer](https://h1romas4.github.io/m5stamp-c3dev/asgps/)\n\n## Schematic\n\n![Circuit Diagram](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/circuit_diagram_01.png)\n\n|#Unit|Name|Note|Where to get it|\n|----|----|----|----|\n|U1|AE-USB2.0-TYPE-C|USB 2.0 Type-C Break out board|[akizukidenshi.com (JP)](https://akizukidenshi.com/catalog/g/gK-13080/)|\n|U2|M5STAMP-C3|M5Stamp C3|+ [M5Stack](https://shop.m5stack.com/products/m5stamp-c3-mate-with-pin-headers?variant=40724631257260)\u003cbr /\u003e+ [SWITCH SCIENCE (JP)](https://www.switch-science.com/catalog/7474/)|\n|U3|KMR-1.8SPI|KMR-1.8 SPI marked LCD and SD card interface|+ [amazon.co.jp (1)](https://www.amazon.co.jp/gp/product/B07RG8SJVB/)\u003cbr /\u003e+ [ja.aliexpress.com](https://ja.aliexpress.com/item/4000511275898.html)|\n|R1 - R2|5.2K Resistor|Pull-down for USB Power supply|-|\n|R3 - R7|10K Resistor|SPI pull-up|-|\n|JP1|Jumper pin|Select external power supply|[akizukidenshi.com (JP)](https://akizukidenshi.com/catalog/g/gP-03687/)|\n|SW1|Tact switch|for loader mode and utility|[akizukidenshi.com (JP)](https://akizukidenshi.com/catalog/g/gP-03647/)|\n|J1|12 Pin header|You can use the one that comes with the M5Stamp C3 Mate|-|\n\n## PCB and Gerber data\n\n- [KiCad 6 PCB](https://github.com/h1romas4/m5stamp-c3dev/tree/main/pcb/fg06-c3dev-revb)\n- [Gerber Data](https://github.com/h1romas4/m5stamp-c3dev/raw/main/pcb/fg06-c3dev-revb/fg06-c3dev-revb-gerber.zip)\n- [FG06-C3DEV REV.B (2枚) - M5Stamp C3 向けの開発用基板 - 部品なし基板のみ - 130円](https://h1romas4.booth.pm/items/3688492)\n\n## Example Source\n\n### Require\n\n- [Setup ESF-IDF **release/v5.1**](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32c3/get-started/linux-macos-setup.html)\n\nget_idf or (Windows) ESP-IDF command prompt\n\n```\n# Linux or macOS -\u003e\n$ alias get_idf='. $HOME/esp/esp-idf/export.sh'\n$ get_idf\n# \u003c-\n\nDetecting the Python interpreter\n... snip ...\nDone! You can now compile ESP-IDF projects.\nGo to the project directory and run:\n\n  idf.py build\n\n$ echo ${IDF_PATH}\n/home/hiromasa/devel/toolchain/esp/esp-idf\n\n$ riscv32-esp-elf-gcc -v\nUsing built-in specs.\nCOLLECT_GCC=riscv32-esp-elf-gcc\n... snip ...\ngcc version 12.2.0 (crosstool-NG esp-12.2.0_20230208)\n```\n\nopenocd (Optional)\n\n```\n$ openocd -v\nOpen On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:25)\nLicensed under GNU GPL v2\nFor bug reports, read\n        http://openocd.org/doc/doxygen/bugs.html\n```\n\n### Build and Execute\n\n1. git clone and build (Please add `--recursive`)\n\n```\ngit clone --recursive https://github.com/h1romas4/m5stamp-c3dev\ncd m5stamp-c3dev\nidf.py build\n```\n\n**Note**: If you get a compile error, change the `sdkconfig` back to the Git one. In some cases, the target of `sdkconfig` is changed to `esp32` instead of `eps32c3`.\n\n2. Write Partition table\n\n```\nidf.py partition-table-flash\n```\n\n3. Write TypeType font to SPIFFS\n\n```\nparttool.py write_partition --partition-name=font --partition-subtype=spiffs --input resources/spiffs_font.bin\n```\n\n4. Write WebAssembly(.wasm) to SPIFFS\n\n```\nparttool.py write_partition --partition-name=wasm --partition-subtype=spiffs --input resources/spiffs_wasm.bin\n```\n\n5. Write main program to go!\n\n```\nidf.py flash monitor\n```\n\n### Setup WiFi (Optional)\n\n1. Change WiFi Setting\n\n`nvs_partition.csv`: Set own `[ssid]`, `[password]`\n\n```\nkey,type,encoding,value\nwifi,namespace,,\nssid,data,string,[ssid]\npasswd,data,string,[password]\n```\n\n2. Create NVS Partition file\n\n```\npython ${IDF_PATH}/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py generate nvs_partition.csv nvs_partition.bin 0x6000\n```\n\n3. Write NVS Partition\n\n```\nesptool.py write_flash 0x9000 nvs_partition.bin\n```\n\n4. Run\n\nNTP synchronization is performed by pressing the SW1 after the startup logo.\n\n```\nidf.py monitor\n```\n\n### Select connected GPIO18 and GPIO19 device (Optional)\n\n```\nidf.py menuconfig\n```\n\nC3DEV Configuration → Select GPIO 18/19\n\n![](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_05.png)\n\n`3D Cube Demo`\n\n![3D Cube](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_06.jpg)\n\n### JTAG debug with Visual Studio Code\n\nRequire setup ESP32_TOOLCHAIN_HOME\n\n```\n$ echo ${ESP32_TOOLCHAIN_HOME}\n/home/hiromasa/.espressif/tools/riscv32-esp-elf\n```\n\n1. Connect the PC to the USB Type-C of the U1\n2. Open the source file in Visual Studio Code.\n3. Run Task \"openocd (debug)\" @see [.vscode/tasks.json](https://github.com/h1romas4/m5stamp-c3dev/blob/main/.vscode/tasks.json#L7-L13)\n4. Set a breakpoint in the source code.\n5. Debug Launch (GDB) @see [.vscode/launch.json](https://github.com/h1romas4/m5stamp-c3dev/blob/main/.vscode/launch.json#L8-L23)\n    The first time you start the program, it will often fail, so if you get an error, retry.\n\n![vscode](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_02.png)\n\n### Note\n\n#### If the LCD color is inverted.\n\n`main/main.cpp`\n\n```c\n    // If the color is inverted, set to 1.\n    tft.invertDisplay(0);\n    // tft.invertDisplay(1);\n```\n\n#### Create SPIFFS partition file from file system\n\n```\npython ${IDF_PATH}/components/spiffs/spiffsgen.py 0x100000 resources/font resources/spiffs_font.bin\npython ${IDF_PATH}/components/spiffs/spiffsgen.py 0x10000 resources/wasm resources/spiffs_wasm.bin\n```\n\n#### Change the output destination of the log to U1 Serial/JTAG.(Don't forget to put it back)\n\nComponent config → ESP System Settings → Channel for console output\n\n```\nidf.py menuconfig\n```\n\n![vscode](https://raw.githubusercontent.com/h1romas4/m5stamp-c3dev/main/docs/images/m5stamp_c3dev_03.png)\n\n## AssemblyScript and Wasm3\n\n## Build AssemblyScript\n\n```\ncd wasm/clockenv # or wasm/gpsgsv or wasm/imu6886\nnpm install\n```\n\n**Web Browser Development**\n\n```\nnpm run asbuild:web\nnpm run start\n# http://localhost:1234/\n```\n\n**SPIFFS Build and Flash**\n\n```\nnpm run asbuild\ncd ../../\npython ${IDF_PATH}/components/spiffs/spiffsgen.py 0x10000 resources/wasm resources/spiffs_wasm.bin\nparttool.py write_partition --partition-name=wasm --partition-subtype=spiffs --input resources/spiffs_wasm.bin\n```\n\n## Dependencies\n\nThanks for all the open source.\n\n|Name|Version|License|\n|-|-|--|\n|[esp-idf](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32c3/get-started/index.html)|`release/v5.1`|BSD License|\n|[arduino-esp32](https://github.com/espressif/arduino-esp32/releases/tag/3.0.2)|`3.0.2`|LGPL-2.1 License|\n|[M5EPD](https://github.com/m5stack/M5EPD)|`0.1.5`|MIT License|\n|[UNIT_ENV](https://github.com/m5stack/UNIT_ENV)|`0.0.7`|MIT License|\n|[M5Unit-Sonic](https://github.com/m5stack/M5Unit-Sonic)|`0.0.2`|MIT License|\n|[Adafruit_GFX](https://github.com/adafruit/Adafruit-GFX-Library)|`1.11.9`|BSD License|\n|[Adafruit_BusIO](https://github.com/adafruit/Adafruit_BusIO)|`1.16.1`|MIT License|\n|[Adafruit-ST7735-Library](https://github.com/adafruit/Adafruit-ST7735-Library)|`1.10.4`|MIT License|\n|[tinyPNG](https://github.com/olliiiver/tinyPNG)|`0.11`|MIT License|\n|[lwgps](https://github.com/MaJerle/lwgps)|`v2.1.0`|MIT License|\n|[Wasm3](https://github.com/wasm3/wasm3)|master(`045040a9`)|MIT License|\n|[AssemblyScript](https://github.com/AssemblyScript/assemblyscript)|`0.27.29`|Apache-2.0 License|\n|[源真ゴシック](http://jikasei.me/font/genshin/)|-|SIL Open Font License 1.1|\n\n## License\n\nMIT License (includes PCB data and example source)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1romas4%2Fm5stamp-c3dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh1romas4%2Fm5stamp-c3dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1romas4%2Fm5stamp-c3dev/lists"}