Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MartyMacGyver/679ec4aa89608a1ca642d4dfb66572f3 to your computer and use it in GitHub Desktop.
Save MartyMacGyver/679ec4aa89608a1ca642d4dfb66572f3 to your computer and use it in GitHub Desktop.
Installing and running the Espressif ESP-IDF on Windows from master (e.g. to run with the ESP32-S3)
More documentation can be found at:
https://www.falatic.com/index.php/255/on-the-cutting-edge-with-the-esp32-s3
If you haven't done so already, install the following:
- Git for Windows (https://gitforwindows.org/)
- Python (https://www.python.org/) version 3.6 or later (3.10 is the latest that I've tested)
Open a normal command line window (cmd.exe or Windows Terminal) and follow along:
;: ########################################################################
;: ## Clone and get submodules for the ESP-IDF
;: ########################################################################
;: ## Ensure "C:\esp-idf" doesn't exist
cd /d C:\
git clone https://github.com/espressif/esp-idf
cd /d C:\esp-idf
;: ## Check out the bleeding edge code (or choose a commit or tag of interest e.g. ef98a36)
git checkout master
git pull
git submodule update --recursive --init
;: ## Useful commands when just trying to update (it can get complicated...)
git submodule foreach --recursive git reset --hard
git pull
git submodule update --recursive
;: ########################################################################
;: ## Install the toolchain
;: ########################################################################
cd /d C:\esp-idf
install.bat
;: ########################################################################
;: ## Set the environment
;: ########################################################################
cd /d C:\esp-idf
export.bat
;: ########################################################################
;: ## Set and test the serial port for the ESP32 device you have plugged in
;: ########################################################################
;: ## Set the port directly
set ESP32PORT=COM13
;: ## OR get the port programmatically (if this is the highest ESP32S3 port)
FOR /f "delims=[] tokens=1" %a in ('python -c "import serial.tools.list_ports;ports = [port for port in serial.tools.list_ports.comports() if port.vid==0x303A];print(f'{ports[-1][0]}')"') do (set ESP32PORT=%a)
;: Note: port.pid==0x1001 for the ESP32-S3-N8R2, 0x4001 for -N8R8
;: ## Test it out
espefuse.py -p %ESP32PORT% summary
espefuse.py -p %ESP32PORT% check_error
;: ########################################################################
;: ## Build and flash a project
;: ########################################################################
;: ## We'll use a sample project here, as if for the first time
;: ## Note that `set-target` REPLACES your sdkconfig file
cd /d C:\esp-idf\examples\get-started\blink
idf.py set-target esp32s3
idf.py menuconfig
idf.py build
idf.py -p %ESP32PORT% flash
;: ## Monitor - use Ctrl-] to exit
idf.py -p %ESP32PORT% monitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment