{"id":17053097,"url":"https://github.com/bschwind/stm32-test","last_synced_at":"2025-06-14T17:36:05.505Z","repository":{"id":140637961,"uuid":"265011038","full_name":"bschwind/stm32-test","owner":"bschwind","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-03T08:24:04.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T17:51:47.006Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bschwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-05-18T17:24:45.000Z","updated_at":"2020-07-03T08:24:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"d907e866-6e74-499e-ac31-03f03c192921","html_url":"https://github.com/bschwind/stm32-test","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/bschwind%2Fstm32-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fstm32-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fstm32-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bschwind%2Fstm32-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bschwind","download_url":"https://codeload.github.com/bschwind/stm32-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245058728,"owners_count":20554163,"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":[],"created_at":"2024-10-14T10:11:20.561Z","updated_at":"2025-03-23T05:23:22.113Z","avatar_url":"https://github.com/bschwind.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Dependencies\n\n* [cargo, rustc](https://rustup.rs)\n* `stm32flash` (`brew install stm32flash`, `apt install stm32flash`, etc.)\n\n\n## Target STM32 Models\n\n(the following README steps target this chip)\n```\nSTM32F\n411CEU6\n```\n[Board Info](https://stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0)\n\n(I have some of these laying around, not tested yet)\n```\nSTM32F\n103C8T6\n```\n\n[Board Info](https://stm32-base.org/boards/STM32F103C8T6-Black-Pill)\n\n## Steps\n\n```\nrustup target add thumbv7em-none-eabihf\n```\n\n## Board Connection\n\nUsing a CP2102 (3.3v logic) or another USB-Serial converter, connect its `TX` to pin `A10` and its `RX` to pin `A9`.\nAlso connect 3.3v from the CP2102 to the 3.3v pin on the STM32, and do the same for ground.\nIf you try to power the STM32 from its USB C port without this power connection, it won't work.\n\n## Convert to BIN File\n\n`cargo build` will create an ARM ELF file, but we need it in a binary `.bin` format.\n\n### Install the Tools\n\n```\ncargo install cargo-binutils\nrustup component add llvm-tools-preview\n```\n\n### Create the BIN File\n\n```\ncargo objcopy --release -- -O binary stm32-test.bin\n```\n\n## Flash the BIN File\n\nOn the \"black pill\" board, hold down the `BOOT0` button, press and release `NRST` (reset button), then let get of `BOOT0` to get into flashing mode.\n\n```\nstm32flash -b 230400 -w stm32-test.bin -v /dev/cu.SLAB_USBtoUART\n```\n\n## Monitor Serial Output\n\nIn the spirit of doing everything in Rust, you can install a straightforward serial monitor via Cargo:\n\n```\ncargo install serial-monitor\n```\n\nSimply invoke it with `serial-monitor` and it will begin monitoring the first serial port it finds.\n\nYou can also pass it a specific device with\n\n```\nserial-monitor -p /dev/cu.SLAB_USBtoUART\n```\n\n## Makefile\n\nThe above commands are encapsulated in a Makefile.\n\n```bash\n# Build and flash the firmware\nmake flash\n\n# Monitor the serial output\nmake monitor\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbschwind%2Fstm32-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbschwind%2Fstm32-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbschwind%2Fstm32-test/lists"}