Skip to content

Commit 92b4956

Browse files
committed
Added messages to console about chip type
Modified README
1 parent 4651830 commit 92b4956

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ and uploads the image to ESP32 flash memory.
1414
## Notes for LittleFS
1515

1616
- Same partition scheme as SPIFFS
17-
- Until implemented to esp-32 core needs extra library
18-
- See [LITTLEFS esp32 library](https://github.com/lorol/LITTLEFS) for more details
19-
- You need an additional [mklittlefs tool](https://github.com/earlephilhower/mklittlefs) . Download the [release](https://github.com/earlephilhower/mklittlefs/releases) or find it [archived at latest release here](https://github.com/lorol/arduino-esp32fs-plugin/releases )
17+
- Until fully implemented to esp-32 core, it needs an extra library.
18+
It is already considered for next core releases. The mklittlefs tool is provided from there.
19+
- For reference see [LITTLEFS esp32 library](https://github.com/lorol/LITTLEFS) for more details
20+
- If you need the [mklittlefs tool](https://github.com/earlephilhower/mklittlefs) download the [release](https://github.com/earlephilhower/mklittlefs/releases) or find it [archived at previous releases here](https://github.com/lorol/arduino-esp32fs-plugin/releases )
2021
- Copy **mklittlefs[.exe]** to **/tools** folder of esp32 platform where **espota** and **esptool** (.py or.exe) tools are located
2122

2223
## Notes for FatFS
2324

2425
- Go to Arduino IDE menu: ***Tools > Partition Scheme*** and select an entry with FAT partition
25-
- You need additional binary files for Windows or Linux, thanks [@lbernstone](https://github.com/lbernstone) for compiling - or take them from the author [here - mkfatfs tool](https://github.com/labplus-cn/mkfatfs/releases/tag/v1.0) , thanks to [labplus-cn](https://github.com/labplus-cn/mkfatfs) or take from [archived at latest release here](https://github.com/lorol/arduino-esp32fs-plugin/releases )
26-
- Copy **mkfatfs[.exe]** to **/tools** folder of esp32 platform where **espota** and **esptool** (.py or.exe) tools are located
26+
- If not provided by the core, you may need additional binary files for Windows or Linux, thanks [@lbernstone](https://github.com/lbernstone) for compiling - or take them from the author [here - mkfatfs tool](https://github.com/labplus-cn/mkfatfs/releases/tag/v1.0) , thanks to [labplus-cn](https://github.com/labplus-cn/mkfatfs) or take from [archived previous release here](https://github.com/lorol/arduino-esp32fs-plugin/releases )
27+
- If missing, you need to copy **mkfatfs[.exe]** to **/tools** folder of esp32 platform where **espota** and **esptool** (.py or.exe) tools are located
2728
- The usable size of FAT partition is reduced with 1 sector of 4096 bytes (0x1000) to resolve wear leveling space requirement. The image file is flashed with +4096 bytes (0x1000) offset of partition address of csv table entry
2829
- You may need to decrease **maxOpenFiles** at FFat.begin() of your sketch , [see this note](http://marc.merlins.org/perso/arduino/post_2019-03-30_Using-FatFS-FFat-on-ESP32-Flash-With-Arduino.html)
2930
>The FFAT module uses 8KB plus 4KB per concurrent file that can be opened. By default, it allows 10 files to be opened, which means it uses 48KB. IF you want to reduce its memory use, you can tell it to only support one file, and you will save 36KB, leaving you with only 12KB used.
@@ -39,7 +40,7 @@ if (!FFat.begin(0, "", 1)) die("Fat FS mount failed. Not enough RAM?");
3940
- In your Arduino sketchbook directory, create tools directory if it doesn't exist yet.
4041
- Unpack the tool into tools directory (the path will look like ```<home_dir>/Arduino/tools/ESP32FS/tool/esp32fs.jar```).
4142
- Make sure you have **mklittlefs[.exe]** and **mkfatfs[.exe]** available at **/tools** folder or in sub-folder there
42-
- See at [latest release](https://github.com/lorol/arduino-esp32fs-plugin/releases) for copies of archived binaries in question.
43+
- For reference, see at [previous releases](https://github.com/lorol/arduino-esp32fs-plugin/releases) for copies of archived binaries in question.
4344
- You can also use provided **package_esp32_index.template.json** to run **get.py** with it and download the missing binary files
4445
- Restart Arduino IDE.
4546

@@ -52,6 +53,7 @@ if (!FFat.begin(0, "", 1)) die("Fat FS mount failed. Not enough RAM?");
5253
- Select ***Tools > ESP32 Sketch Data Upload*** menu item.
5354
- On drop-down list, select SPIFFS, LittleFS or FatFS you want to make from your /data folder.
5455
- Clicking OK should start uploading the files into ESP32 flash file system.
56+
- Last entry **!Erase Flash!** allows to clean the entire flash if necessary.
5557

5658
When done, IDE status bar will display the status of Image Uploaded message. Might take a few minutes for large file system sizes.
5759

src/ESP32FS.java

+20-20
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ private void createAndUpload(){
170170

171171
if (typefs == "FatFS") spiOffset = 4096;
172172

173-
if(!PreferencesData.get("target_platform").contentEquals("esp32")){
173+
System.out.println("Chip : " + getChip());
174+
175+
if(!PreferencesData.get("target_platform").contains("esp32")){
174176
System.err.println();
175177
editor.statusError(typefs + " Not Supported on "+PreferencesData.get("target_platform"));
176178
return;
@@ -399,8 +401,7 @@ private void createAndUpload(){
399401
System.out.println("[" + typefs + "] speed : "+uploadSpeed);
400402
System.out.println("[" + typefs + "] mode : "+flashMode);
401403
System.out.println("[" + typefs + "] freq : "+flashFreq);
402-
System.out.println();
403-
404+
System.out.println();
404405
if(esptool.getAbsolutePath().endsWith(".py"))
405406
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});
406407
else
@@ -410,8 +411,8 @@ private void createAndUpload(){
410411

411412

412413
private void eraseFlash(){
413-
414-
if(!PreferencesData.get("target_platform").contentEquals("esp32")){
414+
System.out.println("Chip : " + getChip());
415+
if(!PreferencesData.get("target_platform").contains("esp32")){
415416
System.err.println();
416417
editor.statusError(typefs + " Not Supported on "+PreferencesData.get("target_platform"));
417418
return;
@@ -491,12 +492,24 @@ private void eraseFlash(){
491492
System.out.println("Port: "+serialPort);
492493
System.out.println();
493494
if(esptool.getAbsolutePath().endsWith(".py"))
494-
sysExec(new String[]{pythonCmd, esptool.getAbsolutePath(), "--chip", "esp32", "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "erase_flash"});
495+
sysExec(new String[]{pythonCmd, esptool.getAbsolutePath(), "--chip", getChip(), "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "erase_flash"});
495496
else
496-
sysExec(new String[]{esptool.getAbsolutePath(), "--chip", "esp32", "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "erase_flash"});
497+
sysExec(new String[]{esptool.getAbsolutePath(), "--chip", getChip(), "--port", serialPort, "--before", "default_reset", "--after", "hard_reset", "erase_flash"});
497498
}
498499
}
499500

501+
private String getChip() {
502+
String targetBoardId = BaseNoGui.getTargetBoard().getId();
503+
504+
if (targetBoardId.contains("s2")) {
505+
return "esp32s2";
506+
}
507+
else {
508+
return "esp32";
509+
}
510+
511+
}
512+
500513
public void run() {
501514
String sketchName = editor.getSketch().getName();
502515
Object[] options = { "LittleFS", "SPIFFS", "FatFS", "!Erase Flash!" };
@@ -520,17 +533,4 @@ public void run() {
520533
}
521534

522535
}
523-
524-
private String getChip() {
525-
String targetBoardId = BaseNoGui.getTargetBoard().getId();
526-
527-
if (targetBoardId.contains("s2")) {
528-
return "esp32s2";
529-
}
530-
else {
531-
return "esp32";
532-
}
533-
534-
}
535-
536536
}

0 commit comments

Comments
 (0)