Question
make(编译)命令出现如下问题:
zorking@zorking-ideapad:~/esp/esp-adf/ai-examples/get-started/play_mp3$ make
/bin/sh: 1: xtensa-esp32-elf-gcc: not found
/bin/sh: 1: xtensa-esp32-elf-gcc: not found
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
Analysis
Warning解释为未找到工具链或路径。
补充:
- 工具链:按照程序本身先编译(如gcc)后链接(如ld)及后期处理的顺序,串起来的一整套工具。
- ESP-IDF:包含 ESP32 API 和用于操作 工具链 的脚本
Solution
ubuntu中设置工具链并加入PATH环境变量
- 需要先安装以下软件包:
sudo apt-get install gcc git wget make libncurses-dev flex bison gperf python python-serial
- 从 Espressif 的网站下载ESP32 工具链:
64-bit Linux:https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
32-bit Linux:https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz - 下载完成后,将它解压到
~/esp
目录,更新环境变量 PATH
export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"
- 检查 PATH 设置是否正确
printenv PATH
检查一下字符串的末尾是否包含类似的工具链的路径
$ printenv PATH
/home/user-name/bin:/home/user-name/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user-name/esp/xtensa-esp32-elf/bin
转载
https://blog.csdn.net/ustccw/article/details/80549885