You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On windows there seems to be some problems coming from the default platform location.
Looks like by default .arduino15/packages/ is expected but this seems unix centric which leads to currentPlatform = null. This ends up crashing the plugin with a NullPointer exception on startup because the boards don't populate in the board dialog.
Then when you select the package location it gets parsed incorrectly which leads to the package def being wrong because the createPlatformFromFile matches the wrong indexes. Below is a quick fix. Maybe it needs to be extended for other patterns.
private static Platform createPlatformFromFile(Platform rootPlatform, Path platformFilePath) {
// Pattern: /home/user/.arduino15/packages/{vendor}/hardware/{architecture}/x.x.x/platform.txt
// Pattern: Program Files(x86)/Arduino/hardware/arduino/avr/platform.txt
int hardwareIndex = -1;
int arduino15Index = -1;
for (int i = platformFilePath.getNameCount() - 1; i >= 0; i--) {
if ("arduino15".equalsIgnoreCase(platformFilePath.getName(i).toString())) {
arduino15Index = i;
}
if ("hardware".equalsIgnoreCase(platformFilePath.getName(i).toString())) {
hardwareIndex = i;
break;
}
}
String vendor ;
String architecture ;
if( arduino15Index == -1){
//Windows
vendor = platformFilePath.getName(hardwareIndex + 1).toString();
architecture = platformFilePath.getName(hardwareIndex + 2).toString();
}else{
vendor = platformFilePath.getName(hardwareIndex - 1).toString();
architecture = platformFilePath.getName(hardwareIndex + 1).toString();
}
try {
if (architecture.equalsIgnoreCase("pic32")) {
return new PIC32Platform(rootPlatform, vendor, platformFilePath.getParent());
} else {
return new Platform(rootPlatform, vendor, architecture, platformFilePath.getParent());
}
} catch (IOException ex) {
LOGGER.log(Level.SEVERE, String.format("Failed to create a platform for %s / %s ", vendor, architecture), ex);
return null;
}
}
The text was updated successfully, but these errors were encountered:
On windows there seems to be some problems coming from the default platform location.
Looks like by default .arduino15/packages/ is expected but this seems unix centric which leads to currentPlatform = null. This ends up crashing the plugin with a NullPointer exception on startup because the boards don't populate in the board dialog.
Then when you select the package location it gets parsed incorrectly which leads to the package def being wrong because the createPlatformFromFile matches the wrong indexes. Below is a quick fix. Maybe it needs to be extended for other patterns.
The text was updated successfully, but these errors were encountered: