Skip to content

Commit 2f74bd9

Browse files
olegznvf-hollow
andauthored
article updates: working with ESP-IDF in CLion (#438)
* article: working with ESP-IDF in CLion * article updates: working with ESP-IDF in CLion * Update oleg-zinovyev.json * Update data/authors/oleg-zinovyev.json Co-authored-by: ESP-Kirill <[email protected]> --------- Co-authored-by: ESP-Kirill <[email protected]>
1 parent 5634352 commit 2f74bd9

File tree

3 files changed

+68
-63
lines changed

3 files changed

+68
-63
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22
title: "Oleg Zinovyev"
3-
date: 2025-03-04T16:53:50+02:00
43
---

content/blog/clion/index.md

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: "Working with ESP-IDF in CLion"
3-
date: 2025-03-04T16:53:32+02:00
3+
date: 2025-03-13T16:53:32+02:00
44
showAuthor: false
55
authors:
6-
- oleg-zinovyev
6+
- "oleg-zinovyev"
77
tags:
88
- ESP32-S3
99
- ESP-IDF
@@ -22,7 +22,7 @@ We’ll use the following hardware:
2222

2323
- ESP32-S3-DevKitC-1 v1.1.
2424
- MacBook Pro M2 Max.
25-
- USB-C to mini USB cable.
25+
- USB-C to micro USB data cable.
2626

2727
To get started:
2828

@@ -54,34 +54,34 @@ src="img/2-esp-clion-manage-toolchains.webp"
5454
>}}
5555

5656
6. Click `+`, and select `System` (for Windows, select `MinGW` instead) to create a new toolchain. You can name it anything you like.
57-
- Select `Add environment` > `From file` in the new toolchain template.
57+
- Select `Add environment` > `From file` in the new toolchain template.
5858

59-
{{< figure
60-
default=true
61-
src="img/3-esp-clion-add-environment.webp"
62-
>}}
59+
{{< figure
60+
default=true
61+
src="img/3-esp-clion-add-environment.webp"
62+
>}}
6363

64-
- Click `Browse...`.
64+
- Click `Browse...`.
6565

66-
{{< figure
67-
default=true
68-
src="img/3.1-esp-clion-add-environment-browse.webp"
69-
>}}
66+
{{< figure
67+
default=true
68+
src="img/3.1-esp-clion-add-environment-browse.webp"
69+
>}}
7070

71-
- Select the environment file on your computer. For macOS, you need the file called `export.sh` (on Windows, it’s `export.bat`), which is located in the default ESP-IDF directory.
72-
- Click `Apply`
71+
- Select the environment file on your computer. For macOS, you need the file called `export.sh` (on Windows, it’s `export.bat`), which is located in the default ESP-IDF directory.
72+
- Click `Apply`
7373

7474
7. Go to `Settings` > `Build, Execution, Deployment` > `CMake`.
75-
- In the default `Debug` profile settings, select the recently created toolchain, which in our case is `ESP-IDF`.
75+
- In the default `Debug` profile settings, select the recently created toolchain, which in our case is `ESP-IDF`.
7676

77-
{{< figure
78-
default=true
79-
src="img/4-esp-clion-cmake.webp"
80-
>}}
77+
{{< figure
78+
default=true
79+
src="img/4-esp-clion-cmake.webp"
80+
>}}
8181

82-
- In the `CMake options` field, enter `-DIDF_TARGET=esp32s3` (because an ESP32-S3-based board is used).
83-
- In the `Build directory` field, enter `build`.
84-
- Click `OK`.
82+
- In the `CMake options` field, enter `-DIDF_TARGET=esp32s3` (because an ESP32-S3-based board is used).
83+
- In the `Build directory` field, enter `build`.
84+
- Click `OK`.
8585

8686
Your project will then start to load. If the process fails, click `Reset and Reload Project` in the CMake tool window settings.
8787

@@ -96,23 +96,21 @@ If the project is loaded successfully, you’ll see `[Finished]` at the end of t
9696

9797
1. Make sure your board is connected to your computer via the UART port.
9898
2. If you’re using the same application example, make sure that the GPIO LED number is correctly specified in the source code:
99-
- In CLion’s `Project` tool window, locate the main directory in your project directory and open the `led_strip_example_main.c` file.
100-
- In the `#define RMT_LED_STRIP_GPIO_NUM` line, change the default value to `38` or `48`, depending on your board hardware revision.
99+
- In CLion’s `Project` tool window, locate the main directory in your project directory and open the `led_strip_example_main.c` file.
100+
- In the `#define RMT_LED_STRIP_GPIO_NUM` line, change the default value to `38` or `48`, depending on your board hardware revision.
101101

102-
{{< figure
103-
default=true
104-
src="img/6-esp-clion-gpio-num.webp"
105-
>}}
102+
{{< figure
103+
default=true
104+
src="img/6-esp-clion-gpio-num.webp"
105+
>}}
106106

107-
3. Click the `Run / Debug Configurations` drop-down list on the main toolbar and select the `flash` configuration.
107+
3. Click the `Run / Debug Configurations` drop-down list on the main toolbar and select the `flash` configuration. This configuration allows you to build the project and then flash the board automatically.
108108

109109
{{< figure
110110
default=true
111111
src="img/7-esp-clion-flash-target.webp"
112112
>}}
113113

114-
This configuration allows you to build the project and then flash the board automatically.
115-
116114
4. Click the green `Build` icon on the main IDE toolbar.
117115

118116
{{< figure
@@ -147,16 +145,16 @@ src="img/11-esp-clion-add-config.webp"
147145
>}}
148146

149147
3. Select the `Shell Script` template. In this new configuration dialog:
150-
- Enter a name of your choice.
151-
- Select `Script text` next to `Execute`.
152-
- Enter the following text, including the path of the environment file you’ve just copied: `. /Users/Oleg.Zinovyev/esp/esp-idf/export.sh ; idf.py flash monitor`.
148+
- Enter a name of your choice.
149+
- Select `Script text` next to `Execute`.
150+
- Enter the following text, including the path of the environment file you’ve just copied: `. /Users/Oleg.Zinovyev/esp/esp-idf/export.sh ; idf.py flash monitor`.
153151

154-
{{< figure
155-
default=true
156-
src="img/12-esp-clion-flash-monitor.webp"
157-
>}}
152+
{{< figure
153+
default=true
154+
src="img/12-esp-clion-flash-monitor.webp"
155+
>}}
158156

159-
- Leave the rest of the options as they are and click `OK`.
157+
- Leave the rest of the options as they are and click `OK`.
160158

161159
4. Click the green `Run` icon on the main toolbar.
162160

@@ -181,23 +179,23 @@ default=true
181179
src="img/14-esp-clion-copy-config.webp"
182180
>}}
183181

184-
- Rename the copied configuration to reflect the new functionality, for example, `ESP-menu-config`.
185-
- In the script text, replace `flash monitor` with `menuconfig`.
182+
3. Rename the copied configuration to reflect the new functionality, for example, `ESP-menu-config`.
183+
4. In the script text, replace `flash monitor` with `menuconfig`.
186184

187185
{{< figure
188186
default=true
189187
src="img/15-esp-clion-menu-config.webp"
190188
>}}
191189

192-
3. Click `OK`.
193-
4. Make sure the IDE’s new terminal is disabled (unchecked), as the project configuration menu may not work properly with it.
190+
5. Click `OK`.
191+
6. Make sure the IDE’s new terminal is disabled (unchecked), as the project configuration menu may not work properly with it.
194192

195193
{{< figure
196194
default=true
197195
src="img/17-esp-clion-menu-config-terminal.webp"
198196
>}}
199197

200-
5. Click the green `Run` icon on the main toolbar.
198+
7. Click the green `Run` icon on the main toolbar.
201199

202200
The project configuration menu will open in the IDE’s terminal.
203201

@@ -264,28 +262,28 @@ src="img/23-esp-clion-generic-template.webp"
264262

265263
7. Here, you need to specify several parameters, some of which depend on your board. For this tutorial, we’ll use the following:
266264

267-
- `GDB Server` > `Executable`: `/Users/Oleg.Zinovyev/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/bin/openocd`
268-
- `GDB Server` > `Arguments`: `-f board/esp32s3-builtin.cfg`
265+
- `GDB Server` > `Executable`: `/Users/Oleg.Zinovyev/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/bin/openocd`
266+
- `GDB Server` > `Arguments`: `-f board/esp32s3-builtin.cfg`
269267

270-
{{< figure
271-
default=true
272-
src="img/24-esp-clion-gdb-server-options.webp"
273-
>}}
268+
{{< figure
269+
default=true
270+
src="img/24-esp-clion-gdb-server-options.webp"
271+
>}}
274272

275-
- The `Device Settings` are as follows:
273+
- The `Device Settings` are as follows:
276274

277-
{{< figure
278-
default=true
279-
src="img/25-esp-clion-device-settings.webp"
280-
>}}
275+
{{< figure
276+
default=true
277+
src="img/25-esp-clion-device-settings.webp"
278+
>}}
281279

282-
- `Debugger` > `Custom GDB Executable`: `/Users/Oleg.Zinovyev/.espressif/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin/xtensa-esp32s3-elf-gdb`
283-
- `Debugger` > `Connection` > `Arguments`: `tcp::3333`
280+
- `Debugger` > `Custom GDB Executable`: `/Users/Oleg.Zinovyev/.espressif/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin/xtensa-esp32s3-elf-gdb`
281+
- `Debugger` > `Connection` > `Arguments`: `tcp::3333`
284282

285-
{{< figure
286-
default=true
287-
src="img/26-esp-clion-debugger-options.webp"
288-
>}}
283+
{{< figure
284+
default=true
285+
src="img/26-esp-clion-debugger-options.webp"
286+
>}}
289287

290288
Also, it’s best to disable the `Persistent session` option on the `Debugger` tab, as it can be unstable.
291289

data/authors/oleg-zinovyev.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "Oleg Zinovyev",
3+
"bio": "Technical and content writer at JetBrains",
4+
"social": [
5+
{ "linkedin": "https://www.linkedin.com/in/oleg-znv" },
6+
{ "github": "https://github.com/olegznv" }
7+
]
8+
}

0 commit comments

Comments
 (0)