espressif / idf-clion-plugin

CLion plugin for ESP-IDF
18 stars 5 forks source link

ESP-IDF CLion Plugin

ESP-IDF CLion Plugin for ESP-IDF CMake based projects (4.x and above).

The source for the initial start of the plugin was taken from this project.

Table Of Contents

Configuration and Installation

To install the plugin, download the release zip file from the releases section. Unzip the file, but do not unzip the internal zip file. The product files are located in the root of the unzipped folder.

Start the CLion.

It is recommended to first configure the CLion using some example project

At this stage you have installed the plugin but since the plugin is in the beta versions, there are some configurations that are required to be done manually for IDF.

Creating New Project

idf_component_register(SRCS ${SOURCES} INCLUDE_DIRS "")


* Now add another CMakeList.txt in the project root
```cmake
cmake_minimum_required(VERSION 3.24)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(CMAKE_C_COMPILER C:/Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe)
set(CMAKE_ASM_COMPILER C:/Users/your_user/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe)

project(esp_idf_demo)
include_directories("src")

flash_edit.png
From the next screen you can add an environment variable as shown below for the port. flash_port.png

Serial Monitor

The serial monitor for this version is still a work in progress. You cannot run it from the monitor option in launch configurations at the moment. Although you can try to use the terminal in the CLion to run idf.py monitor command but make sure that your CLion is configured to use the default build directory since the default build directory in the CLion is different.

OpenOCD Debugging

ESP Debug Configuration is the newly added feature to support debugging using the OpenOCD. Please follow the below steps to configure.

clion_plugin_setup_10.png