Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for esp32s2 #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/ESP32FS.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import processing.app.Sketch;
import processing.app.tools.Tool;
import processing.app.helpers.ProcessUtils;
import processing.app.helpers.PreferencesMap;
import processing.app.debug.TargetPlatform;

import org.apache.commons.codec.digest.DigestUtils;
Expand Down Expand Up @@ -162,6 +163,12 @@ private long getIntPref(String name){
return parseInt(data);
}

private String getChip(){
PreferencesMap prefs = BaseNoGui.getTargetBoard().getPreferences();
String mcu = prefs.get("build.mcu", "esp32");
return mcu;
}

private void createAndUpload(){
long spiStart = 0, spiSize = 0, spiPage = 256, spiBlock = 4096;
String partitions = "";
Expand Down Expand Up @@ -368,9 +375,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", getChip(), "--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", getChip(), "--baud", uploadSpeed, "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "write_flash", "-z", "--flash_mode", flashMode, "--flash_freq", flashFreq, "--flash_size", "detect", ""+spiStart, imagePath});
}
}

Expand Down