Esp32 Clion

  1. Esp32 Clion
  2. Clion Esp32 Idf
  3. Clion Esp32 Toolchain
  4. Clion Executable Not Specified

When using the ESP8266 you also meet the ESP-01 and his CH340G adapter. You can buy both at aliexpress.

27th April 2021 c, esp32, webserver I’m trying to follow this guide to learn how to make a web server for an engineering final project. I copied the code as originally provided, but the code had errors because it could not find the functions defined at the end, so I reordered them to be above.

  1. This plugin allow to develop an espressif ESP32 firmware inside CLion, allowing you to use all the advanced features of this IDE. It free you to hardcode the crosscompiler path into the PATH environment and to use the IDE for flashing the ESP32. You only have to set the espressif ESP32 sdk and crosscompiler paths into this plugin configuration.
  2. Some resources for using CLion to build ESP32 applications clion project #2 ESP32, ESP-IDF, CMake & CLion CMake with CLion – working! ESP32 Arduino Arduino Support. CLion + PlatformIO. CLion A first program with ESP8266/ESP-01, CLion and PlatformIO How to configure CLion Project #132 CLion and Arduino via Platform.IO CLion + Arduino.
  3. 首先,CLion新建工程页面,我们可以发现,多了一个PlatformIO的选项,直接点一下,就可以看到右边可以选择各种开发板和其框架. 这里我就选用DOIO ESP32 DEVKIT V1这块板子(其实我手里的不是官方版,这里面可能没有,但芯片一样就行),然后使用Arduino的框架.
  4. This video is a step by step guide to show how you start the project, configure it, compile, correct the errors, flash into the program memory and also flash.

The Arduino IDE does not support coding with autocomplete, so I decided to use CLion. First you have to download an install CLion. (Don’t forget – CLion is not free)

Clion esp32 cmake

Esp32 Clion

Now install the Arduino and SerialPorts plugins:

Next you have to install PlatformIO. Because of working on a MacBook, I used Homebrew.

Next ist to install the Serial-to-USB Driver for the CH340.

So, now the preparations are finished. Let’s start to create an new project.

mkdir Blink
cd Blink
platformio init --ide clion --board esp01

To know, which board to use, you can use

platformio boards

or

Clion Esp32 Idf

platformio boards espressif8266

So, now we check, if the connection to the ESP8266 is working:

Plug in the ESP8266 and the programmer, but don’t bridge anything with a wire. Choose the port and the baud rate.

Now you can use the AT-commands for testing the communication.

AT

AT+GMR

Now open the project in CLion and create a source file. Pay attention, that the file ends with .cpp and write a small program like listed below. Don’t forget to #include 'Arduino.h'

Wire the programmer like shown below

Connect it to the USP-port (maybe use a usb-hub for safety)
This small program comes from the examples in the Arduino-IDE (in the ESP8266-section):

Esp32Esp32 Clion

#include 'Arduino.h'
void setup() {
pinMode(BUILTIN_LED, OUTPUT);
}
void loop() {
digitalWrite(BUILTIN_LED, LOW);
delay(1000);
digitalWrite(BUILTIN_LED, HIGH);
delay(2000);
}

Clion Esp32 Toolchain

Now compile and upload the program:

For compiling and uploading you can also use the build-button , but never the run-button .

When you want to upload again, you have to plug of and plug in again (?).

Clion Executable Not Specified

Sources: