윈도우보다 리눅스에서 ESP-IDF
설치가 더 쉬운거 같습니다.
우분투 기준으로 설치하는 방법을 설명했으며 타 OS는 아래 공식 문서를 참고하여 설치하시면 됩니다.
Standard Toolchain Setup for Linux and macOS - ESP32 - — ESP-IDF Programming Guide latest documentation
의존 프로그램 설치
우분투
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
맥
brew install cmake ninja dfu-util
파이썬을 설치합니다.
brew install python3
오류 해결 1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
오류 발생시 아래 명령어 입력
xcode-select --install
오류 해결 2
WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32-elf has no installed versions. Please run 'install.sh' to install it.
혹은
zsh: bad CPU type in executable: ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
M1 사용중인데 위 오류 발생시 아래 명령 입력
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
ESP-IDF 클론
GitHub - espressif/esp-idf: Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Espressif IoT Development Framework. Official development framework for Espressif SoCs. - GitHub - espressif/esp-idf: Espressif IoT Development Framework. Official development framework for Espress...
위 리포지트리를 클론하면 됩니다.
특정 버전을 설치하고자 하면 원하는 브랜치를 클론하면 됩니다.

mkdir -p ~/install/location
cd ~/install/location
git clone --recursive https://github.com/espressif/esp-idf.git
원하는 설치 위치에 폴더를 만들어서 리포지트리를 클론하면 됩니다.
하위 서브모듈도 가져와야 하기때문에 --recursive
옵션을 꼭 입력해 주세요
툴체인 설치
esp32
, esp32c6
, esp32s3
등 사용하는 모듈에 알맞은 툴체인을 설치해야 합니다.
cd ~/installed/esp-idf/path
./install.sh esp32s3
- 모든 툴체인 설치 -
./install.sh all
- 특정 툴체인 설치 -
./install.sh esp32s3
- 복수 툴체인 설치 -
./install.sh esp32s3, esp32c6
ESP-IDF 환경 실행
. $HOME/installed/esp-idf/path/export.sh
터미널에서 클론한 ESP-IDF
에 espoer.sh
를 실행하면 됩니다.
alias 설정
.profile
, .bashrc
, .zprofile
등의 설정파일 가장 아래줄에 아래처럼 alias
를 설정해줍니다.
alias get_idf='. $HOME/esp/esp-idf/export.sh'
자세한 내용은 아래 포스트를 참고해 주세요
ESP-IDF CLion 윈도우, 리눅스 더 쉽게 쓰는법
윈도우에서 ESP-IDF 사용하기ESP32 시리즈 SoC를 사용하기 위해서는 ESP-IDF 프레임워크를 사용하거나 아두이노 BSP를 올려 아두이노 코드를 실행시키는 방법이 있습니다. ESP를 아두이노로 사용하면 ESP의 모든 기능을 사용하기 어려우며, ESP의 모든 성능을 끌어내기 어렵습니다. ESP-IDF를 사용하기 위해서 PlatformIO 를 사용하거나, Eclipse, VS Code 에서 Esp 확장 플러그인을 설치하거나, 사용하시는 IDE에서 CMake 환경을 설정하는
