From 298693448532e4b18c17246a95599e44765c91e3 Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 23 Jul 2024 20:52:01 +0100 Subject: [PATCH] AVR8 Program memory size validation --- .../AVR8/Services/ValidationService.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php b/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php index f4f30e48..bc44d62a 100644 --- a/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php +++ b/build/scripts/Targets/TargetDescriptionFiles/AVR8/Services/ValidationService.php @@ -22,6 +22,20 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat { $failures = parent::validateTdf($tdf); + $progAddressSpace = $tdf->getAddressSpace("prog"); + if ($progAddressSpace === null) { + $failures[] = 'Missing program memory address space'; + + } elseif ($progAddressSpace->size > 1000000) { + /* + * For program memory cache, Bloom currently allocates a buffer equal to the size of the program memory + * address space. This can become a problem if the address space is huge. + * + * For AVR8 targets, it shouldn't exceed 1 million bytes. 1MB RAM usage is fine. + */ + $failures[] = 'Program memory address space exceeds 1M bytes'; + } + if ($tdf->getProgramMemorySegment() === null) { $failures[] = 'Missing "internal_program_memory" memory segment'; }