From 2b4dfaf8b03d3a69581b1e3373e673841ea61469 Mon Sep 17 00:00:00 2001 From: sekior11 <2784683112@qq.com> Date: Mon, 14 Sep 2026 16:02:05 +0800 Subject: [PATCH 1/2] portable: remove stray installer URL from IAR TrustZone non-secure ports A stray IAR installer download URL was left outside the comment delimiters in the restore_special_regs section of the IAR TrustZone non-secure ports. The assembler parses the bare URL as an operand of the preceding ldmia, so any build of these ports aborts with: Error: garbage following instruction -- 'ldmia r2!,{r0,r3,lr} http:' The line is outside the configENABLE_PAC conditional block, so it breaks every configuration of the port, not only PAC-enabled builds. Commit 78e0cc7 ("ARMv8.1-M: Add task dedicated PAC key support", #1195) introduced the URL in the CM33/CM35P/CM55/CM85 and ARMv8M non-secure ports. The CM52 (#1334) and STAR-MC3 (#1363) ports inherited it when their portasm.s was created from an already-affected file. The stray URL is removed rather than moved inside the comment, matching the unaffected sibling port ARM_CM23/non_secure/portasm.s, which carries the same comment text without any URL. Verified with arm-none-eabi-gcc 13.3.1: all six files fail to assemble before the change and assemble cleanly after it. Relates to #1480. The ARM_CM33 non-secure port is handled separately by #1485, so it is intentionally not touched here. --- portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s | 2 +- portable/IAR/ARM_CM35P/non_secure/portasm.s | 2 +- portable/IAR/ARM_CM52/non_secure/portasm.s | 2 +- portable/IAR/ARM_CM55/non_secure/portasm.s | 2 +- portable/IAR/ARM_CM85/non_secure/portasm.s | 2 +- portable/IAR/ARM_STAR_MC3/non_secure/portasm.s | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s +++ b/portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */ diff --git a/portable/IAR/ARM_CM35P/non_secure/portasm.s b/portable/IAR/ARM_CM35P/non_secure/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/IAR/ARM_CM35P/non_secure/portasm.s +++ b/portable/IAR/ARM_CM35P/non_secure/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */ diff --git a/portable/IAR/ARM_CM52/non_secure/portasm.s b/portable/IAR/ARM_CM52/non_secure/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/IAR/ARM_CM52/non_secure/portasm.s +++ b/portable/IAR/ARM_CM52/non_secure/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */ diff --git a/portable/IAR/ARM_CM55/non_secure/portasm.s b/portable/IAR/ARM_CM55/non_secure/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/IAR/ARM_CM55/non_secure/portasm.s +++ b/portable/IAR/ARM_CM55/non_secure/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */ diff --git a/portable/IAR/ARM_CM85/non_secure/portasm.s b/portable/IAR/ARM_CM85/non_secure/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/IAR/ARM_CM85/non_secure/portasm.s +++ b/portable/IAR/ARM_CM85/non_secure/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */ diff --git a/portable/IAR/ARM_STAR_MC3/non_secure/portasm.s b/portable/IAR/ARM_STAR_MC3/non_secure/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/IAR/ARM_STAR_MC3/non_secure/portasm.s +++ b/portable/IAR/ARM_STAR_MC3/non_secure/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */ From 73567c511958175b58866f36f20a437e6de04bce Mon Sep 17 00:00:00 2001 From: Mortal <2784683112@QQ.COM> Date: Tue, 15 Sep 2026 09:44:24 +0800 Subject: [PATCH 2/2] portable: fix stray installer URL in IAR ARM_CM33 non-secure port portable/ARMv8M/copy_files.py derives the non-secure IAR ports from portable/ARMv8M/non_secure/portable/IAR/ARM_CM33. The previous commit fixed that source directory but did not regenerate the ARM_CM33 copy, so portable/IAR/ARM_CM33/non_secure/portasm.s still carried the stray URL. mpu_wrappers_v2_asm.S and portmacro.h are already identical between source and destination, so re-running the script changes only this file. With this commit all seven files that carry the stray URL are fixed, which makes #1485 (same file, same line) unnecessary. Correction to the previous commit message: the stray URL is in the #else branch of #if ( configENABLE_MPU == 1 ), so it is not every configuration of the port. It breaks every non-MPU build, independently of configENABLE_PAC; MPU builds never compile the line. Verified with arm-none-eabi-gcc 13.3.1 (GNU as, not IAR iccarm), using -march=armv8.1-m.main -mthumb -mfpu=fpv5-d16 and a minimal IAR-to-GNU directive translation: configENABLE_MPU=0, configENABLE_PAC=0 fails before, assembles after configENABLE_MPU=1 line is not compiled The PAC_KEY_* mrs/msr instructions are rejected by GNU as on this target, so the PAC-enabled non-MPU configuration could not be exercised here. Relates to #1480. --- portable/IAR/ARM_CM33/non_secure/portasm.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portable/IAR/ARM_CM33/non_secure/portasm.s b/portable/IAR/ARM_CM33/non_secure/portasm.s index 47fcfa15bf..7cb05a19ba 100644 --- a/portable/IAR/ARM_CM33/non_secure/portasm.s +++ b/portable/IAR/ARM_CM33/non_secure/portasm.s @@ -473,7 +473,7 @@ PendSV_Handler: msr PAC_KEY_P_0, r6 clrm {r3-r6} /* Clear r3-r6. */ #endif /* configENABLE_PAC */ - ldmia r2!, {r0, r3, lr} http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ + ldmia r2!, {r0, r3, lr} /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */ msr psplim, r3 /* Restore the PSPLIM register value for the task. */ ldr r3, =xSecureContext /* Read the location of xSecureContext i.e. &( xSecureContext ). */ str r0, [r3] /* Restore the task's xSecureContext. */