Skip to content

6. Building and Flashing the LED Example

Achim Pieters edited this page Oct 17, 2024 · 1 revision

Configure the Project

  1. Start the Docker Container:
docker run -it -v ~/esp32-homekit-demo:/project -w /project espressif/idf:v5.2.2
  1. Navigate to the LED Example:
cd examples/led
  1. Set the Target to ESP32:
idf.py set-target esp32
  1. Open the Configuration Menu:
idf.py menuconfig
  1. Configure Wi-Fi Settings:
  • Go to Example Configuration.
  • Set your Wi-Fi SSID and Password.
  • Save and exit the configuration menu.

Build the Project

  1. Build the Application:
idf.py build
  • Wait for the build process to complete.

Flash the ESP32

  1. Open a New Terminal Window on Your Mac.
  2. Navigate to the LED Example Directory:
cd esp32-homekit-demo/examples/led
  1. Erase the Flash Memory:
esptool.py erase_flash
  1. Flash the Compiled Code:
esptool.py --chip esp32 --port /dev/tty.usbserial-XXXXXXXX --baud 460800 write_flash -z 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/esp32-homekit-demo.bin
  • Replace /dev/tty.usbserial-XXXXXXXX with your device's port name.
  1. Monitor the Serial Output (Optional):
screen /dev/tty.usbserial-XXXXXXXX 115200
  • Press Ctrl+A followed by K to exit the screen session.