ESP-IDF (Espressif IoT Development Framework)

 

VSCode und ESP32

VSCode Extension

https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md

Bild1

 

idf.py

Ein command-line tool managed folgende Tools:

  • CMake, which configures the project to be built

  • Ninja which builds the project

  • esptool.py for flashing the target.

Terminalbefehle

 

>idf.py build

>idf.py –p com7 make flash monitor

oder die Schnittstelle über die Umgebungsvariable ESPPORT setzen

oder Schnittstelle über die Extension ESP-IDF in VSCode setzen: >F1 >select port to use   (Ctrl+E+P)

>F1 >ESP-IDF:set espressive device Target

Wichtige Kommandos

>idf.py monitor

Abbrechen mit CTRL+T x

>ctrl+shift+P   oder >F1

Debugging

Es gibt eine JTAG-Schnittstelle, die auf eine USB-Buchse verdrahtet ist (Pin 19 und 20).

https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/DEBUGGING.md

PlatformIO

PlatformIO.INI for new Framework

[env:adafruit_feather_esp32s3_nopsram]
platform = espressif32
board = adafruit_feather_esp32s3_nopsram
framework = arduino
monitor_speed = 115200
build_flags = -DARDUINO_USB_MODE=1
platform_packages =
   platformio/framework-arduinoespressif32 @ https://github.cof/ardui.git

 

Achtung! Platformio für Esp32 wird nicht weitergeführt, ein Fork ermöglicht das Debuggen in Linux (u.A. Python2.7 Fehler behoben)

[env:esp32s3usbotg]
;platform = espressif32
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
board = esp32s3usbotg
framework = arduino
monitor_speed = 115200
;debug_tool = esp-prog

Probleme

1. USB Upload funktioniert nicht

Thx to Max1220 @ https://github.com/espressif/openocd-esp32/issues/262

 

Error: libusb_open() failed with LIBUSB_ERROR_ACCESS

Error: esp_usb_jtag: could not find or open device!

Turns out that was a permission issue for me:

cat << EOF | sudo tee /etc/udev/rules.d/70-esp32s3-jtag.rules

ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="0660", GROUP="plugdev", TAG+="uaccess"

EOF

sudo udevadm control --reload-rules && sudo udevadm trigger