What language is esp32 programmed in

As a developer, how to use esp32 chip for development?

First of all, we need to be clear: the Internet of things is a new field, its emergence, the traditional circuit, MCU, sensor and network are combined, so as to achieve the effect of things in the network, information remote transmission. So this field combines hardware engineer, embedded engineer and network engineer.

In order to facilitate these engineers to quickly learn and develop the Internet of things, esp32 supports a variety of development languages.

1. The first is C language. After all, esp32 has a 32-bit microcontroller, and when it comes to microcontroller programming, it is generally c language.

There are two kinds of development environment: one is programming in Linux environment, which is also recommended by Lexin (chip manufacturer) at the beginning. But in the Linux environment to do MCU program development, for domestic engineers, it is too anti-human, so there is a second.

Anxinke, a domestic company, made a package of Lexin’s chip and appeared in front of most domestic engineers in the form of module. At the same time, it optimizes the development environment and makes targeted settings on the basis of eclipse, which supports the development of esp8266 and esp32 under windows. The tool name is aithinkeride, and the latest version (April 2020) is 1.0, as follows:

What language is esp32 programmed in_

2. C / C + + language, platform using Arduino. It has to be said that Arduino, as an open source electronic platform, has developed to a relatively mature stage. In the beginning, Arduino only appeared as an electronic platform for teaching. But because it is open source, friendly, simple and easy to use, anyone without circuit and programming foundation can get started quickly through simple learning.

Now it has developed into a mature ecosystem, supporting mega, STM32, esp8266, esp32 and other types of microcontrollers.

The core of Arduino was written in C language in the early stage, and C language is process oriented programming. Later, the idea of object-oriented programming was introduced, so C / C + + mixed programming was used.

3. Lua language. Lua is a lightweight script language, which is written in standard C language and open in the form of source code. Its design purpose is to embed in the application, so as to provide flexible expansion and customization functions for the application.

If Lua is used in domestic development, nodemcu is the first one that comes to my mind. However, due to the imperfect IDE, firmware, module and other aspects of nodemcu at the present stage, there are many inexplicable error problems and few network data resources. The author suggests that playing is risky, and you should be careful when entering the pit.

4、Micropython。 Life is short. I use python. In order to face the microcontroller, micropython is introduced based on Python language. It can run on esp32. The syntax is the same as python. It is an interpretive language, simple and easy to understand. Especially when there is a need for domain name resolution and crawler, micropython is really easy to use.

In addition, there are JS and so on, which are less used, so let’s not talk about it.

So, which is the best way?

Here is a quote from a netizen on the Internet

Esp32 supports Lua, Arduino, microppython, JS, C, etc. it is recommended to use Arduino, and or Python for the rapid development of some small demo. There are many reference routines on the Internet, which are easy to use and can meet the general requirements. However, if it is to develop some applications with high performance requirements and more function ratios, it is recommended to use C and Lexin’s official ESP IDF, Yue Xin’s document is relatively powerful, and its technical support is relatively timely. Foreigners play this chip and play many applications on hackio. Recently, the official also released the speech recognition development framework and image recognition development framework of this chip. It is worth playing. The biggest advantage of this chip is that it is basically awesome. There are a lot of information on GitHub, and the official update is relatively timely.

Construction of SP32 development environment

1、 Download and set tool chain

2、 Getting esp-idf from GitHub

3、 Installation and configuration

4、 Compile and view running results

1、 Download and set tool chain

The way to quickly set up is to download the integrated toolchain and msys2 compressed file from dl.espressif.com.

After downloading, unzip and run msys32 / mingw32.exe to open a terminal window of msys2. The environment of this window is a bash shell. Create an ESP directory as the default address for developing esp32 applications.

First, open the following figure

What language is esp32 programmed in_ Construction of SP32 development environment

2、 Getting esp-idf from GitHub

Using git clone command to clone remote repository: Official GitHub

git clone –recursive https://github.com/espressif/esp-idf.git

It may be slow here. Wait patiently for the download to complete. The download is complete, which can be seen in F: / / msys32 / home / Haizi / ESP IDF

What language is esp32 programmed in_ Construction of SP32 development environment

3、 Installation and configuration

1、“IDF_ The “path” environment variable is set in the esp32 under the msys32 / etc / profile. D folder_ Add in toolchain.sh

export IDF_PATH=“F:\esp32_win32_msys2_\msys32\home\chenhai\esp-idf”

As shown in the figure below

What language is esp32 programmed in_ Construction of SP32 development environment

Configure IDF_ After the “path” environment variable, open mingw32.exe and enter the ESP IDF / examples / get started / Hello_ Compile in the world

Prompt error.

What language is esp32 programmed in_ Construction of SP32 development environment

This is because the dependent Python package has not been installed

Execute in mingw32

python -m pip install –user -r $IDF_ Path / requirements.txt install Python package

4、 Compile and view running results

After the installation and configuration are completed, you can compile. After the make menuconfig configuration is completed, you can exit and use make all to compile. The first compilation may take a long time.

After compiling, you can see the following prompt from the terminal

What language is esp32 programmed in_ Construction of SP32 development environment

Recommended reading:

Which is better, esp32 or STM32_ Esp32 vs. esp8266

Esp32 environment construction and entry programming_ Esp32 pin diagram

Leave a Reply

Your email address will not be published. Required fields are marked *