{"id":18359668,"url":"https://github.com/fn-code/esp-idf-clion","last_synced_at":"2025-07-04T16:06:53.980Z","repository":{"id":209851233,"uuid":"388448292","full_name":"fn-code/esp-idf-clion","owner":"fn-code","description":"configuration and setup clion with esp-idf","archived":false,"fork":false,"pushed_at":"2023-04-01T15:56:46.000Z","size":1884,"stargazers_count":28,"open_issues_count":1,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T13:37:12.115Z","etag":null,"topics":["arduino","clion","esp","esp-clion","esp-idf","esp-idf-clion","esp32","esp32-arduino","esp8266","esp8266-arduino","espressif","platfomio"],"latest_commit_sha":null,"homepage":"","language":null,"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/fn-code.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}},"created_at":"2021-07-22T12:06:25.000Z","updated_at":"2025-01-17T15:54:14.000Z","dependencies_parsed_at":"2023-11-29T13:56:44.101Z","dependency_job_id":null,"html_url":"https://github.com/fn-code/esp-idf-clion","commit_stats":null,"previous_names":["fn-code/esp-idf-clion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fn-code/esp-idf-clion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fesp-idf-clion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fesp-idf-clion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fesp-idf-clion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fesp-idf-clion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fn-code","download_url":"https://codeload.github.com/fn-code/esp-idf-clion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fesp-idf-clion/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263573175,"owners_count":23482601,"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":["arduino","clion","esp","esp-clion","esp-idf","esp-idf-clion","esp32","esp32-arduino","esp8266","esp8266-arduino","espressif","platfomio"],"created_at":"2024-11-05T22:24:04.119Z","updated_at":"2025-07-04T16:06:53.956Z","avatar_url":"https://github.com/fn-code.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-clion\nconfiguration and setup clion with esp-idf\n\n## Install and setup esp idf\n1. Create directory esp\n```\nmkdir -p ~/esp\ncd ~/esp\ngit clone --recursive https://github.com/espressif/esp-idf.git\n```\n\n2. change directory to esp-idf\n```\ncd ~/esp/esp-idf\n```\n\n3. run script install.sh\n```\n./install.sh\n```\n\n## Set up a sample project using CLion\n\n1. Open clion IDE and make new project\n2. Setup clion toolchain and cmake configuration **Build, Execution, Deployment**\n\n    ### Setup clion toolchain\n    Select **Toolchains** and change C Compiler and C++ Compiler with esp-idf compiler\n\n    ![](images/1.png) \n\n    **Example :**\n\n    **C Compiler** = /Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc\n\n    **C++ Compiler** = /Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++\n\n      ### Setup clion CMake\n\n        \n      **1. Add IDF_PATH and PYTHON in CMake options**\n            **Example : **\n            \u003cbr\u003e\n            **-DIDF_PATH** = /Users/your_user/esp/esp-idf \n            \u003cbr\u003e\n            **-DPYTHON** = /Users/your_user/.espressif/python_env/idf4.4_py3.9_env/bin/python3.9\n            ![](images/2.png) \n\n      **2. Add IDF_PATH and PYTHON on Environment**\n            **Example : **\n            \u003cbr\u003e\n            **IDF_PATH**=/Users/ludinnento/esp/esp-idf\n            \u003cbr\u003e\n            **PYTHON**=/Users/ludinnento/.espressif/python_env/idf4.4_py3.9_env/bin/python3.9\n            ![](images/3.png)         \n\n      ### Setup Python Interpreter\n\n      **1. Select Python Interpreter**\n            ![](images/4.png) \n      **2. Add** \n            ![](images/5.png)\n      **3. Select System Interpreter**\n            ![](images/6.png)\n      **4. Search and choose python binary in .espressif/python_env/idf4.4_py3.9_env/bin/python3.9**\n            ![](images/7.png)\n    \n4. Create directory main\n\n    In this directory contain main.cpp or main.c of your esp program\n    \n    after create main.c/main.cpp, add another CMakeList.txt in this directory\n    ```\n    set(SOURCES \"main.cpp\")\n\n    idf_component_register(SRCS ${SOURCES}\n    INCLUDE_DIRS \"\")\n        \n    ```\n    \n5. Add CMakeList.txt inside application project\n\n    ```\n    cmake_minimum_required(VERSION 3.5)\n\n    include($ENV{IDF_PATH}/tools/cmake/project.cmake)\n\n    #set(CMAKE_FIND_ROOT_PATH /Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf)\n    set(CMAKE_C_COMPILER /Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc)\n    set(CMAKE_ASM_COMPILER /Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++)\n    set(CMAKE_C_COMPILER /Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc)\n\n    project(esp32t)\n\n    include_directories(\"src\")\n    ```\n6. Set up esp-idf environment variables\n    Open Clion Terminal, and running\n    ```\n    . $HOME/esp/esp-idf/export.sh\n    ```\n\n7. Set up project\n    In CLion terminal running : \n    ```\n    idf.py set-target esp32\n    ```\n    and\n    ```\n    idf.py menuconfig\n    ```\n    menuconfig used for configuration esp-idf \n\n7. Build esp project\n    In CLion terminal running : \n    ```\n    idf.py build\n    ```\n\n8. Flash\n     ```\n     idf.py -p ESP-PORT -b 115200 flash \n     ```\n\n9. Monitor\n    ```\n    idf.py -p ESP-PORT -b 115200 monitor  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffn-code%2Fesp-idf-clion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffn-code%2Fesp-idf-clion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffn-code%2Fesp-idf-clion/lists"}