Invalid FQBN error whenever I try uploading my sketch to AI Thinker ESP32 -CAM

I had to downgrade my ESP core from 3.0.2 to 2.0.4 to run my edge impulse sketch. Now when I restart the software and try uploading the sketch on my AI Thinker ESP32-CAM, I get an error that reads:

Invalid FQBN: getting build properties for board esp32:esp32:esp32cam: invalid option ‘EraseFlash’

Compilation error: Invalid FQBN: getting build properties for board esp32:esp32:esp32cam: invalid option ‘EraseFlash’

I am using windows 11 and Arduino IDE 2.3.2 ESP32 Core for Arduino 2.0.4
Edge Impulse EI_STUDIO_VERSION_MAJOR 1
EI_STUDIO_VERSION_MINOR 53
EI_STUDIO_VERSION_PATCH 14

Hi @Bluepill

The “Invalid FQBN” error you’re encountering when trying to upload your sketch to the AI Thinker ESP32-CAM is related to the board definition in the Arduino IDE. The Fully Qualified Board Name (FQBN) specifies the board, and the error indicates that there is an issue with the board settings, specifically with the EraseFlash option.

Here are some steps you can take to resolve this issue:

1. Check Board Selection:

  • Ensure that you have selected the correct board in the Arduino IDE. Go to Tools > Board > ESP32 Arduino and select the appropriate board. For the AI Thinker ESP32-CAM, it should be something like AI Thinker ESP32-CAM.

2. Update or Reinstall ESP32 Board Core:

  • Sometimes, downgrading the core can lead to issues. Try reinstalling or updating the ESP32 core for Arduino.
  • Go to Tools > Board > Boards Manager, search for “esp32”, and make sure the correct version is installed. You might try reinstalling the 2.0.4 version or upgrading to a later version if possible.

3. Modify the Platform.txt File:

  • If the error persists, you might need to modify the platform.txt file in the ESP32 core directory to remove or correct the EraseFlash option.
  • Navigate to the Arduino core installation folder (e.g., C:\Users\YourUserName\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\), and open the platform.txt file.
  • Look for the line related to EraseFlash and make sure it matches the correct configuration for the 2.0.4 core. If you’re unsure, consider reverting any changes made to this file.

4. Clean and Rebuild the Project:

  • Sometimes, the build system might hold onto outdated settings. Clean the project by deleting the temporary files and then rebuild it.
  • In Arduino IDE, go to Sketch > Export Compiled Binary. This might force the IDE to refresh the build properties.

5. Use the Latest Arduino IDE:

  • Make sure your Arduino IDE is up to date. Sometimes, older versions of the IDE might not work well with certain board cores, leading to such errors.

6. Check for Known Issues:

  • Visit the GitHub repository for the ESP32 Arduino core to check if there are any known issues or bugs related to the EraseFlash option in version 2.0.4. If this is a known issue, there might already be a fix or a workaround posted.

Let me know what works and we can make a note for others.

Best

Eoin