Skip to content

Commit dc937ab

Browse files
committed
Fix BOOT_HEADER_SIZE allocation in ARM scatter files (#13058)
PSoC 64 secure BSP post-build hook (cysecuretools image signing) expects the HEX file with start address 0x10000400 (first KB of internal FLASH is reserved for MCUboot headers area). In order to get the correct HEX file produced by ARM fromELF tool, the ELF file should allocate LR_IROM1 starting from address 0x10000400, not 0x10000000. Otherwise the generated HEX file allocates rows at addresses 0x10000000 ~ 010000400 and the final application image is not signed correctly. Fixes #13058.
1 parent 998d06a commit dc937ab

File tree

5 files changed

+10
-25
lines changed

5 files changed

+10
-25
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_064S2_4343W/device/COMPONENT_CM0P/TOOLCHAIN_ARM/cyb06xxa_cm0plus.sct

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,9 @@
148148

149149

150150
; Cortex-M0+ application flash area
151-
LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
151+
LR_IROM1 (FLASH_START + BOOT_HEADER_SIZE) (FLASH_SIZE - BOOT_HEADER_SIZE - 0x8000)
152152
{
153-
.cy_app_header +0
154-
{
155-
* (.cy_app_header)
156-
}
157-
158-
ER_FLASH_VECTORS +BOOT_HEADER_SIZE
153+
ER_FLASH_VECTORS +0
159154
{
160155
* (RESET, +FIRST)
161156
}

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_064_SB/device/COMPONENT_CM0P/TOOLCHAIN_ARM/cyb06xx7_cm0plus.sct

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,9 @@
148148

149149

150150
; Cortex-M0+ application flash area
151-
LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
151+
LR_IROM1 (FLASH_START + BOOT_HEADER_SIZE) (FLASH_SIZE - BOOT_HEADER_SIZE - 0x8000)
152152
{
153-
.cy_app_header +0
154-
{
155-
* (.cy_app_header)
156-
}
157-
158-
ER_FLASH_VECTORS +BOOT_HEADER_SIZE
153+
ER_FLASH_VECTORS +0
159154
{
160155
* (RESET, +FIRST)
161156
}

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_064_SB/device/COMPONENT_CM4/TOOLCHAIN_ARM/cyb06xx7_cm4.sct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@
134134

135135

136136
; Cortex-M4 application flash area
137-
LR_IROM1 FLASH_START FLASH_SIZE
137+
LR_IROM1 (FLASH_START + BOOT_HEADER_SIZE) (FLASH_SIZE - BOOT_HEADER_SIZE)
138138
{
139-
ER_FLASH_VECTORS +BOOT_HEADER_SIZE
139+
ER_FLASH_VECTORS +0
140140
{
141141
* (RESET, +FIRST)
142142
}

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYESKIT_064B0S2_4343W/device/COMPONENT_CM0P/TOOLCHAIN_ARM/cyb06xxa_cm0plus.sct

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,9 @@
148148

149149

150150
; Cortex-M0+ application flash area
151-
LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
151+
LR_IROM1 (FLASH_START + BOOT_HEADER_SIZE) (FLASH_SIZE - BOOT_HEADER_SIZE - 0x8000)
152152
{
153-
.cy_app_header +0
154-
{
155-
* (.cy_app_header)
156-
}
157-
158-
ER_FLASH_VECTORS +BOOT_HEADER_SIZE
153+
ER_FLASH_VECTORS +0
159154
{
160155
* (RESET, +FIRST)
161156
}

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYESKIT_064B0S2_4343W/device/COMPONENT_CM4/TOOLCHAIN_ARM/cyb06xxa_cm4.sct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@
134134

135135

136136
; Cortex-M4 application flash area
137-
LR_IROM1 FLASH_START FLASH_SIZE
137+
LR_IROM1 (FLASH_START + BOOT_HEADER_SIZE) (FLASH_SIZE - BOOT_HEADER_SIZE)
138138
{
139-
ER_FLASH_VECTORS +BOOT_HEADER_SIZE
139+
ER_FLASH_VECTORS +0
140140
{
141141
* (RESET, +FIRST)
142142
}

0 commit comments

Comments
 (0)