{"id":15977009,"url":"https://github.com/tallamjr/discovery-book","last_synced_at":"2025-04-04T17:47:43.504Z","repository":{"id":71656997,"uuid":"301556530","full_name":"tallamjr/discovery-book","owner":"tallamjr","description":"Discovering the world of microcontrollers through Rust! 🦀","archived":false,"fork":false,"pushed_at":"2020-10-11T18:12:04.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T03:14:07.688Z","etag":null,"topics":["embedded-rust","iot","rust"],"latest_commit_sha":null,"homepage":"https://docs.rust-embedded.org/discovery/index.html","language":null,"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/tallamjr.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":"2020-10-05T22:38:49.000Z","updated_at":"2020-10-11T18:12:06.000Z","dependencies_parsed_at":"2023-05-13T09:45:09.178Z","dependency_job_id":null,"html_url":"https://github.com/tallamjr/discovery-book","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/tallamjr%2Fdiscovery-book","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fdiscovery-book/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fdiscovery-book/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallamjr%2Fdiscovery-book/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tallamjr","download_url":"https://codeload.github.com/tallamjr/discovery-book/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226199,"owners_count":20904464,"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":["embedded-rust","iot","rust"],"created_at":"2024-10-07T22:41:55.363Z","updated_at":"2025-04-04T17:47:43.471Z","avatar_url":"https://github.com/tallamjr.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discovery Book: Rust\n\nDiscovering the world of microcontrollers through Rust! 🦀\n\nThis repository is to hold code used and in conjunction with working through material in the\n_Discovery-Book_ for learning embedded rust.\n\n#### Getting Started: Testing the Hardware\n\n```bash\n$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg\nOpen On-Chip Debugger 0.10.0\nLicensed under GNU GPL v2\nFor bug reports, read\n        http://openocd.org/doc/doxygen/bugs.html\nInfo : auto-selecting first available session transport \"hla_swd\". To override use 'transport select \u003ctransport\u003e'.\nadapter speed: 1000 kHz\nadapter_nsrst_delay: 100\nInfo : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD\nnone separate\nInfo : Unable to match requested speed 1000 kHz, using 950 kHz\nInfo : Unable to match requested speed 1000 kHz, using 950 kHz\nInfo : clock speed 950 kHz\nInfo : STLINK v2 JTAG v37 API v2 SWIM v26 VID 0x0483 PID 0x374B\nInfo : using stlink api v2\nInfo : Target voltage: 2.896991\nInfo : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints\n\n```\n\n\u003e The microcontroller in the F3 has a Cortex-M4F processor in it. rustc knows how to cross compile to\n\u003e the Cortex-M architecture and provides 4 different targets that cover the different processor\n\u003e families within that architecture:\n\n\u003e - `thumbv6m-none-eabi`, for the Cortex-M0 and Cortex-M1 processors\n\u003e - `thumbv7m-none-eabi`, for the Cortex-M3 processor\n\u003e - `thumbv7em-none-eabi`, for the Cortex-M4 and Cortex-M7 processors\n\u003e - `thumbv7em-none-eabihf`, for the Cortex-M4F and Cortex-M7F processors\n\n\u003e Binary size is something we should always keep an eye on! How big is your solution? You can check\n\u003e that using the size command on the release binary:\n\n```bash\n$ # equivalent to size target/thumbv7em-none-eabihf/debug/led-roulette\n$ cargo size --target thumbv7em-none-eabihf --bin led-roulette -- -A\nled-roulette  :\nsection               size        addr\n.vector_table          392   0x8000000\n.text                16404   0x8000188\n.rodata               2924   0x80041a0\n.data                    0  0x20000000\n.bss                     4  0x20000000\n.debug_str          602185         0x0\n.debug_abbrev        24134         0x0\n.debug_info         553143         0x0\n.debug_ranges       112744         0x0\n.debug_macinfo          86         0x0\n.debug_pubnames      56467         0x0\n.debug_pubtypes      94866         0x0\n.ARM.attributes         58         0x0\n.debug_frame        174812         0x0\n.debug_line         354866         0x0\n.debug_loc             534         0x0\n.comment                75         0x0\nTotal              1993694\n\n$ cargo size --target thumbv7em-none-eabihf --bin led-roulette --release -- -A\nled-roulette  :\nsection              size        addr\n.vector_table         392   0x8000000\n.text                1826   0x8000188\n.rodata                84   0x80008ac\n.data                   0  0x20000000\n.bss                    4  0x20000000\n.debug_str          23334         0x0\n.debug_loc           6964         0x0\n.debug_abbrev        1337         0x0\n.debug_info         40582         0x0\n.debug_ranges        2936         0x0\n.debug_macinfo          1         0x0\n.debug_pubnames      5470         0x0\n.debug_pubtypes     10016         0x0\n.ARM.attributes        58         0x0\n.debug_frame          164         0x0\n.debug_line          9081         0x0\n.comment               18         0x0\nTotal              102267\n```\n\u003e Know how to read this output? The text section contains the program instructions. It's around 2KB\n\u003e in my case. On the other hand, the data and bss sections contain variables statically allocated in\n\u003e RAM (static variables). A static variable is being used in aux5::init; that's why it shows 4 bytes\n\u003e of bss.\n\n**Chapter 6: Hello World!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallamjr%2Fdiscovery-book","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftallamjr%2Fdiscovery-book","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallamjr%2Fdiscovery-book/lists"}