Added validation for APP_SECTION start address and size for PDI targets, in AVR8 TDF validation script

This commit is contained in:
Nav
2022-12-12 00:50:32 +00:00
parent 151d10df72
commit d63bce750c

View File

@@ -54,8 +54,10 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
public ?int $osccalAddress = null; public ?int $osccalAddress = null;
// XMega/PDI specific target params // XMega/PDI specific target params
public ?int $appSectionPdiOffset = null; public ?int $appSectionStartAddress = null;
public ?int $appSectionSize = null;
public ?int $bootSectionSize = null; public ?int $bootSectionSize = null;
public ?int $appSectionPdiOffset = null;
public ?int $bootSectionPdiOffset = null; public ?int $bootSectionPdiOffset = null;
public ?int $eepromPdiOffset = null; public ?int $eepromPdiOffset = null;
public ?int $ramPdiOffset = null; public ?int $ramPdiOffset = null;
@@ -265,6 +267,7 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
$this->flashStartAddress = $progAddressSpace->startAddress; $this->flashStartAddress = $progAddressSpace->startAddress;
$firstFlashMemorySegment = reset($progAddressSpace->memorySegmentsByTypeAndName['flash']); $firstFlashMemorySegment = reset($progAddressSpace->memorySegmentsByTypeAndName['flash']);
$appFlashMemorySegment = $progAddressSpace->memorySegmentsByTypeAndName['flash']['app_section'] ?? null;
$bootSectionMemorySegment = $progAddressSpace->memorySegmentsByTypeAndName['flash']['boot_section_1'] $bootSectionMemorySegment = $progAddressSpace->memorySegmentsByTypeAndName['flash']['boot_section_1']
?? $progAddressSpace->memorySegmentsByTypeAndName['flash']['boot_section'] ?? null; ?? $progAddressSpace->memorySegmentsByTypeAndName['flash']['boot_section'] ?? null;
@@ -272,6 +275,11 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
$this->flashPageSize = $firstFlashMemorySegment->pageSize; $this->flashPageSize = $firstFlashMemorySegment->pageSize;
} }
if (!empty($appFlashMemorySegment)) {
$this->appSectionStartAddress = $appFlashMemorySegment->startAddress;
$this->appSectionSize = $appFlashMemorySegment->size;
}
if (!empty($bootSectionMemorySegment)) { if (!empty($bootSectionMemorySegment)) {
$this->bootSectionSize = $bootSectionMemorySegment->size; $this->bootSectionSize = $bootSectionMemorySegment->size;
$this->bootSectionStartAddress = $bootSectionMemorySegment->startAddress; $this->bootSectionStartAddress = $bootSectionMemorySegment->startAddress;
@@ -765,6 +773,14 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
if (is_null($this->mcuModuleBaseAddress)) { if (is_null($this->mcuModuleBaseAddress)) {
$failures[] = 'Missing MCU module base address.'; $failures[] = 'Missing MCU module base address.';
} }
if (is_null($this->appSectionStartAddress)) {
$failures[] = 'Missing APP section start address';
}
if (is_null($this->appSectionSize)) {
$failures[] = 'Missing APP section size';
}
} }
if (in_array(Avr8TargetDescriptionFile::AVR8_PHYSICAL_INTERFACE_UPDI, $this->debugPhysicalInterfaces)) { if (in_array(Avr8TargetDescriptionFile::AVR8_PHYSICAL_INTERFACE_UPDI, $this->debugPhysicalInterfaces)) {