From f8fc175f1f20c7b3d006a05152d0313baa9ba5f5 Mon Sep 17 00:00:00 2001
From: me-no-dev <hristo@espressif.com>
Date: Mon, 6 Mar 2023 16:04:18 +0200
Subject: [PATCH 1/2] Add support for all chips

---
 src/ESP32FS.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ESP32FS.java b/src/ESP32FS.java
index ce165eb..793df9b 100644
--- a/src/ESP32FS.java
+++ b/src/ESP32FS.java
@@ -359,6 +359,7 @@ private void createAndUpload(){
       else
         sysExec(new String[]{espota.getAbsolutePath(), "-i", serialPort, "-p", "3232", "-s", "-f", imagePath});
     } else {
+      String mcu = BaseNoGui.getBoardPreferences().get("build.mcu");
       String flashMode = BaseNoGui.getBoardPreferences().get("build.flash_mode");
       String flashFreq = BaseNoGui.getBoardPreferences().get("build.flash_freq");
       System.out.println("[SPIFFS] address: "+spiStart);
@@ -368,9 +369,9 @@ private void createAndUpload(){
       System.out.println("[SPIFFS] freq   : "+flashFreq);
       System.out.println();
       if(esptool.getAbsolutePath().endsWith(".py"))
-        sysExec(new String[]{pythonCmd, esptool.getAbsolutePath(), "--chip", "esp32", "--baud", uploadSpeed, "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "write_flash", "-z", "--flash_mode", flashMode, "--flash_freq", flashFreq, "--flash_size", "detect", ""+spiStart, imagePath});
+        sysExec(new String[]{pythonCmd, esptool.getAbsolutePath(), "--chip", mcu, "--baud", uploadSpeed, "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "write_flash", "-z", "--flash_mode", flashMode, "--flash_freq", flashFreq, "--flash_size", "detect", ""+spiStart, imagePath});
       else
-        sysExec(new String[]{esptool.getAbsolutePath(), "--chip", "esp32", "--baud", uploadSpeed, "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "write_flash", "-z", "--flash_mode", flashMode, "--flash_freq", flashFreq, "--flash_size", "detect", ""+spiStart, imagePath});
+        sysExec(new String[]{esptool.getAbsolutePath(), "--chip", mcu, "--baud", uploadSpeed, "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "write_flash", "-z", "--flash_mode", flashMode, "--flash_freq", flashFreq, "--flash_size", "detect", ""+spiStart, imagePath});
     }
   }
 

From 9ef3bcd665b8f9dd227f3eac8b966861cfe5e5a4 Mon Sep 17 00:00:00 2001
From: me-no-dev <hristo@espressif.com>
Date: Mon, 6 Mar 2023 16:04:42 +0200
Subject: [PATCH 2/2] Update make.sh

---
 make.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/make.sh b/make.sh
index 0fa059a..843a4ed 100755
--- a/make.sh
+++ b/make.sh
@@ -3,11 +3,15 @@
 if [[ -z "$INSTALLDIR" ]]; then
     INSTALLDIR="$HOME/Documents/Arduino"
 fi
+if [[ -z "$IDEDIR" ]]; then
+    IDEDIR="/Applications/Arduino.app/Contents/Java/"
+    #IDEDIR="../../../"
+fi
 echo "INSTALLDIR: $INSTALLDIR"
 
-pde_path=`find ../../../ -name pde.jar`
-core_path=`find ../../../ -name arduino-core.jar`
-lib_path=`find ../../../ -name commons-codec-1.7.jar`
+pde_path=`find $IDEDIR -name pde.jar`
+core_path=`find $IDEDIR -name arduino-core.jar`
+lib_path=`find $IDEDIR -name commons-codec-1.7.jar`
 if [[ -z "$core_path" || -z "$pde_path" ]]; then
     echo "Some java libraries have not been built yet (did you run ant build?)"
     return 1
@@ -19,7 +23,7 @@ echo "lib_path: $lib_path"
 set -e
 
 mkdir -p bin
-javac -target 1.8 -cp "$pde_path:$core_path:$lib_path" \
+/Library/Java/JavaVirtualMachines/openlogic-openjdk-8.jdk/Contents/Home/bin/javac -target 1.8 -cp "$pde_path:$core_path:$lib_path" \
       -d bin src/ESP32FS.java
 
 pushd bin