{"id":18823924,"url":"https://github.com/h1romas4/m5stack-core2-wasm3-as","last_synced_at":"2025-04-14T01:31:08.454Z","repository":{"id":80253161,"uuid":"472296493","full_name":"h1romas4/m5stack-core2-wasm3-as","owner":"h1romas4","description":"M5Stack Core2 with WebAssembly. Wasm3/AssemblyScript Demo","archived":false,"fork":false,"pushed_at":"2023-12-25T13:03:00.000Z","size":2428,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T15:47:40.660Z","etag":null,"topics":["assemblyscript","esp32","m5stack","m5stack-core2","wasm3","webassembly"],"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/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}},"created_at":"2022-03-21T10:54:41.000Z","updated_at":"2025-02-09T20:19:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a989409b-b06f-4491-b4e8-44f4a45a189b","html_url":"https://github.com/h1romas4/m5stack-core2-wasm3-as","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stack-core2-wasm3-as","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stack-core2-wasm3-as/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stack-core2-wasm3-as/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1romas4%2Fm5stack-core2-wasm3-as/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h1romas4","download_url":"https://codeload.github.com/h1romas4/m5stack-core2-wasm3-as/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248807496,"owners_count":21164694,"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":["assemblyscript","esp32","m5stack","m5stack-core2","wasm3","webassembly"],"created_at":"2024-11-08T00:55:02.719Z","updated_at":"2025-04-14T01:31:08.430Z","avatar_url":"https://github.com/h1romas4.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# m5stack-core2-wasm3-as\n\n![](https://github.com/h1romas4/m5stack-core2-wasm3-as/workflows/Build/badge.svg)\n\nM5Stack Core2(Xtensa) With Wasm3/AssemblyScript Demo.\n\n![Wasm1](https://raw.githubusercontent.com/h1romas4/m5stack-core2-wasm3-as/main/docs/images/m5stack-core2-01.jpg)\n\nSee also: RISC-V version\n\n\u003e [m5stamp-c3dev](https://github.com/h1romas4/m5stamp-c3dev)\n\u003e\n\u003e This is a development board for the M5Stamp C3 (RISC-V/FreeRTOS).\n\n## Twitter Video\n\n- [📼 Demo Clock](https://twitter.com/h1romas4/status/1609484777186553861)\n- [📼 Demo 3D Cube1](https://twitter.com/h1romas4/status/1609882456781623296)\n- [📼 Demo 3D Cube2](https://twitter.com/h1romas4/status/1610228824607985664)\n- [📼 Demo 3D Cube with IMU6886](https://twitter.com/h1romas4/status/1612348626248044544)\n\n## Build\n\n### Require\n\n- [Setup ESF-IDF v4.4.6](https://docs.espressif.com/projects/esp-idf/en/v4.4.6/esp32/get-started/index.html#installation-step-by-step)\n\nget_idf\n\n```\nalias get_idf='. $HOME/esp/esp-idf/export.sh'\n```\n\n```\n$ get_idf\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$ xtensa-esp32-elf-gcc -v\nUsing built-in specs.\nCOLLECT_GCC=xtensa-esp32-elf-gcc\nCOLLECT_LTO_WRAPPER=/home/hiromasa/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../libexec/gcc/xtensa-esp32-elf/8.4.0/lto-wrapper\nlto-wrapper\nTarget: xtensa-esp32-elf\n... snip ...\nThread model: posix\ngcc version 8.4.0 (crosstool-NG esp-2021r2-patch5)\n```\n\n### Build and Execute\n\n1. git clone and build\n\n```\ngit clone --recursive https://github.com/h1romas4/m5stack-core2-wasm3-as\ncd m5stack-core2-wasm3-as\nidf.py build\n```\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 ([WebAssembly Apps](https://github.com/h1romas4/m5stack-core2-wasm3-as/tree/main/wasm))\n\n```\nparttool.py write_partition --partition-name=wasm --partition-subtype=spiffs --input resources/spiffs_wasm.bin\n```\n\n5. Restart M5Stack Core 2\n\n```\nidf.py flash monitor\n```\n\n### Switch WebAssembly Apps\n\n```\nidf.py menuconfig\n```\n\n`WebAssembly Apps - Select WebAssembly Apps`\n\n![menuconfig](https://raw.githubusercontent.com/h1romas4/m5stack-core2-wasm3-as/main/docs/images/m5stack-core2-03.png)\n\n```\nidf.py build flash monitor\n```\n\n![Wasm2](https://raw.githubusercontent.com/h1romas4/m5stack-core2-wasm3-as/main/docs/images/m5stack-core2-05.jpg)\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 \"Center button\" after the startup logo.\n\n```\nidf.py monitor\n```\n\n## Build AssemblyScript\n\n```\ncd wasm/clockenv # or wasm/imu6886 or wasm/gpsgsv\nnpm install\n```\n\n**Web Browser Development**\n\n```\nnpm run asbuild:web\nnpm run start\n# http://localhost:1234/\n```\n\n**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## Note\n\n- Create SPIFFS parteation file\n\n```\n# for TrueType font\npython ${IDF_PATH}/components/spiffs/spiffsgen.py 0x100000 resources/font resources/spiffs_font.bin\n# for .wasm binary\npython ${IDF_PATH}/components/spiffs/spiffsgen.py 0x10000 resources/wasm 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-v4.4/esp32/get-started/index.html)|`v4.4.6`|BSD License|\n|[arduino-esp32](https://github.com/espressif/arduino-esp32)|`2.0.14`|LGPL-2.1 License|\n|[M5Core2](https://github.com/m5stack/M5Core2)|`0.1.8`|MIT License|\n|[M5EPD](https://github.com/m5stack/M5EPD)|`0.1.5`|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.22`|Apache-2.0 License|\n|[源真ゴシック](http://jikasei.me/font/genshin/)|-|SIL Open Font License 1.1|\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1romas4%2Fm5stack-core2-wasm3-as","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh1romas4%2Fm5stack-core2-wasm3-as","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1romas4%2Fm5stack-core2-wasm3-as/lists"}