M5Stack is developed and compiled on ubuntu

Description

The M5Stack development board uses an ESP32 chip, so if you want to establish a corresponding development environment, you can build an ESP32 development environment on ubuntu. Next, sort out how M5Stack develops and compiles on ubuntu.

Step 1: Install the necessary library files

For the development of esp32, you need to rely on some libraries.

sudo apt-get install git make gcc libncurses5-dev flex bison gperf python-serial

Step 2: Create a working directory

First create the project directory

mkdir esp32

Then create the project subdirectory

mkdir crossTools demos sources

Catalog description

crossTools: Cross compilation environment

demos: example

sources: SDK source code

The third step: cross-compilation environment download

You can download the xtensa-esp32-elf-linux64- cross-compilation environment on the official website, or download it on the console with wget.

wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0.tar.gz

After the download is complete, unzip it.

tar -zxvf xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0.tar.gz

Step 4: Add the compilation environment to environment variables

The function of this step is to perform global compilation

Modify the /etc/profile file

sudo vim /etc/profile

Add the directory of the cross-compilation environment that you decompressed at the end

E.g:

export PATH=$PATH:/home/bigmagic/work/esp32/crossTools/xtensa-esp32-elf/bin

Among them, /home/bigmagic/work/esp32/ is the directory on my computer, which can be modified according to my actual needs

After the configuration is complete, source the environment

source /etc/profile

Check if it is successful

xtensa-esp32-elf-gcc -v

The following screen comes out, indicating success

Step 5: Download the SDK code

Since Espressif's toolchain is used, SDK needs to be downloaded, first download esp-idf.

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

Also set environment variables

export IDF_PATH=/home/bigmagic/work/esp32/sources/esp-idf

Note that this also requires its own working directory and needs to be modified accordingly.

Finally update the environment

source /etc/profile

Step 6: Compile and configure

With the above cross-compilation tools and the corresponding SDK, then you can compile the project

Add the project file hello_world in the demo directory, the specific directory is in the following file

/XXX/esp32/sources/esp-idf/examples/get-started/hello_world

Transfer all the folders to the demo directory

Enter the hello_world folder and directly make menuconfig

There are three main points that need to be configured

(1) Cross compilation tool

(2) Set the print level of bootload

(3) Configure programming mode

After configuration, you can compile the firmware

make all -j8

Can be burned after compilation

make flash

The following error may be prompted

This is caused by insufficient access permissions for /dev/ttyUSB0

Increase the permission to burn

Analyze the serial port programming process, there are actually three parts

0 x1000 build/bootloader/bootloader.bin
0 x10000 hello-world.bin
0 x8000 partition_singleapp.bin

Start minicon to see

At this time, it means that the system has started and verified successfully.

to sum up

The advantage of using the ESP32 development environment on ubuntu is that the compilation is fast, and at the same time, it is more convenient to burn, but the editing code and downloading and debugging are not as good as windows. I personally think that it is more convenient to use the development and compilation environment of vscode+platform IO on the window.

Recommended Posts

M5Stack is developed and compiled on ubuntu
Install and configure MySQL on Ubuntu
Install Gnome and VNC on Ubuntu Server
Install docker on ubuntu and basic usage
Install fonts on Ubuntu and switch default fonts
Install and uninstall CUDA and CUDNN on Ubuntu
Deploy python3 and nginx projects on ubuntu18.04
How to install Pycharm and Ipython on Ubuntu 16.04/18.04
How to install and configure NATS on Ubuntu 16.04
Install JDK and configure environment variables on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
Install and use Git and GitHub on Ubuntu Linux
How to install and configure GitLab on Ubuntu 18.04
How to install and use Docker on Ubuntu 20.04
How to install and configure Ansible on Ubuntu 18.04
How to install and use Curl on Ubuntu 18.04
How to install and use Composer on Ubuntu 18.04
How to install and use Wine on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and use Composer on Ubuntu 20.04
How to install and use BaasBox on Ubuntu 14.04
How to install and configure VNC on Ubuntu 18.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure OrientDB on Ubuntu 14.04
How to install and use PostgreSQL on Ubuntu 16.04
How to install and configure AppScale on Ubuntu 12.04
How to install and use Docker on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to backup and restore Redis data on Ubuntu 14.04
How to create and use MongoDB backups on Ubuntu 14.04
Install win7 and archlinux on hard disk under ubuntu
How to install and use MySQL Workbench on Ubuntu 18.04
File transfer method between Windows and Ubuntu on VMware
Install Ubuntu on VMware virtual machine and install using UltraISO
How to install theano and keras on ubuntu system
Install and configure Mono production environment on Ubuntu Server
install vscode on ubuntu18
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Summary: Ubuntu Python2.x and
Install postgresql-10 on Ubuntu 18.04
Install docker on Ubuntu
Install Docker on ubuntu18.04
Ubuntu20.04 experience and beautification
Install nodejs10 on Ubuntu16
Ubuntu introduction and installation
[python] python2 and python3 under ubuntu
Install mysql on Ubuntu 14.04
Install Django on ubuntu
Install Pytorch+CUDA on Ubuntu 16.04
Install Python3 on Ubuntu 14.04
Install rJava on Ubuntu18
Install JDK10+ on Ubuntu
ROS learning---Install ROS on Ubuntu