Skip to content

Commit b211baf

Browse files
committed
Add support for all new ESP chips
1 parent c3b8479 commit b211baf

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "lib_path: $lib_path"
2121
set -e
2222

2323
mkdir -p bin
24-
javac -target 1.8 -cp "$pde_path:$core_path:$lib_path" -d bin src/$PROJECT.java
24+
/Library/Java/JavaVirtualMachines/openlogic-openjdk-8.jdk/Contents/Home/bin/javac -target 1.8 -cp "$pde_path:$core_path:$lib_path" -d bin src/$PROJECT.java
2525

2626
pushd bin
2727
mkdir -p $INSTALLDIR/tools

src/EspExceptionDecoder.java

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,41 @@ private void createAndUpload(){
261261
return;
262262
}
263263

264-
String tc = "esp32";
265-
if(PreferencesData.get("target_platform").contentEquals("esp8266")){
266-
tc = "lx106";
264+
String core = PreferencesData.get("target_platform");
265+
String tarch = "xtensa";
266+
String target = "lx106";
267+
268+
if(core.contentEquals("esp32")){
269+
try {
270+
tarch = BaseNoGui.getBoardPreferences().get("build.tarch");
271+
if(tarch == null || tarch.contentEquals("")){
272+
editor.statusError("Arch Not Found for "+BaseNoGui.getBoardPreferences().get("name"));
273+
return;
274+
}
275+
target = BaseNoGui.getBoardPreferences().get("build.target");
276+
if(target == null || target.contentEquals("")){
277+
editor.statusError("Target Not Found for "+BaseNoGui.getBoardPreferences().get("name"));
278+
return;
279+
}
280+
} catch(Exception e){
281+
editor.statusError(e);
282+
return;
283+
}
267284
}
268285

269286
TargetPlatform platform = BaseNoGui.getTargetPlatform();
287+
String tc = tarch+"-"+target+"-elf";
270288

271-
String gccPath = PreferencesData.get("runtime.tools.xtensa-"+tc+"-elf-gcc.path");
289+
String gccPath = PreferencesData.get("runtime.tools."+tc+"-gcc.path");
272290
if(gccPath == null){
273-
gccPath = platform.getFolder() + "/tools/xtensa-"+tc+"-elf";
291+
gccPath = platform.getFolder() + "/tools/"+tc;
274292
}
275293

276294
String gdb;
277295
if(PreferencesData.get("runtime.os").contentEquals("windows"))
278-
gdb = "xtensa-"+tc+"-elf-gdb.exe";
296+
gdb = tc+"-gdb.exe";
279297
else
280-
gdb = "xtensa-"+tc+"-elf-gdb";
298+
gdb = tc+"-gdb";
281299

282300
tool = new File(gccPath + "/bin", gdb);
283301
if (!tool.exists() || !tool.isFile()) {
@@ -422,7 +440,7 @@ private void parseStackOrBacktrace(String regexp, boolean multiLine, String stri
422440
}
423441

424442
// Anything looking like an instruction address, dump!
425-
Pattern p = Pattern.compile("40[0-2](\\d|[a-f]|[A-F]){5}\\b");
443+
Pattern p = Pattern.compile("4[0-3](\\d|[a-f]|[A-F]){6}\\b");
426444
int count = 0;
427445
Matcher m = p.matcher(content);
428446
while(m.find()) {
@@ -486,11 +504,11 @@ private String decodeFunctionAtAddress( String addr ) {
486504
// Scan and report the last failed memory allocation attempt, if present on the ESP8266
487505
private void parseAlloc() {
488506
String content = inputArea.getText();
489-
Pattern p = Pattern.compile("last failed alloc call: 40[0-2](\\d|[a-f]|[A-F]){5}\\((\\d)+\\)");
507+
Pattern p = Pattern.compile("last failed alloc call: 4[0-3](\\d|[a-f]|[A-F]){6}\\((\\d)+\\)");
490508
Matcher m = p.matcher(content);
491509
if (m.find()) {
492510
String fs = content.substring(m.start(), m.end());
493-
Pattern p2 = Pattern.compile("40[0-2](\\d|[a-f]|[A-F]){5}\\b");
511+
Pattern p2 = Pattern.compile("4[0-3](\\d|[a-f]|[A-F]){6}\\b");
494512
Matcher m2 = p2.matcher(fs);
495513
if (m2.find()) {
496514
String addr = fs.substring(m2.start(), m2.end());

0 commit comments

Comments
 (0)