Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Commit

Permalink
Working on #116 (Flashing sometimes results in 0xFF...FF MAC adresses…
Browse files Browse the repository at this point in the history
…). The commit doesn't prevent the error from occurring but warns the user so that he can react accordingly.
  • Loading branch information
danbim committed Apr 27, 2012
1 parent 670fe0a commit 581d778
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,20 @@ protected Void callInternal() throws Exception {
eraseSectors(chipType);
writeBinaryImage(binaryImage);

boolean brokenMac = false;
final byte[] deviceFlashHeader = readDeviceFlashHeader(chipType.getHeaderStart(), chipType.getHeaderLength());
if (MacAddress.HIGHEST_MAC_ADDRESS.equals(new MacAddress(deviceFlashHeader))) {
brokenMac = true;
}

runSubOperation(operationFactory.createResetOperation(1000, null), FRACTION_RESET);

if (brokenMac) {
throw new FlashProgramFailedException(
"After flashing the MAC address seems to be 0xFF...FF which may result in unexpected behavior!"
);
}

return null;
}

Expand Down Expand Up @@ -126,7 +138,7 @@ private byte[] readDeviceFlashHeader(final int address, final int length) throws
private void assertImageCompatible(final JennicBinaryImage binaryImage, final ChipType chipType) throws Exception {

if (!binaryImage.isCompatible(chipType)) {
log.error("Device chip type ({}) and image chip type ({}) mismatch!" ,chipType, binaryImage.getChipType());
log.error("Device chip type ({}) and image chip type ({}) mismatch!", chipType, binaryImage.getChipType());
throw new ProgramChipMismatchException(chipType, binaryImage.getChipType());
}
}
Expand Down

0 comments on commit 581d778

Please sign in to comment.