{"id":20607474,"url":"https://github.com/loopj/gecko-sdk-cmake","last_synced_at":"2026-03-09T17:10:29.347Z","repository":{"id":261316341,"uuid":"883927424","full_name":"loopj/gecko-sdk-cmake","owner":"loopj","description":"CMake library targets for parts of the Silicon Labs Gecko SDK","archived":false,"fork":false,"pushed_at":"2025-03-21T21:38:02.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T22:28:11.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CMake","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/loopj.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":"2024-11-05T20:28:47.000Z","updated_at":"2025-03-21T21:38:06.000Z","dependencies_parsed_at":"2025-03-12T19:28:12.233Z","dependency_job_id":null,"html_url":"https://github.com/loopj/gecko-sdk-cmake","commit_stats":null,"previous_names":["loopj/gecko-sdk-cmake"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/loopj/gecko-sdk-cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Fgecko-sdk-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Fgecko-sdk-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Fgecko-sdk-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Fgecko-sdk-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopj","download_url":"https://codeload.github.com/loopj/gecko-sdk-cmake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopj%2Fgecko-sdk-cmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30303926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"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":[],"created_at":"2024-11-16T10:07:32.196Z","updated_at":"2026-03-09T17:10:29.317Z","avatar_url":"https://github.com/loopj.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMake Package for Gecko SDK\n\nThis package provides CMake library targets for parts of the Silicon Labs Gecko SDK, allowing you to use the SDK in your CMake projects without needing to use Simplicity Studio.\n\nAdditionally, the package includes toolchain files for ARM Cortex-M4 (Gecko Series 1 devices) and ARM Cortex-M33 (Gecko Series 2 devices) devices, and functions to generate binary, hex, s37, and gbl files from your target.\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Example](#example)\n- [Installation](#installation)\n  - [Using CPM](#using-cpm)\n  - [Using FetchContent](#using-fetchcontent)\n- [Configuration](#configuration)\n- [Available Library Targets](#available-library-targets)\n- [Toolchain Files](#toolchain-files)\n- [Artifact Generation](#artifact-generation)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Example\n\nSet the `GECKO_SDK_PATH` environment variable to the path of the Gecko SDK on your system:\n\n```bash\nexport GECKO_SDK_PATH=/path/to/your/gecko_sdk\n```\n\nDefine a `CMakeLists.txt` file in your project directory:\n\n```cmake\n# Set up the project\ncmake_minimum_required(VERSION 3.21)\nproject(flash_led)\n\n# Install the Gecko SDK package using CPM\ninclude(cmake/CPM.cmake)\nCPMAddPackage(\n  NAME GeckoSDK\n  GITHUB_REPOSITORY loopj/gecko-sdk-cmake\n  VERSION v1.0.0\n)\n\n# Define our executable target\nadd_executable(flash_led main.c)\n\n# Link against EMLIB from the Gecko SDK\ntarget_link_libraries(flash_led PRIVATE GeckoSDK::emlib)\n\n# Set the linker script\ntarget_link_options(serial_debug PRIVATE \"-T${CMAKE_CURRENT_LIST_DIR}/linkerfile.ld\")\n\n# Generate a flashable hex file for the target\ngecko_sdk_generate_hex(flash_led)\n```\n\nConfigure the build:\n\n```bash\ncmake -B build \\\n  -DGECKO_DEVICE=EFR32BG22C224F512GM32 \\\n  -DGECKO_CPU_FAMILY=EFR32BG22 \\\n  -DCMAKE_TOOLCHAIN_FILE=arm-cortex-m33.cmake\n```\n\nBuild the project:\n\n```bash\ncmake --build build\n```\n\nSee the [examples](examples) directory for example projects.\n\n## Installation\n\n### Using CPM\n\nYou can include this package in your project using the [CMake Package Manager](https://github.com/cpm-cmake/CPM.cmake):\n\n```cmake\ninclude(cmake/CPM.cmake)\n\nCPMAddPackage(\n  NAME GeckoSDK\n  GITHUB_REPOSITORY loopj/gecko-sdk-cmake\n  VERSION v1.0.0\n)\n```\n\n### Using FetchContent\n\nAlternatively, you can use CMake's plain `FetchContent` module:\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(\n  GeckoSDK\n  GIT_REPOSITORY https://github.com/loopj/gecko-sdk-cmake.git\n  GIT_TAG v1.0.0\n)\n\nFetchContent_MakeAvailable(GeckoSDK)\n```\n\n## Configuration\n\nThe following CMake variables are required:\n\n- `GECKO_SDK_PATH` - The path to the Gecko SDK, this can be set as an environment variable or passed as a CMake variable.\n- `GECKO_DEVICE` - The full Gecko SoC part number (e.g. \"EFR32BG22C224F512GM32\")\n- `GECKO_CPU_FAMILY` - The Gecko SoC CPU family (e.g. \"EFR32BG22\", \"EFR32MG1P\")\n\nIf using the `GeckoSDK::bsp`, `GeckoSDK::kit_drivers::retargetserial`, or `GeckoSDK::kit_drivers::retargetswo` library targets:\n\n- `GECKO_BOARD` - A pre-configured development board name (e.g. \"BRD4161A\") or\n- `GECKO_BOARD_CONFIG` - A path to custom board configuration (bsp) files\n\nIf you want to generate a `.gbl` firmware image using the `gecko_sdk_generate_gbl` function:\n\n- `SIMPLICITY_COMMANDER_PATH` - The path to the folder containing Simplicity Commander executable\n\n\u003e [!TIP]\n\u003e Using a `CMakePresets.json` file is a clean way to set these variables for your project.\n\n## Available Library Targets\n\nThe following library targets are currently available to link against:\n\n- `GeckoSDK::emlib` - The [EMLIB API](https://docs.silabs.com/gecko-platform/4.4.5/platform-peripherals-overview/) peripheral library\n- `GeckoSDK::rail_lib` - The [RAIL Library](https://docs.silabs.com/rail/latest/rail-api/) radio abstraction interface layer\n- `GeckoSDK::emdrv::gpioint` - The [GPIOINT Driver](https://docs.silabs.com/gecko-platform/4.4.5/platform-driver/gpioint)\n- `GeckoSDK::bsp` - The [Board Support Package](https://docs.silabs.com/gecko-platform/4.4.5/platform-driver/bsp) for device initialization, etc.\n- `GeckoSDK::kit_drivers::retargetserial` - The [Retarget Serial](https://docs.silabs.com/gecko-platform/4.4.5/platform-driver/retargetserial) kit driver.\n- `GeckoSDK::kit_drivers::retargetswo` - The [Retarget SWO](https://docs.silabs.com/gecko-platform/4.4.5/platform-driver/retargetswo) kit driver.\n- `GeckoSDK::bootloader::interface` - The [Bootloader Application Interface](https://docs.silabs.com/mcu-bootloader/latest/gecko-bootloader-api/interface).\n\nPull requests are welcome to add more library targets!\n\n## Toolchain Files\n\nToolchain files are provided for ARM Cortex-M4 and ARM Cortex-M33 devices.\n\nTo use these, copy the appropriate toolchain file from `cmake/toolchains` to your project directory and set the `CMAKE_TOOLCHAIN_FILE` variable to point to it.\n\n```bash\ncmake -DCMAKE_TOOLCHAIN_FILE=arm-cortex-m33.cmake ...\n```\n\nIf you are using a `CMakePresets.json` file, you can set the toolchain file in the `configurePreset` section:\n\n```json\n{\n  \"configurePreset\": {\n    \"toolchainFile\": \"arm-cortex-m33.cmake\"\n  }\n}\n```\n\n## Artifact Generation\n\nThis package also provides functions to generate binary, hex, s37, and gbl files from your target.\n\nThe following artifact generation functions are made available:\n\n```cmake\n# Generate a bin file from the target\ngecko_sdk_generate_bin(my_target)\n\n# Generate a hex file from the target\ngecko_sdk_generate_hex(my_target)\n\n# Generate an s37 file from the target\ngecko_sdk_generate_s37(my_target)\n\n# Generate a gbl (Gecko Bootloader) file from the target\n# This requires SIMPLICITY_COMMANDER_PATH to be set\ngecko_sdk_generate_gbl(my_target)\n```\n\n## License\n\nThis project is made available under the [MIT License](LICENSE), except where otherwise specified.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopj%2Fgecko-sdk-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopj%2Fgecko-sdk-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopj%2Fgecko-sdk-cmake/lists"}