1. Construction steps
The following steps are based on the Ubuntu 16.04 LTS 32bit English version. Other Linux systems are similar, but there are no small details (such as package management software for yum, etc.).
ESP32 download requires USB serial port tool. Please ensure that your open board (ESP-DevkitC, NodeMCU-32S) integrates USB serial port function, or use USB to serial port tool. The default serial port descriptor in Linux is /dev/ttyUSB0. If the serial port you are using is not /dev/ttyUSB0, please modify the path when programming.
In the following example, the name of the linux user is ss, please replace it with your own linux username. In addition, the engineering and compilation tools are placed in the user's root directory, you can set to the appropriate location according to your actual situation.
It has been tested in the git project version of Xiongda as follows, and it is not excluded that the latest version has been improved:
Commit a8504d523214ee872ae480106e31cd1db138b74f
Author: Bernard Xiong
Date: Fri Aug 25 15:29:362017 +0800
1.1. Download Cross Compilation ToolsCd ~
Wgethttps://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-61-gab8375a-5.2.0.tar.gz
1.2. Uncompressing Cross Compilation ToolsTar -xzf xtensa-esp32-elf-linux32-1.22.0-61-gab8375a-5.2.0.tar.gz
1.3. Install the necessary softwareSudo apt-get install git wget make libncurses-devflex bison gperf python python-serial scons
1.4. Get the codeCd ~
Git clonehttps://github.com/BernardXiong/rtthread-esp-idf
Cd rtthread-esp-idf
Git submodule init
Git submodule update
Cd esp-idf-port/esp-idf
Git submodule init
Git submodule update
Git apply ../0001-cpu_start-patch.patch
Git apply ../0002-add-esp_task.h.patch
Git apply ../0003-add-memset-to-0.patch
1.5. Modify the path of the cross-compiler tool in the projectModify the path to exec_path in ~/rtthread-esp-idf/rtconfig.py to:
EXEC_PATH = r'/home/ss/xtensa-esp32-elf/bin'
Note that ss in the path is the username of the current Linux user.
1.6. CompilingFirst modify a small error in a Makefile, python line command path needs to be modified:
Pythonesp-idf-port/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32elf2image --flash_mode "dio" --flash_freq "40m"--flash_size "4MB" -ortthread.bin rtthread-esp32.elf
Then enter the project root directory to compile
Cd ~/rtthread-esp-idf
Make all
1.7. Download1) Since ordinary users under Linux do not have the right to directly operate /dev/ttyUSB0, first add the corresponding permissions to the current user, so that you do not need to use sudo permissions when programming later:
Sudo usermod -aG dialout ss
Note: ss is the username of the current Linux user.
Log out and log back in to the current user after the setup is complete. You no longer need to execute this command.
2) Modify the name of the serial port (/dev/ttyUSB0) in ~/rtthread-esp-idf/burn_flash.bat as follows:
Python esp-idf-port/esp-idf/components/esptool_py/esptool/esptool.py--chip esp32 --port /dev/ttyUSB0 --baud 115200 --before"default_reset" --after "hard_reset" write_flash -z --flash_mode "dio" --flash_freq "40m" --flash_size detect0x1000 bootloader.bin 0x10000 rtthread.bin 0x8000 partitions_singleapp.bin
3) Set the execution permission for burn_flash.bat:
Chmod a+xburn_flash.bat
4) Connect the development board to the computer (if it is a virtual machine, you need to connect the settings to the virtual machine), and if the development board does not support the one-key programming function, you usually need to press the button to enter the programming mode (simultaneous press) IO0 and reset, then loosen reset, then release IO0);
5) Execute the command to wait for the programming to complete:
Cd ~/rtthread-esp-idf
./burn_flash.bat
(Baud rate: 115200)
2. Other instructions 2.1. Cross-compilation tools for Linux64bit, Windows and macosSee https://github.com/BernardXiong/rtthread-esp-idf for details. There are other system cross-compiler download paths.
Note: You need to install GNU-compatible environment software such as MSYS2 under Windows.
2.2. Directory and documentationThe following figure shows the directory structure of rttthread-esp-idf:
among them:
The application directory is the code for the rtt application, where app_main() in main.c is the application entry function. You can modify and code here to familiarize yourself with and debug rtt programs.
The build directory is the directory used to compile the intermediate files, and the compiled .o.d is in this directory.
The componets directory is the directory where the rtt component code is saved. The components you write yourself can be placed here.
Doc is the introduction document for some uses and functions of the project.
The drivers directory is the directory where rtt is used to save the relevant code of the port driver. The existing ones include uart, gpio, i2c, psram, and so on.
The esp-idf-port directory is the modified code directory for the esp-idf port. Since rtt on esp32 is based on the esp official esp-idf port, the esp-idf code and porting patch are in this directory. The python toolkit for downloading and packaging images is also in this directory. If you need to use ESP32 deeper (such as using a custom partition structure, using FlashEncryption, etc.), you may need to configure changes in this directory.
Rt-thread is the directory of the rtt core kernel and related components, drivers and other code. If you need to understand or debug the rtt core functions, you can find, modify and debug in this directory.
Image file or its auxiliary files:
-bootloader.bin:Sespd's Second stagebootloader
-partitions_singleapp.bin: esp32 partition table data, the current rtt default is non-ota mirror.
-rttthread-esp32.bin:rtt on the target code of esp32.
-esp32.common.ld, esp32_out.ld, rtthread-esp32.elf, rtthread-esp32.map: intermediate files and script tools for compiling images.
Rtconfig.h, rtconfig_project : rtt configuration header file.
Sdkconfig.h :esp-idf configuration file
Rtconfig.py, rtconfig.pyc : rtt compiled python script.
Burn_flash.bat : Image burning script.
Kconfig, Makefile, mkbin.bat, SConscript, SConstruct : Various scripts for project compilation.
README.md : Project introduction.
- End -
ZGAR AZ MC Disposable
ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.
Our products include disposable e-cigarettes, rechargeable e-cigarettes, rechargreable disposable vape pen, and various of flavors of cigarette cartridges. From 600puffs to 5000puffs, ZGAR bar Disposable offer high-tech R&D, E-cigarette improves battery capacity, We offer various of flavors and support customization. And printing designs can be customized. We have our own professional team and competitive quotations for any OEM or ODM works.
We supply OEM rechargeable disposable vape pen,OEM disposable electronic cigarette,ODM disposable vape pen,ODM disposable electronic cigarette,OEM/ODM vape pen e-cigarette,OEM/ODM atomizer device.
Disposable E-cigarette, ODM disposable electronic cigarette, vape pen atomizer , Device E-cig, OEM disposable electronic cigarette
ZGAR INTERNATIONAL TRADING CO., LTD. , https://www.zgarvape.com