{"id":15398504,"url":"https://github.com/zero9178/mbed-support-for-clion","last_synced_at":"2025-04-16T01:44:16.626Z","repository":{"id":188026288,"uuid":"188723282","full_name":"zero9178/Mbed-Support-for-CLion","owner":"zero9178","description":"Plugin to support creating and developing Mbed OS projects in CLion","archived":false,"fork":false,"pushed_at":"2021-05-28T08:40:50.000Z","size":241,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T03:41:24.831Z","etag":null,"topics":["clion","mbed-cli","mbed-os"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/zero9178.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}},"created_at":"2019-05-26T19:28:52.000Z","updated_at":"2024-03-20T10:32:20.000Z","dependencies_parsed_at":"2023-08-13T11:26:04.518Z","dependency_job_id":null,"html_url":"https://github.com/zero9178/Mbed-Support-for-CLion","commit_stats":null,"previous_names":["zero9178/mbed-support-for-clion"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero9178%2FMbed-Support-for-CLion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero9178%2FMbed-Support-for-CLion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero9178%2FMbed-Support-for-CLion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero9178%2FMbed-Support-for-CLion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zero9178","download_url":"https://codeload.github.com/zero9178/Mbed-Support-for-CLion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182836,"owners_count":21226123,"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":["clion","mbed-cli","mbed-os"],"created_at":"2024-10-01T15:44:19.550Z","updated_at":"2025-04-16T01:44:16.607Z","avatar_url":"https://github.com/zero9178.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mbed Support for CLion\n\n## Content\n1. [Prerequisites](#prerequisites)\n2. [Features](#features)\n    1. [Project Creation](#project-creation)\n    2. [Project Import](#project-import)\n    3. [Project Configuration](#project-configuration)\n    4. [Changing Target](#changing-target)\n    5. [Build Modes](#build-modes)\n    6. [Compile Profiles](#profiles)\n    7. [Package Management](#package-management)\n3. [Tips for Development](#tips-for-development)\n4. [Known Issues/TODOs](#known-issuestodos)\n\n## Prerequisites\n\nFor the plugin to work, the mbed cli needs to present in the PATH or be explicitly specified in the settings under \n`Tools -\u003e Mbed`. For importing existing repositories from version control, git or mercurial are required.\n\nInstallers for Windows and Mac OS can be found at https://os.mbed.com/docs/mbed-os/v5.15/tools/installation-and-setup.html\nRecommended method of installation is using python's package manager pip, and the command `pip install mbed-cli`\n\n## Features\n### Project Creation\n\nNew Mbed projects can be created using CLions new project dialog. Simply select Mbed and enter a valid location in the \nright.\n\n![alt-text](https://i.imgur.com/d7qLPal.png \"New Project Menu\")\n\nAfter pressing the create button a new window will open and the plugin starts downloading the newest Mbed OS version \nfrom the Github repo. As soon as the download has finished a new dialog will appear asking which Mbed Target should be \nused. This option can be changed later at any time. \n\n![alt-text](https://imgur.com/UarcAWg.png \"Select Target Dialog\")\n\nAfter pressing okay a cmake project will be generated from the Mbed project and CLion should start indexing and \nupdating symbols. To further configure your project the file mbed_app.json has been created. To start programing\nthe file main.cpp has been created that already contains the main function of the program. \n\n### Project Import\n\nTo fetch existing Mbed projects from Git or Mercurial the `mbed import` functionality has been integrated into CLion.\nIn the `Get from Version Control` dialog simply select `mbed import` as Version Control and enter the URL to the \nrepository. \n\n![alt-text](https://imgur.com/CFbV6Hf.png \"mbed import Version Control\")\n\nFor importing examples provided by Mbed OS the repository name can be specified instead of the URL.\n\n![alt-text](https://imgur.com/6mZ7hjb.png \"mbed import repository names\")\n\nFor additional options such as branch, tag or commit hash see:\nhttps://os.mbed.com/docs/mbed-os/v5.15/tools/working-with-mbed-cli.html\n\nAfter pressing `Clone` the git or Mercurial repository will be downloaded. Once the download has finished the target \ndialog as seen in [Project Creation](#project-creation) will appear.\n\n### Project Configuration\n\nTo configure targets and features of Mbed OS the file `mbed_app.json` exists. The CMakeLists.txt that is generated when\ncreating a new project or importing existing ones is created by the mbed-cli after reading the mbed_app.json file. As the \nCMakeLists.txt file is overwritten each time the `mbed_app.json` file is changed, no changes should be done to it except\nadding new Sources. For the documentation on features and possible configurations see: \nhttps://os.mbed.com/docs/mbed-os/v5.15/reference/configuration.html\n\nThe plugin ships with a schema that provides Code Completion, documentation and checks for validity\nof the `mbed_app.json` file.\n\n![alt-text](https://imgur.com/WQHGm73.png \"Code completion in mbed_app.json\")\n\nAfter changes have been done the file a prompt will appear at the top, similar to the reload-prompt inside of \nCMakeLists.txt for normal C++ projects, and prompt to reload the Mbed project. A new CMakeLists.txt file is then created \nusing the configs in the `mbed_app.json` file.\n\n![alt-text](https://imgur.com/KmcQjF4.png \"Prompt to reload Mbed project\")\n\n### Changing Target\n\nThe Mbed target can be changed at any time in the project. Either right click the project root and select \n`Change Target Board` or go to `Build -\u003e Change Target Board`.\n\n![alt-text](https://imgur.com/DGtfAz7.png \"Change Target Board context menu\")\n\n### Build Modes\n\nBy default, code is compiled in debug mode with optimizations turned off. To switch to release mode and optimize\nfor size go to `Build -\u003e Switch to Release`. A dialog regenerating the cmake project should appear. Use the menu\n`Build -\u003e Switch to Debug` to switch back to unoptimized code.\n\n![alt-text](https://imgur.com/gvlNFsd.png \"Switch to Release context menu\")\n\n### Compile Profiles\n\nUsing profiles it is possible to change flags used for compilation of C, C++ and Assembly code as well as\nlinker flags. Mbed defines extra JSON files where one can set flags per supported toolchain. For further information\nsee: https://os.mbed.com/docs/mbed-os/v5.15/tools/build-profiles.html \n\nThe plugin provides a GUI for adding profiles that should be used during the build process. Simply open the settings \nand go to `Build, Execution, Deployement -\u003e Mbed Profiles`:\n\n![alt-text](https://i.imgur.com/U6W8lcg.png \"Settings menu for adding compilation profiles\")\n\nWhen pressing the `+` button a file dialog will appear allowing you to select a new profile to add. Using `-` removes\nthe selected profile. With the Edit button one can change the path of a profile. \n\n![alt-text](https://i.imgur.com/hNl4Yyq.png \"Adding a new profile\")\n\nIt is possible to add multiple profiles. Profiles added last  also add their builds flags last and can therefore\noverwrite options of previous profiles. Using the arrow buttons it is possible to change the order of the profiles.\n\nWhen you are done simply click `Apply` and the IDE will regenerate the project with the new build flags.\n\nAs soon as a JSON file is added as a profile, code completion and type checking and similar will be available in it.\n\n![alt-text](https://i.imgur.com/8GQe1pd.png \"Code completion and documentation inside of a profile\")\n\nWhen a profile in use changes, a suggestion to reload the project to apply the new flags appears.\n\n![alt-text](https://i.imgur.com/VwqEcwn.png \"Reload notification after a profile has been edited\")\n\n### Package Management\n\nFor managing Mbed OS packages a tool window labeled \"Mbed\" exists at the bottom of the screen. It provides a tree view\nof all dependencies of the project and allows changing the version of dependencies and sub dependencies. \n\n![alt-text](https://imgur.com/lZdZRyt.png \"Dependency tree toolwindow with version select\")\n\n## Tips for Development\n\n* Use Ninja instead of make: https://github.com/ninja-build/ninja Simply download the binary for your platform,\n add its location in the PATH and specify `-GNinja` in the CMake options in the Settings under \n `Build, Execution, Deployment -\u003e CMake`. Using Ninja instead of make leads to faster compile times for both incremental\n and full builds.\n* Enable Repository caching: Simply enter `mbed cache on` in a terminal to enable Repository caching. The mbed-cli will \n  then cache downloads of repositories and reuse them when possible. This allows for faster project creation as well as \n  creating new projects without an internet connection. \n  \n## Known Issues/TODOs\n* When working on Windows, and the base path of the project has too many characters the project may not compile.\n  This is due to the CMakeLists.txt file generated by the mbed-cli adding every folder in the project to the include-path,\n  leading to a compiler command exceeding Windows maximum number of 32768 characters. \n* Ability to remove and add packages will be added in the future\n* A prompt for the user to turn on Repository caching after project creation if it is turned off will be added in the future\n* Ability to check features of a specific target (such as if it has a lower power clock, etc.) will be added in the future. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero9178%2Fmbed-support-for-clion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzero9178%2Fmbed-support-for-clion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero9178%2Fmbed-support-for-clion/lists"}