From 9138706b8a5e4469f33a7a826c08e6446b642a3c Mon Sep 17 00:00:00 2001 From: Nils Fitinghoff Date: Wed, 16 Oct 2024 13:04:23 +0200 Subject: Support RT1180 family The 1180 family uses a different boot header than previous families. The header is generated to support the default configuration where hash and signature errors are ignored. The XIP `__pre_init` strategy is still used, more for ease of getting something running than because of any known problems with the boot ROM's implementation of loading images to different memories. The boot ROM for the 1180 does not appear to allow the entry point to lie outside the (loaded or execute-in-place) image, so a new `.xip` section is added after the vector table to put the address inside the image while keeping VMA=LMA. This could cause problems for tools that manipulate binaries based on section names. --- src/host/imxrt-link.x | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/host/imxrt-link.x') diff --git a/src/host/imxrt-link.x b/src/host/imxrt-link.x index 6c28f99..a389325 100644 --- a/src/host/imxrt-link.x +++ b/src/host/imxrt-link.x @@ -48,6 +48,7 @@ SECTIONS .vector_table : ALIGN(1024) { + FILL(0xff); __vector_table = .; __svector_table = .; @@ -68,13 +69,19 @@ SECTIONS } > REGION_VTABLE AT> REGION_LOAD_VTABLE __sivector_table = LOADADDR(.vector_table); + /* This section guarantees VMA = LMA to allow the execute-in-place entry point to be inside the image. */ + .xip : + { + /* Included here if not otherwise included in the boot header. */ + *(.Reset); + *(.__pre_init); + } > REGION_LOAD_TEXT + .text : { + FILL(0xff); __stext = .; *(.text .text.*); - /* Included in .text if not otherwise included in the boot header. */ - *(.Reset); - *(.__pre_init); /* The HardFaultTrampoline uses the `b` instruction to enter `HardFault`, so must be placed close to it. */ *(.HardFaultTrampoline); @@ -86,6 +93,7 @@ SECTIONS .rodata : ALIGN(4) { + FILL(0xff); . = ALIGN(4); __srodata = .; *(.rodata .rodata.*); @@ -100,6 +108,7 @@ SECTIONS .data : ALIGN(4) { + FILL(0xff); . = ALIGN(4); __sdata = .; *(.data .data.*); -- cgit v1.2.3