# ESP32 The great great world of using an ESP32. ## Getting Started How to set up your computer for flashing the esp32. #### Installing the Flasher Just install the esp-idf flasher from the espressif website: [Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) Here are the explicit instructions for [Windows](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html) and [Linux or Mac](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html) As of April/2022 we are using the v4.4 release version of esp-idf. Other than specifying that all other install options should be default. #### Starting the Flasher and Getting to the Project This install creates two desktop shortcuts for using the flasher one for command prompt an done for powershell. Either will work. I (Eric) pinned the powershell one to my desktop to use later. You can not just use a normal command prompt or powershell instance with the flasher. Those shortcuts it made have a script that creates all the environment variables you need when it is launched and only for that session. To use the flashes just launch either shortcut and `cd` to the project folder. This is the folder above `main`. For LaresStability it is called `master`. Then inside this folder you can run the console commands to interact with that project. #### Notes on `menuconfig` With the change to this flasher (rather than msys32) we can now add the `sdkconfig` file to the git repo. This is because the flashing port is now a argument of the flash command rather than being stored in the `sdkconfig` file. Because of this you do not need to run `menuconfig` on any already created project. If you are starting a new project you will need to run `menuconfig` or just copy over the `sdkconfig` file from LaresStability. ## Console Commands **Just building with idf.py** It does not flash. Good for making sure your edits still build without sending it to the esp32. idf.py build **Flashing with idf.py plus start monitor** Once the esp32 is plugged into the computer by USB the port number can be found by using the Device Manager. To launch search "Device Manager" in the Windows start menu. This brings up a list of devices connected to your computer. The ESP will show up as (probably) the only device in the "Ports (COM & LPT)" section. On windows the port will be "COM[#]". On linux the port will start with "tty". You can get a list of connected devices with the `dmesg | grep tty` command. idf.py flash -p [port] monitor On some ESP's you will need to click and hold the flashing button on the ESP32 (Pulling IO0 to Ground) in order for the flashing to begin. The flasher will give you a bunch of `.......`'s until you do. On nicer ESP32's the USB to TTY chip will automatically pull IO0 down so you don't have to. **Get your esp-idf version (it should be v4.4)** idf.py --version #### Hardware Config Helper Links - [Tasks and Speed Optimization](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/performance/speed.html)