EESAVE fuse bit TDF validation

This commit is contained in:
Nav
2023-05-26 23:36:21 +01:00
parent 54e77c371c
commit 18e125f43f

View File

@@ -95,6 +95,7 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
public ?FuseBitDescriptor $dwenFuseBitDescriptor = null; public ?FuseBitDescriptor $dwenFuseBitDescriptor = null;
public ?FuseBitDescriptor $ocdenFuseBitDescriptor = null; public ?FuseBitDescriptor $ocdenFuseBitDescriptor = null;
public ?FuseBitDescriptor $jtagenFuseBitDescriptor = null; public ?FuseBitDescriptor $jtagenFuseBitDescriptor = null;
public ?FuseBitDescriptor $eesaveFuseBitDescriptor = null;
protected function init() protected function init()
{ {
@@ -272,6 +273,11 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
$this->jtagenFuseBitDescriptor = new FuseBitDescriptor(); $this->jtagenFuseBitDescriptor = new FuseBitDescriptor();
$this->jtagenFuseBitDescriptor->fuseType = $fuseType; $this->jtagenFuseBitDescriptor->fuseType = $fuseType;
} }
if (isset($fuseRegister->bitFieldsByName['eesave'])) {
$this->eesaveFuseBitDescriptor = new FuseBitDescriptor();
$this->eesaveFuseBitDescriptor->fuseType = $fuseType;
}
} }
} }
} }
@@ -862,6 +868,15 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
} }
} }
if (
in_array(Avr8TargetDescriptionFile::AVR8_PHYSICAL_INTERFACE_JTAG, $this->debugPhysicalInterfaces)
|| in_array(Avr8TargetDescriptionFile::AVR8_PHYSICAL_INTERFACE_UPDI, $this->debugPhysicalInterfaces)
) {
if (empty($this->eesaveFuseBitDescriptor)) {
$failures[] = 'Could not find EESAVE fuse bit field for JTAG/UPDI target.';
}
}
$portPeripheralModule = $this->peripheralModulesByName['port'] ?? null; $portPeripheralModule = $this->peripheralModulesByName['port'] ?? null;
if (empty($portPeripheralModule)) { if (empty($portPeripheralModule)) {
$failures[] = 'PORT peripheral module not found.'; $failures[] = 'PORT peripheral module not found.';