{"id":41306774,"url":"https://github.com/oliverlee/cortex_m","last_synced_at":"2026-01-23T05:04:58.101Z","repository":{"id":40258885,"uuid":"492983427","full_name":"oliverlee/cortex_m","owner":"oliverlee","description":"Bazel rules and utilities for Cortex-M","archived":false,"fork":false,"pushed_at":"2025-09-02T21:09:44.000Z","size":1413,"stargazers_count":0,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-02T22:10:15.682Z","etag":null,"topics":["bazel","c","cortex-m","cpp","embedded","gdb","nix","qemu"],"latest_commit_sha":null,"homepage":"","language":"Starlark","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/oliverlee.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-16T20:05:07.000Z","updated_at":"2025-09-02T21:03:58.000Z","dependencies_parsed_at":"2025-08-26T02:27:14.641Z","dependency_job_id":"87e8fc63-9874-469a-89e7-b3abcc6b8793","html_url":"https://github.com/oliverlee/cortex_m","commit_stats":null,"previous_names":["oliverlee/cortex_m"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oliverlee/cortex_m","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlee%2Fcortex_m","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlee%2Fcortex_m/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlee%2Fcortex_m/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlee%2Fcortex_m/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverlee","download_url":"https://codeload.github.com/oliverlee/cortex_m/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverlee%2Fcortex_m/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28680623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T04:33:33.518Z","status":"ssl_error","status_checked_at":"2026-01-23T04:33:30.433Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bazel","c","cortex-m","cpp","embedded","gdb","nix","qemu"],"created_at":"2026-01-23T05:04:58.042Z","updated_at":"2026-01-23T05:04:58.093Z","avatar_url":"https://github.com/oliverlee.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tools for building and testing for Cortex-M with Bazel\n\n\u003cdetails\u003e\u003csummary\u003egif\u003c/summary\u003e\n\n![usage](gifs/usage.gif)\n\n\u003c/details\u003e\n\n# building\n\nAn elf can be built for a target platform by specifying the platform\n\n```sh\nbazel build \\\n  --platforms=@cortex_m//platform:lm3s6965evb \\\n  \u003cbinary\u003e\n```\n\nwhere `\u003cbinary\u003e` is a `cc_binary` target.\n\nSupported platforms provide generic startup code associated with the default\nregistered toolchain.\n\n# running with `qemu`\n\nAn elf can be run with `qemu-system-arm`. This requires an installation of `nix`\nto download the `qemu` package.\n\n```sh\nbazel run \\\n  --run_under=@cortex_m//:qemu_runner \\\n  --platforms=@cortex_m//platform:lm3s6965evb \\\n  \u003cbinary\u003e -- \u003cqemu-args\u003e\n```\n\nBy default, the QEMU runner sets the machine to match the target platform.\nAdditional arguments can be passed to `qemu-system-arm` after `--` (e.g., the\nGDB connection or to freeze CPU at startup).\n\n# enabling semihosting\n\nBy default, semihosting is not enabled when building targets. It can be enabled\nwith bool flag `--@cortex_m//config:semihosting`.\n\n```sh\nbazel run \\\n  --run_under=@cortex_m//:qemu_runner \\\n  --platforms=@cortex_m//platform:lm3s6965evb \\\n  --@cortex_m//config:semihosting \\\n  \u003cbinary\u003e\n```\n\n# running tests with `qemu`\n\n`cc_test` targets can be built for the target platform and run under emulation\nwith a CcTestRunner that uses `qemu-system-arm`. This runner is registered by\ndefault. Note that `--@cortex_m//config:semihosting` must be passed so that elf\nis built with semihosting enabled.\n\n```sh\nbazel test \\\n  --platforms=@cortex_m//platform:lm3s6965evb \\\n  --@cortex_m//config:semihosting \\\n  //...\n```\n\n# flagless builds\n\n`transition_config_binary` and `transition_config_test` can be used to\ntransition a binary target to always enable or disable semihosting, set the\ntarget platform, and specify extra toolchains.\n\n```starlark\nload(\n    \"@cortex_m//rules:transitions.bzl\",\n    \"transition_config_binary\",\n    \"transition_config_test\",\n)\n\ntransition_config_binary(\n    name = \"binary\",\n    src = \":_binary\",\n    semihosting = \"enabled\",\n    platform = \"@cortex_m//platform:lm3s6965evb\",\n)\n\ntransition_config_test(\n    name = \"test\",\n    src = \":_test\",\n    platform = \"@cortex_m//platform:lm3s6965evb\",\n)\n```\n\n# developing\n\nDeveloping requires `bash`, `nix`, and coreutils on the `$PATH` to bootstrap\nthe Nix shell application used in `tools/bazel`. On NixOS, enable [nix-ld] or\nuse an [FHS environment] (e.g., see the [flake](./flake.nix) used by garnix ci).\n\n[nix-ld]: https://github.com/nix-community/nix-ld\n[FHS environment]: https://nixos.org/manual/nixpkgs/stable/#sec-fhs-environments\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverlee%2Fcortex_m","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverlee%2Fcortex_m","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverlee%2Fcortex_m/lists"}