From d63bce750c4e8d2f48d9cfb590218a970e33818e Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 12 Dec 2022 00:50:32 +0000 Subject: [PATCH] Added validation for APP_SECTION start address and size for PDI targets, in AVR8 TDF validation script --- .../AVR8/Avr8TargetDescriptionFile.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/build/scripts/TargetDescriptionFiles/AVR8/Avr8TargetDescriptionFile.php b/build/scripts/TargetDescriptionFiles/AVR8/Avr8TargetDescriptionFile.php index cf9294b7..0bd1171a 100644 --- a/build/scripts/TargetDescriptionFiles/AVR8/Avr8TargetDescriptionFile.php +++ b/build/scripts/TargetDescriptionFiles/AVR8/Avr8TargetDescriptionFile.php @@ -54,8 +54,10 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile public ?int $osccalAddress = null; // XMega/PDI specific target params - public ?int $appSectionPdiOffset = null; + public ?int $appSectionStartAddress = null; + public ?int $appSectionSize = null; public ?int $bootSectionSize = null; + public ?int $appSectionPdiOffset = null; public ?int $bootSectionPdiOffset = null; public ?int $eepromPdiOffset = null; public ?int $ramPdiOffset = null; @@ -265,6 +267,7 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile $this->flashStartAddress = $progAddressSpace->startAddress; $firstFlashMemorySegment = reset($progAddressSpace->memorySegmentsByTypeAndName['flash']); + $appFlashMemorySegment = $progAddressSpace->memorySegmentsByTypeAndName['flash']['app_section'] ?? null; $bootSectionMemorySegment = $progAddressSpace->memorySegmentsByTypeAndName['flash']['boot_section_1'] ?? $progAddressSpace->memorySegmentsByTypeAndName['flash']['boot_section'] ?? null; @@ -272,6 +275,11 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile $this->flashPageSize = $firstFlashMemorySegment->pageSize; } + if (!empty($appFlashMemorySegment)) { + $this->appSectionStartAddress = $appFlashMemorySegment->startAddress; + $this->appSectionSize = $appFlashMemorySegment->size; + } + if (!empty($bootSectionMemorySegment)) { $this->bootSectionSize = $bootSectionMemorySegment->size; $this->bootSectionStartAddress = $bootSectionMemorySegment->startAddress; @@ -765,6 +773,14 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile if (is_null($this->mcuModuleBaseAddress)) { $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)) {