Various tips and reminders when developing for the ESP32.

Problem: Forgot how to program with idf.

Solution:

cd ~/esp/esp-idf
 . $HOME/esp/esp-idf/export.sh
idf.py -p /dev/ttyS9 -b 230400 flash monitor

Problem: forgot how to change flash size

--flash_size 2MB

Problem: Forgot how to use IDY to monitor serial port. (Ctrl-[ to exit)

idf.py -p /dev/ttyS9 -b 230400  monitor

Problem: A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header.

Solution 1: Press the BOOT button

Solution 2: Program with a slower speed --baud 115200

Problem nvs_flash_init() hanging for seemingly no reason:

ESP_ERROR_CHECK(nvs_flash_init());

Solution: Temporarily put a different project on the board, such as this wolfSSL benchmark:

cd ~/esp/esp-idf
 . $HOME/esp/esp-idf/export.sh

WORKSPACE=/mnt/c/workspace
THIS_PROJECT=my_wolfssl3

cp -r $IDF_PATH/examples/protocols/wolfssl_benchmark $THIS_PROJECT
cd $THIS_PROJECT
make