{"id":16239969,"url":"https://github.com/georgik/esp32-rust-multi-target-template","last_synced_at":"2025-07-14T04:34:46.101Z","repository":{"id":149997295,"uuid":"584417932","full_name":"georgik/esp32-rust-multi-target-template","owner":"georgik","description":"ESP32 Rust Bare Metal (no_std) Multi Target Template","archived":false,"fork":false,"pushed_at":"2023-03-03T09:47:26.000Z","size":110,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T19:55:37.443Z","etag":null,"topics":["accelerometer","bare-metal","cargo","display","esp32","esp32-c3","esp32-s2","esp32-s3","esp32-s3-box","m5stack","rust-lang","spi","template"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/georgik.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":"2023-01-02T14:08:32.000Z","updated_at":"2024-10-29T21:26:33.000Z","dependencies_parsed_at":"2023-05-23T08:00:36.535Z","dependency_job_id":null,"html_url":"https://github.com/georgik/esp32-rust-multi-target-template","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/georgik%2Fesp32-rust-multi-target-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgik%2Fesp32-rust-multi-target-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgik%2Fesp32-rust-multi-target-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgik%2Fesp32-rust-multi-target-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgik","download_url":"https://codeload.github.com/georgik/esp32-rust-multi-target-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006277,"owners_count":20382444,"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":["accelerometer","bare-metal","cargo","display","esp32","esp32-c3","esp32-s2","esp32-s3","esp32-s3-box","m5stack","rust-lang","spi","template"],"created_at":"2024-10-10T13:45:44.308Z","updated_at":"2025-03-19T16:31:42.961Z","avatar_url":"https://github.com/georgik.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 Rust Multi Target Template\n\nTemplate project for creating interactive apps with Rust Bare Metal (no_std) on ESP32.\nThe template contains also WASM and Desktop version which could help with faster implementation of concepts.\nEach target HW is in separate directory. Shared code is stored in `engine`.\n\n## Version of espflash\n\nUse `espflash 2.x` which supports also targets like ESP32-C6.\n\nInstallation:\n\n```\ncargo install espflash --git https://github.com/esp-rs/espflash.git\n```\n\n## Generate new project\n\n```\ncargo generate https://github.com/georgik/esp32-rust-multi-target-template.git\ncd project-name\n```\n\n## Build and flash\n\n### Build WASM version\n\n```\ncd wasm\nnpm install\nnpm run serve\n```\n\nOpen in web browser: https://localhost:8443.\n\nNote: https is required for access to accelerometer data - https://w3c.github.io/deviceorientation/#security-and-privacy . It's possible to run the app without accelerometer on http.\n\n### Build for ESP32-S3-BOX with ILI9486\n\nControl: IMU\n- tilt the board to move the character\n- move quickly up to perform the first action\n- move quickly down to perform second action\n\n```\ncd esp32-s3-box\ncargo espflash flash --release --monitor\n```\n\n### Build for ESP32-C6-DevKitM-1 with ILI9341\n\nControl: Not implemented\n\n```\ncd esp32-c6-devkit\ncargo espflash flash --release --monitor\n```\n\n### Build for ESP32-C3-DeviKit-RUST with ILI9341\n\nControl: IMU\n- tilt board to move character\n\n```\ncd esp32-c3-devkit-rust\ncargo espflash flash --release --monitor\n```\n\n#### Features\n\n- Embedded Graphics\n- Framebuffer\n- Random maze generator\n- IMU Accelerometer control\n\n### Build for dekstop\n\nControl: keyboard\n- press arrows or W,A,S,D to move the character\n- press Enter to perform action\n\n- macOS prerequisites:\n```\nbrew install SDL2\nexport LIBRARY_PATH=\"$LIBRARY_PATH:$(brew --prefix)/lib\"\n```\n\n- OpenSUSE Linux prerequisites:\n```\nsudo zypper install SDL2-devel\n```\n\n- run:\n```\ncd desktop\ncargo run\n```\n\n### Build for ESP32-S3-USB-OTG with ST7789\n\nControl: buttons\n- press button to move the character\n- press up \u0026 down to perform the first action\n- press ok \u0026 menu to perform the secomnd action\n\n```\ncd esp32-s3-usb-otg\ncargo espflash flash --release --monitor\n```\n\n### Build for ESP32-S2-USB-OTG with ST7789\n\nControl: buttons\n- press button to move the character\n- press up \u0026 down to perform the first action\n- press ok \u0026 menu to perform the second action\n\n```\ncd esp32-s2-usb-otg\ncargo espflash flash --release --monitor\n```\n\n### Build for M5STACK-FIRE with ESP32 and ILI9341\n\nHW: https://docs.makerfactory.io/m5stack/core/fire/\n\nControl: MPU-9250, buttons\n- tilt the board to move the character\n- move quickly up or press button C to perform the first action\n- move quickly down or press button B to perform the second action\n\n```\ncd m5stack-fire\ncargo espflash flash --release --monitor\n```\n\n#### Build M5STACK-FIRE using GitPod.io and run with Wokwi\n\n- Open in [GitPod.io](https://gitpod.io/github.com/georgik/esp32-spooky-maze-game)\n\n```\ncd m5stack-fire\n./run-wokwi.sh\n```\n\n- Wokwi project: https://wokwi.com/projects/350825213595746900\n\n#### Build M5STACK-FIRE using Codespaces and run with Wokwi\n\n- Navigate to [GitHub repository](https://github.com/georgik/esp32-spooky-maze-game)\n- Click Open, select Codespaces tab, click Create Codespace\n\n```\ncd m5stack-fire\n./run-wokwi.sh\n```\n\n#### Build M5STACK-FIRE and run Wokwi in local VS Code\n\nPreview: install VS Code Wokwi plugin (private beta available on request)\n\n```\ncd m5stack-fire\ncargo build --release --no-default-features --features \"wokwi\"\n```\n\nPress F1, select Wokwi: Start simulation\n\n### Build for M5STACK-CORE2 with ESP32 and ILI9342C\n\nHW: https://shop.m5stack.com/products/m5stack-core2-esp32-iot-development-kit\n\nControl: MPU6886\n\n```\ncd m5stack-core2\ncargo espflash flash --release --monitor\n```\n\n### Build for ESP32-S2-Kaluga v1.3\n\nHW: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-wrover-kit.html\n\nControl: buttons (partialy implemented based on of https://github.com/espressif/esp-bsp/blob/master/esp32_s2_kaluga_kit/esp32_s2_kaluga_kit.c#L59)\n- more details https://github.com/espressif/esp-bsp/blob/master/esp32_s2_kaluga_kit/include/bsp/esp32_s2_kaluga_kit.h#L299\n- K3-K6 to move the character\n- (not supported) press K5 button to perform the first action\n- (not supported) press K6 button to perform the second action\n\n```\ncd esp32-s2-kaluga\ncargo espflash flash --release --monitor\n```\n\nNote for older version 1.2 - GPIO6 is used to control backlight.\n\n### Build for ESP Wrover Kit\n\nHW: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-wrover-kit.html\n\nControl: limited, only one button available\n- it's not possible to move the character\n- press button Boot to to perform the first action\n\n```\ncd esp-wrover-kit\ncargo espflash flash --release --monitor\n```\n\n### Build for ESP32-S2 with ILI9341\n\nSee tag v0.1.0.\n\n```\ncargo espflash flash --release --target xtensa-esp32s2-none-elf --features esp32s2_ili9341 --monitor\n```\n\n## Development\n\nFollowing steps are useful for IDE integration, so that IDE can recognize which is your current target and fature set.\n\nCheck `target` configurad in the file `.cargo/config.toml`.\nIt should be one of following values:\n```\ntarget = \"xtensa-esp32-none-elf\"\ntarget = \"xtensa-esp32s2-none-elf\"\ntarget = \"xtensa-esp32s3-none-elf\"\ntarget = \"riscv32imac-unknown-none-elf\"\n```\n\nIf no value is selected, make sure to specify target on command line.\n\nCheck default `features` in `Cargo.toml`. Make sure that default set contains your board and display combinations.\n\nIf no value is selected, make sure to specify features on command line.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgik%2Fesp32-rust-multi-target-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgik%2Fesp32-rust-multi-target-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgik%2Fesp32-rust-multi-target-template/lists"}