# Esp32 Lyrat-v4.3 Ubuntu20.04(18.04)环境配置---中文版本 此配置文档适用于**Ubuntu20.04(18.04)版本**。 若使用的是macos,可以参考本文进行配置,但请进一步查阅参考文档中针对macos的部分。 ## esp-idf release-v4.2 ### 参考文档: [esp-idf release-v4.2](https://docs.espressif.com/projects/esp-idf/en/release-v4.2/esp32/get-started/linux-setup.html) ### 步骤: #### 1. Install Prerequisites >sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util #### 2. Download esp-idf release-v4.2 ```bash mkdir ~/esp cd ~/esp git clone -b release/v4.2 --recursive https://github.com/espressif/esp-idf.git ``` #### 3. Set up the tools ```bash cd ~/esp/esp-idf ./install.sh esp32 ``` #### 4. Create environment variables ```bash nano ~/.bashrc ``` Add the following line to the end of the configuration file ```bash alias get_idf='. $HOME/esp/esp-idf/export.sh' ``` (可以顺便把adf的path也配置了) ```bash export ADF_PATH="$HOME/esp/esp-adf" ``` To apply the changes immediately, you can either close and reopen your terminal or run the following command to refresh the configuration: ```bash source ~/.bashrc ``` Than you can try "get_idf" in any terminal `get_idf` ## esp-adf release-v2.5 ### 参考文档: [esp-adf release-v2.5](https://github.com/espressif/esp-adf/releases) ### 步骤: #### 1. Download esp-adf: **Edited version**: [禁用过板载麦克风的版本---HeadFi请下载这个版本!](https://drive.google.com/file/d/1zDsPAsfRmpvW6Ek6pxpXtqIvydnE6lUp/view?usp=sharing) ```bash cd ~/Downloads # 切换到下载目录 unzip esp-adf-v2.5.zip -d ~/esp # 解压缩文件到 ~/esp 目录 ``` Raw version: ```bash cd ~/esp git clone https://github.com/espressif/esp-adf.git esp-adf-v2.5 cd esp-adf-v2.5 git checkout v2.5 git submodule update --init --recursive ``` #### 2. Create environment variables ```bash cd ~/esp mv ~/esp/esp-adf-v2.5 ~/esp/esp-adf nano ~/.bashrc ``` Add the following line to the end of the configuration file to set ADF_PATH: ```bash export ADF_PATH="$HOME/esp/esp-adf" source ~/.bashrc ``` #### 3. Apply the pitch file in esp-idf ```bash cd ~/esp/esp-idf git apply $ADF_PATH/idf_patches/idf_v4.2_freertos.patch ``` ## Build and Flash #### 1. 以examples中的*pipeline_recording_to_sdcard project*为例 ```bash cd ~/esp cp -r esp-adf/examples/recorder/pipeline_recording_to_sdcard ~/esp/ cd pipeline_recording_to_sdcard ``` ```bash get_idf idf.py set-target esp32 ``` #### 2. **Setting encorder:** Example Configuration --> Encoding.. --> acc ```bash idf.py menuconfig ```   ### If you see this error ``` (base) qiu@qiu-MS-7B89:~/esp/pipeline_recording_to_sdcard$ idf.py build ESP-IDF v4.2.5-1-g5f8de192fa-dirty 'cmake' must be available on the PATH to use /home/qiu/esp/esp-idf/tools/idf.py ``` Please install cmake on your computer: > sudo apt-get install cmake #### 3. **Build the project:** ```bash idf.py build ``` #### 4. **Flashing Firmware:** Default(baud rate = 115200): ```bash idf.py -p /dev/ttyUSB0 flash monitor ``` Set baud rate: ```bash idf.py -p /dev/ttyUSB0 -b 115200 flash monitor ``` 出现connecting的字样后,按住boot,再点击reset就可以开始烧录(开始烧录后两个按钮都可以松开)。 #### * **Exit monitor:** `control + ]` #### * **Check port number:** `dmesg | grep tty` #### * **PermissionError: [Errno 13] Permission denied:** '/dev/ttyUSB0' > sudo chmod a+rw /dev/ttyUSB0
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up