diff --git a/arduino-core/src/processing/app/debug/Compiler.java b/arduino-core/src/processing/app/debug/Compiler.java index 0c5ec8057..9a684a3a1 100644 --- a/arduino-core/src/processing/app/debug/Compiler.java +++ b/arduino-core/src/processing/app/debug/Compiler.java @@ -182,7 +182,14 @@ public class Compiler implements MessageConsumer { } static public File findCompiledSketch(PreferencesMap prefs) throws PreferencesMapException { - List paths = Arrays.asList("{build.path}/{build.project_name}.hex", "{build.path}/{build.project_name}.bin"); + List paths = Arrays.asList( + "{build.path}/sketch/{build.project_name}.with_bootloader.hex", + "{build.path}/sketch/{build.project_name}.hex", + "{build.path}/{build.project_name}.with_bootloader.hex", + "{build.path}/{build.project_name}.hex", + "{build.path}/sketch/{build.project_name}.bin", + "{build.path}/{build.project_name}.bin" + ); Optional sketch = paths.stream(). map(path -> StringReplacer.replaceFromMapping(path, prefs)). map(File::new).