๐ก ESP32 Series Compilation Document#
This document is suitable for the following chips:
esp32c3
esp32c2
esp32
esp32s3
Please confirm the following information before using this document:
You โprobably don`t needโ this document, which is an advanced document for self-expansion of firmware.
The firmware package we provide contains compiled firmware
If you just want to add your existing libraries to the firmware, you can use our Online Cloud Compilation to generate custom firmware.
If you are looking for application-oriented documents such as machine brushing/compiling lua scripts, then this document is
not what you need
to view.
Video tutorial link: Station B drinks porridge every day
Prepare the environment#
windows 10 x64
, Other versions solve idf installation problems by themselves, requiring idf5, the latest idf5!! The lower version cannot be compiled.!!All steps use
CMD
, notPowerShell
. If you don`t know what these are, please learn from Baidu first.At least 2G of disk space for code and intermediate files
Prepare the project#
Build a folder to store all the files needed for compilation.#
recommend use D:\github
, the minimum requirement is no spaces, Chinese, special strings, and as short as possible
Get source code#
Source code to 2 copies, LuatOS main library and [luatos-soc-idf5]((https://gitee.com/openLuat/luatos-soc-idf5), which are two different warehouses, both need!!
How to get it: recommend git and download zip after registration.
It must be placed according to the following directory structure, taking D:\gitee
as an example
D:\
github\
LuatOS\
lua\
luat\
components\
Other catalogs
luatos-soc-idf5\
luatos\
Checkpoint, if the path is correct, the following file path must exist. If it cannot be found, it must be a naming problem. It is futile to add it manually.
D:\github\LuatOS\lua\src\lgc.c
D:\github\luatos-soc-idf5\luatos\include\luat_conf_bsp.h
LuatOS
luatos-soc-idf5
They are all fixed directory names and cannot be changed. For example, โLuatOS-masterโ is a wrong name and must be changed back. LuatOS
If it is really inconvenient to put the main inventory in D:\github\LuatOS
, modify the value of LUATOS_ROOT in luatos-soc-idf5\luatos\CMakeLists.txt. For example, stored in E:/abc/LuatOS
, modify it
set(LUATOS_ROOT "E://abc/LuatOS/")
Final preparation before compilation#
Installation idf5
Access Address https://dl.espressif.cn/dl/esp-idf/
download idf5 offline installation package
ESP-IDF v5.1 - Offline Installer
After downloading, double-click to start, follow the prompts to install
After the installation is completed, the start menu will have a shortcut to idf5
Compile#
use the start menu or shortcut to enter the idf5 CMD
D:
cd D:\github\luatos-soc-idf5\luatos
idf.py fullclean
idf.py set-target esp32c3
idf.py build
๏ผidf.py set-target In order to set the chip to be compiled, enter the model you want to compile, and do not enter it without brains.esp32c3๏ผ
When the words Project build complete.
appears, it indicates that the compilation was successful and a file with. soc
will be generated. use the LuaTools to swipe the machine.
Libraries in Custom Firmware#
Open D:\github\luaotos-soc-idf5\luatos\include\luat_conf_bsp.h
to comment or uncomment as needed. Note that if the function is too large and the firmware cannot be placed, the compilation will fail.