Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:espidf [2023/10/03 11:26] – [Setup] darrontools:espidf [2024/10/02 00:38] (current) – [Setup] darron
Line 3: Line 3:
 EPS32 development environment. EPS32 development environment.
  
-Previously tested on Raspberry Pi 3.+Previously tested on Raspberry Pi 3 (armv7l / python 3.7.3)
  
 Recently tested on Raspberry Pi 400 (aarch64 / python 3.9.2). Recently tested on Raspberry Pi 400 (aarch64 / python 3.9.2).
  
-This a truly awful development environment.+ESP-IDF is truly awful.
  
 +=== Setup ===
  
 +Install various dependencies.
  
-=== Setup ===+<code> 
 +apt update 
 +apt full-upgrade 
 +apt install build-essential cmake git wget flex bison gperf python3 python3-venv python3-pip python3-setuptools python3-pyparsing ninja-build ccache libffi-dev libssl-dev dfu-util 
 +</code> 
 + 
 +Python3 will need to be the [[:tools:python|default]] version. 
 + 
 +=== User === 
 + 
 +Create a user for the home of the dev kit.
  
-Tools 
 <code> <code>
-apt-get update +useradd -d /home/esp -m esp
-apt-get dist-upgrade +
-apt-get install git wget flex bison gperf python3 python3-venv python3-pip python3-setuptools python3-pyparsing ninja-build ccache libffi-dev libssl-dev dfu-util+
 </code> </code>
  
-Python+Append paths to .profile 
 <code> <code>
-update-alternatives --remove-all python +vi ~esp/.profile
-update-alternatives --install /usr/bin/python python /usr/bin/python3 2 +
-update-alternatives --install /usr/bin/python python /usr/bin/python2 1 +
-update-alternatives --config python +
-python -V +
-Python 3.7.3+
 </code> </code>
  
-Fetch 
 <code> <code>
-cd /opt +IDF_PATH="$HOME/esp-idf" 
-git clone --recursive https://github.com/espressif/esp-idf.git+IDF_TOOLS_PATH="$HOME/esp-idf"
 </code> </code>
  
-Install+ 
 +=== Install=== 
 + 
 +Login as user esp 
 + 
 +<code> 
 +/bin/su - esp 
 +</code> 
 + 
 +Clone dev kit into home dir. 
 + 
 +<code> 
 +git clone --recursive https://github.com/espressif/esp-idf 
 +</code> 
 + 
 +Run installation script. 
 <code> <code>
-setenv IDF_PATH "/opt/esp-idf" +cd esp-idf
-setenv IDF_TOOLS_PATH "/opt/esp-idf" +
-cd /opt/esp-idf+
 sh install.sh sh install.sh
 </code> </code>
  
-Get path+Finalise installation 
 <code> <code>
-sh export.sh+. ~/esp-idf/export.sh
 </code> </code>
  
-Set path +If it complains about openocd... 
 <code> <code>
-setenv PATH "/opt/esp-idf/components/espcoredump:/opt/esp-idf/components/partition_table:/opt/esp-idf/components/app_update:/opt/esp-idf/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin:/opt/esp-idf/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin:/opt/esp-idf/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin:/opt/esp-idf/tools/xtensa-esp32s2-elf/esp-12.2.0_20230208/xtensa-esp32s2-elf/bin:/opt/esp-idf/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/opt/esp-idf/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin:/opt/esp-idf/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/opt/esp-idf/tools/openocd-esp32/v0.12.0-esp32-20230419/openocd-esp32/bin:/opt/esp-idf/python_env/idf5.2_py3.9_env/bin:/opt/esp-idf/tools:${PATH}"+/usr/bin/python3 /home/esp/esp-idf/tools/idf_tools.py export --prefer-system 
 +</code> 
 + 
 +Save the configuration 
 + 
 +<code> 
 +echo "~/esp-idf/export.sh" >> ~/.profile 
 +</code> 
 + 
 +Logout from user esp 
 + 
 +<code> 
 +exit 
 +</code> 
 + 
 +===Test=== 
 + 
 +Login as user esp 
 + 
 +<code> 
 +/bin/su - esp 
 +</code> 
 + 
 +Enter the hello world example dir 
 + 
 +<code> 
 +cd ~/esp-idf/examples/get-started/hello_world  
 +</code> 
 + 
 +Build 
 + 
 +<code> 
 +idf.py build
 </code> </code>
  
 === Resources === === Resources ===
 +
 +[[https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf|MCU reference manual]]
  
 [[https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html|Get Started with ESP-IDF]] [[https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html|Get Started with ESP-IDF]]
  
 +[[https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#get-started-linux-macos-first-steps|First project with ESP-IDF]]