{"id":15906100,"url":"https://github.com/mshr-h/pico-microtvm-standalone","last_synced_at":"2025-03-17T21:31:37.171Z","repository":{"id":108874300,"uuid":"434822760","full_name":"mshr-h/pico-microtvm-standalone","owner":"mshr-h","description":"A minimum microTVM standalone example for Raspberry Pi Pico","archived":false,"fork":false,"pushed_at":"2024-07-31T05:18:10.000Z","size":233,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T04:58:26.083Z","etag":null,"topics":["arm","cortex-m","microcontroller","microtvm","raspberry-pi-pico","rp2040","tvm"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mshr-h.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-04T06:08:34.000Z","updated_at":"2024-10-06T23:41:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0344f78-75f1-4af3-b6b7-bae22ae20699","html_url":"https://github.com/mshr-h/pico-microtvm-standalone","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"7f1f434683d18d17f15b27deb07ff05693c672af"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshr-h%2Fpico-microtvm-standalone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshr-h%2Fpico-microtvm-standalone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshr-h%2Fpico-microtvm-standalone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mshr-h%2Fpico-microtvm-standalone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mshr-h","download_url":"https://codeload.github.com/mshr-h/pico-microtvm-standalone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243886014,"owners_count":20363649,"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":["arm","cortex-m","microcontroller","microtvm","raspberry-pi-pico","rp2040","tvm"],"created_at":"2024-10-06T13:21:09.274Z","updated_at":"2025-03-17T21:31:36.896Z","avatar_url":"https://github.com/mshr-h.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microTVM example project for Raspberry Pi Pico\n\nThis is a very basic microTVM example for Raspberry Pi Pico.\n\n- TVM v0.17\n- Ubuntu 24.04\n- Python 3.12\n\n## Getting Started (Example for Ubuntu 24.04)\n\nInstall CMake and cross compiler.\n\n```bash\nsudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi\n```\n\nClone the repository.\n\n```bash\ngit clone https://github.com/mshr-h/pico-microtvm-standalone\ncd pico-microtvm-standalone\n```\n\nCreate python virtual env and install python dependencies.\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\nBuild and install TVM from source.\n\n```bash\ncd 3rdparty\n./build-tvm.sh\ncd ..\n```\n\nBuild model with TVM.\n\n```bash\npython build_module.py -m add.onnx\n```\n\nExtract tar and generate hexdumps.\n\n```\ntar xvf model_c.tar\nxxd -i graph_c.json \u003e graph_c.json.c\nxxd -i params_c.bin \u003e params_c.bin.c\n```\n\n- `graph_c.json.c`\n  - Hexdump for computational graph\n- `params_c.bin.c`\n  - Hexdump for the parameter of the graph\n- `lib0.c`\n  - Operator registry\n- `lib1.c`\n  - Compiled operators\n\nCopy the TVM runtime files from 3rdparty/tvm\n\n```bash\n./copy-tvm-crt.sh\n```\n\nFix some errors before building the code.\n\n```bash\npatch -p1 \u003c diff.patch\n```\n\nConfigure and build it.\n\nIf `PICO_SDK_PATH` environment variable isn't set, cmake will automatically download [pico-sdk](https://github.com/raspberrypi/pico-sdk) to the `build/_dep` directory.\n\n```bash\ncmake -S . -B build -G Ninja\ncmake --build build\n```\n\nConnect the Pico to the Host PC with pressing the BOOTSEL button.\n\nCopy the binary to Raspberry Pi Pico.\n\n```bash\ncp microtvm.uf2 /path/to/pico_storage\n```\n\nConnect to the Pico with UART. \nThe default baud rate is 115200.\n\nYou can see the inference result.\n\n## Additional resources\n\n- [raspberrypi/pico-examples](https://github.com/raspberrypi/pico-examples)\n- [raspberrypi/pico-sdk](https://github.com/raspberrypi/pico-sdk)\n- [Raspberry Pi Pico SDK: Raspberry Pi Pico SDK](https://raspberrypi.github.io/pico-sdk-doxygen/)\n- [Raspberry Pi Pico C/C++ SDK](https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-c-sdk.pdf)\n- [mshr-h/pico-cpp-minimum-example: A minimum C++ example for Raspberry Pi Pico](https://github.com/mshr-h/pico-cpp-minimum-example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshr-h%2Fpico-microtvm-standalone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmshr-h%2Fpico-microtvm-standalone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmshr-h%2Fpico-microtvm-standalone/lists"}