Hi all,
I have found a bug in SPM scheduler lock logic – this bug is extremely hard to reproduce as it requires precise conditions and timings, but here is the description of the bug scenario:
1. Partition A calls psa_wait to wait for a signal (this signal is going to be asserted by FLIH IRQ later) 2. Currently signal is not asserted, no other partition is runnable, thus SPM marks this signal as being awaited and then schedules idle_thread 3. idle_thread calls psa_wait to poll SPM * psa_wait calls tfm_arch_thread_fn_call * tfm_arch_thread_fn_call calls backend_abi_entering_spm * backend_abi_entering_spm calls arch_acquire_sched_lock * arch_acquire_sched_lock sets scheduler_lock = SCHEDULER_LOCKED * psa_wait (called by idle_partition) is being processed up to the point of backend_abi_leaving_spm * backend_abi_leaving_spm calls arch_release_sched_lock * here is where very sneaky the bug happens * arch_release_sched_lock executes following assembly instructions
i. "ldr r1, =scheduler_lock \n" "ldr r0, [r1, #0] \n"
ii. At this point r0 holds scheduler_lock is = SCHEDULER_LOCKED
iii. After these instructions are executed FLIH interrupt arrives
* FLIH handler asserts signal (which should unblock execution of the Partition A) * spm_handle_interrupt calls backend_assert_signal * backend_assert_signal does if (p_pt->signals_asserted & p_pt->signals_waiting) and returns STATUS_NEED_SCHEDULE * spm_handle_interrupt calls arch_attempt_schedule * arch_attempt_schedule checks value of scheduler_lock (which is SCHEDULER_LOCKED) and sets scheduler_lock= SCHEDULER_ATTEMPTED * Interrupt returns
iv. Execution continues, now scheduler_lock is = SCHEDULER_ATTEMPTED But the next line of code in arch_release_sched_lock is "movs r2, #"M2S(SCHEDULER_UNLOCKED)" \n"/* Unlock scheduler */
This effectively overwrites scheduler_lock from SCHEDULER_ATTEMPTED to SCHEDULER_UNLOCKED This means that following SRM scheduling logic will not trigger PendSV and just return to idle_partition – effectively resulting in a hang of a system.
Looks like the solution is to wrap lock logic in critical section. But may be there is other things that can be done to better fix this issue.
Let me know if there are other details that may be helpful to fix this bug.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC Senior Engineer CSS ICW SW INT BFS SFW Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Thanks Bohdan for reporting this.
Let me have a look and try to reproduce it.
Best regards, Nick
________________________________ From: Bohdan.Hunko--- via TF-M tf-m@lists.trustedfirmware.org Sent: 16 December 2025 20:54 To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Cc: Ivan.Kozemchuk@infineon.com Ivan.Kozemchuk@infineon.com; Hennadiy.Kytsun@infineon.com Hennadiy.Kytsun@infineon.com Subject: [TF-M] Race condition in SPM scheduler lock logic
Hi all,
I have found a bug in SPM scheduler lock logic – this bug is extremely hard to reproduce as it requires precise conditions and timings, but here is the description of the bug scenario:
1. Partition A calls psa_wait to wait for a signal (this signal is going to be asserted by FLIH IRQ later) 2. Currently signal is not asserted, no other partition is runnable, thus SPM marks this signal as being awaited and then schedules idle_thread 3. idle_thread calls psa_wait to poll SPM * psa_wait calls tfm_arch_thread_fn_call * tfm_arch_thread_fn_call calls backend_abi_entering_spm * backend_abi_entering_spm calls arch_acquire_sched_lock * arch_acquire_sched_lock sets scheduler_lock = SCHEDULER_LOCKED * psa_wait (called by idle_partition) is being processed up to the point of backend_abi_leaving_spm * backend_abi_leaving_spm calls arch_release_sched_lock * here is where very sneaky the bug happens * arch_release_sched_lock executes following assembly instructions
i. "ldr r1, =scheduler_lock \n" "ldr r0, [r1, #0] \n"
ii. At this point r0 holds scheduler_lock is = SCHEDULER_LOCKED
iii. After these instructions are executed FLIH interrupt arrives
* FLIH handler asserts signal (which should unblock execution of the Partition A) * spm_handle_interrupt calls backend_assert_signal * backend_assert_signal does if (p_pt->signals_asserted & p_pt->signals_waiting) and returns STATUS_NEED_SCHEDULE * spm_handle_interrupt calls arch_attempt_schedule * arch_attempt_schedule checks value of scheduler_lock (which is SCHEDULER_LOCKED) and sets scheduler_lock= SCHEDULER_ATTEMPTED * Interrupt returns
iv. Execution continues, now scheduler_lock is = SCHEDULER_ATTEMPTED But the next line of code in arch_release_sched_lock is "movs r2, #"M2S(SCHEDULER_UNLOCKED)" \n"/* Unlock scheduler */
This effectively overwrites scheduler_lock from SCHEDULER_ATTEMPTED to SCHEDULER_UNLOCKED This means that following SRM scheduling logic will not trigger PendSV and just return to idle_partition – effectively resulting in a hang of a system.
Looks like the solution is to wrap lock logic in critical section. But may be there is other things that can be done to better fix this issue.
Let me know if there are other details that may be helpful to fix this bug.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Hi Bohdan,
The sequence you provided seems reasonable, however "backend_abi_leaving_spm" and the subsequent "arch_release_sched_lock" execute with all interrupts disabled, so there are no interrupts that should change the scheduler_lock in between [1]. A pending interrupt would execute as soon as L:91, and then would correctly set the PendSV.
Can you please share a bit more about your interrupt configurations, priorities etc? Am I missing something else?
Thanks Best regards, Nick
[1] https://git.trustedfirmware.org/plugins/gitiles/TF-M/trusted-firmware-m.git/...
________________________________ From: Nicola Mazzucato via TF-M tf-m@lists.trustedfirmware.org Sent: 17 December 2025 08:37 To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org; Bohdan.Hunko@infineon.com Bohdan.Hunko@infineon.com Cc: Ivan.Kozemchuk@infineon.com Ivan.Kozemchuk@infineon.com; Hennadiy.Kytsun@infineon.com Hennadiy.Kytsun@infineon.com Subject: [TF-M] Re: Race condition in SPM scheduler lock logic
Thanks Bohdan for reporting this.
Let me have a look and try to reproduce it.
Best regards, Nick
________________________________ From: Bohdan.Hunko--- via TF-M tf-m@lists.trustedfirmware.org Sent: 16 December 2025 20:54 To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Cc: Ivan.Kozemchuk@infineon.com Ivan.Kozemchuk@infineon.com; Hennadiy.Kytsun@infineon.com Hennadiy.Kytsun@infineon.com Subject: [TF-M] Race condition in SPM scheduler lock logic
Hi all,
I have found a bug in SPM scheduler lock logic – this bug is extremely hard to reproduce as it requires precise conditions and timings, but here is the description of the bug scenario:
1. Partition A calls psa_wait to wait for a signal (this signal is going to be asserted by FLIH IRQ later) 2. Currently signal is not asserted, no other partition is runnable, thus SPM marks this signal as being awaited and then schedules idle_thread 3. idle_thread calls psa_wait to poll SPM * psa_wait calls tfm_arch_thread_fn_call * tfm_arch_thread_fn_call calls backend_abi_entering_spm * backend_abi_entering_spm calls arch_acquire_sched_lock * arch_acquire_sched_lock sets scheduler_lock = SCHEDULER_LOCKED * psa_wait (called by idle_partition) is being processed up to the point of backend_abi_leaving_spm * backend_abi_leaving_spm calls arch_release_sched_lock * here is where very sneaky the bug happens * arch_release_sched_lock executes following assembly instructions
i. "ldr r1, =scheduler_lock \n" "ldr r0, [r1, #0] \n"
ii. At this point r0 holds scheduler_lock is = SCHEDULER_LOCKED
iii. After these instructions are executed FLIH interrupt arrives
* FLIH handler asserts signal (which should unblock execution of the Partition A) * spm_handle_interrupt calls backend_assert_signal * backend_assert_signal does if (p_pt->signals_asserted & p_pt->signals_waiting) and returns STATUS_NEED_SCHEDULE * spm_handle_interrupt calls arch_attempt_schedule * arch_attempt_schedule checks value of scheduler_lock (which is SCHEDULER_LOCKED) and sets scheduler_lock= SCHEDULER_ATTEMPTED * Interrupt returns
iv. Execution continues, now scheduler_lock is = SCHEDULER_ATTEMPTED But the next line of code in arch_release_sched_lock is "movs r2, #"M2S(SCHEDULER_UNLOCKED)" \n"/* Unlock scheduler */
This effectively overwrites scheduler_lock from SCHEDULER_ATTEMPTED to SCHEDULER_UNLOCKED This means that following SRM scheduling logic will not trigger PendSV and just return to idle_partition – effectively resulting in a hang of a system.
Looks like the solution is to wrap lock logic in critical section. But may be there is other things that can be done to better fix this issue.
Let me know if there are other details that may be helpful to fix this bug.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Hi Nicola,
* Can you please share a bit more about your interrupt configurations, priorities etc? We don’t do anything special, the IRQ priority is Normal, nothing unusual.
* Am I missing something else? Looking into the code one thing that comes to mind is that tfm_arch_thread_fn_call can be called from unprivileged partition thus interrupt masking will not take effect. I believe this explains the behavior described in previous mail. If so then not only this code is effected, but other multithread issues may occur in different places of tfm_arch_thread_fn_call.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC Senior Engineer CSS ICW SW INT BFS SFW Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
From: Nicola Mazzucato Nicola.Mazzucato@arm.com Sent: Friday, 19 December 2025 11:59 To: Hunko Bohdan (CSS ICW SW INT BFS SFW) Bohdan.Hunko@infineon.com Cc: Kozemchuk Ivan (CSS ICW SW INT BFS SFW) Ivan.Kozemchuk@infineon.com; Kytsun Hennadiy (CSS ICW SW INT BFS SFW) Hennadiy.Kytsun@infineon.com; Anton Komlev via TF-M tf-m@lists.trustedfirmware.org Subject: Re: Race condition in SPM scheduler lock logic
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Bohdan,
The sequence you provided seems reasonable, however "backend_abi_leaving_spm" and the subsequent "arch_release_sched_lock" execute with all interrupts disabled, so there are no interrupts that should change the scheduler_lock in between [1]. A pending interrupt would execute as soon as L:91, and then would correctly set the PendSV.
Can you please share a bit more about your interrupt configurations, priorities etc? Am I missing something else?
Thanks Best regards, Nick
[1] https://git.trustedfirmware.org/plugins/gitiles/TF-M/trusted-firmware-m.git/...
________________________________ From: Nicola Mazzucato via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 17 December 2025 08:37 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org>; Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com <Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com> Subject: [TF-M] Re: Race condition in SPM scheduler lock logic
Thanks Bohdan for reporting this.
Let me have a look and try to reproduce it.
Best regards, Nick
________________________________ From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 16 December 2025 20:54 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com> Subject: [TF-M] Race condition in SPM scheduler lock logic
Hi all,
I have found a bug in SPM scheduler lock logic – this bug is extremely hard to reproduce as it requires precise conditions and timings, but here is the description of the bug scenario:
1. Partition A calls psa_wait to wait for a signal (this signal is going to be asserted by FLIH IRQ later) 2. Currently signal is not asserted, no other partition is runnable, thus SPM marks this signal as being awaited and then schedules idle_thread 3. idle_thread calls psa_wait to poll SPM
* psa_wait calls tfm_arch_thread_fn_call * tfm_arch_thread_fn_call calls backend_abi_entering_spm * backend_abi_entering_spm calls arch_acquire_sched_lock * arch_acquire_sched_lock sets scheduler_lock = SCHEDULER_LOCKED * psa_wait (called by idle_partition) is being processed up to the point of backend_abi_leaving_spm * backend_abi_leaving_spm calls arch_release_sched_lock * here is where very sneaky the bug happens * arch_release_sched_lock executes following assembly instructions
i. "ldr r1, =scheduler_lock \n" "ldr r0, [r1, #0] \n"
ii. At this point r0 holds scheduler_lock is = SCHEDULER_LOCKED
iii. After these instructions are executed FLIH interrupt arrives
* FLIH handler asserts signal (which should unblock execution of the Partition A) * spm_handle_interrupt calls backend_assert_signal * backend_assert_signal does if (p_pt->signals_asserted & p_pt->signals_waiting) and returns STATUS_NEED_SCHEDULE * spm_handle_interrupt calls arch_attempt_schedule * arch_attempt_schedule checks value of scheduler_lock (which is SCHEDULER_LOCKED) and sets scheduler_lock= SCHEDULER_ATTEMPTED * Interrupt returns
iv. Execution continues, now scheduler_lock is = SCHEDULER_ATTEMPTED But the next line of code in arch_release_sched_lock is "movs r2, #"M2S(SCHEDULER_UNLOCKED)" \n"/* Unlock scheduler */
This effectively overwrites scheduler_lock from SCHEDULER_ATTEMPTED to SCHEDULER_UNLOCKED This means that following SRM scheduling logic will not trigger PendSV and just return to idle_partition – effectively resulting in a hang of a system.
Looks like the solution is to wrap lock logic in critical section. But may be there is other things that can be done to better fix this issue.
Let me know if there are other details that may be helpful to fix this bug.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Thank you Bohdan,
I am still a bit confused about the setup, because that section in SPM always executes in privileged execution. If the calling partition is not privileged, then the SVC handler will take place to elevate execution.
Thanks Best regards, Nick
________________________________ From: Bohdan.Hunko@infineon.com Bohdan.Hunko@infineon.com Sent: 19 December 2025 10:31 To: Nicola Mazzucato Nicola.Mazzucato@arm.com Cc: Ivan.Kozemchuk@infineon.com Ivan.Kozemchuk@infineon.com; Hennadiy.Kytsun@infineon.com Hennadiy.Kytsun@infineon.com; tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Subject: RE: Race condition in SPM scheduler lock logic
Hi Nicola,
* Can you please share a bit more about your interrupt configurations, priorities etc?
We don’t do anything special, the IRQ priority is Normal, nothing unusual.
* Am I missing something else?
Looking into the code one thing that comes to mind is that tfm_arch_thread_fn_call can be called from unprivileged partition thus interrupt masking will not take effect. I believe this explains the behavior described in previous mail.
If so then not only this code is effected, but other multithread issues may occur in different places of tfm_arch_thread_fn_call.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
From: Nicola Mazzucato Nicola.Mazzucato@arm.com Sent: Friday, 19 December 2025 11:59 To: Hunko Bohdan (CSS ICW SW INT BFS SFW) Bohdan.Hunko@infineon.com Cc: Kozemchuk Ivan (CSS ICW SW INT BFS SFW) Ivan.Kozemchuk@infineon.com; Kytsun Hennadiy (CSS ICW SW INT BFS SFW) Hennadiy.Kytsun@infineon.com; Anton Komlev via TF-M tf-m@lists.trustedfirmware.org Subject: Re: Race condition in SPM scheduler lock logic
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Bohdan,
The sequence you provided seems reasonable, however "backend_abi_leaving_spm" and the subsequent "arch_release_sched_lock" execute with all interrupts disabled, so there are no interrupts that should change the scheduler_lock in between [1].
A pending interrupt would execute as soon as L:91, and then would correctly set the PendSV.
Can you please share a bit more about your interrupt configurations, priorities etc?
Am I missing something else?
Thanks
Best regards,
Nick
[1]
https://git.trustedfirmware.org/plugins/gitiles/TF-M/trusted-firmware-m.git/...
________________________________
From: Nicola Mazzucato via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 17 December 2025 08:37 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org>; Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com <Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com> Subject: [TF-M] Re: Race condition in SPM scheduler lock logic
Thanks Bohdan for reporting this.
Let me have a look and try to reproduce it.
Best regards,
Nick
________________________________
From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 16 December 2025 20:54 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com> Subject: [TF-M] Race condition in SPM scheduler lock logic
Hi all,
I have found a bug in SPM scheduler lock logic – this bug is extremely hard to reproduce as it requires precise conditions and timings, but here is the description of the bug scenario:
1. Partition A calls psa_wait to wait for a signal (this signal is going to be asserted by FLIH IRQ later) 2. Currently signal is not asserted, no other partition is runnable, thus SPM marks this signal as being awaited and then schedules idle_thread 3. idle_thread calls psa_wait to poll SPM
* psa_wait calls tfm_arch_thread_fn_call * tfm_arch_thread_fn_call calls backend_abi_entering_spm * backend_abi_entering_spm calls arch_acquire_sched_lock * arch_acquire_sched_lock sets scheduler_lock = SCHEDULER_LOCKED * psa_wait (called by idle_partition) is being processed up to the point of backend_abi_leaving_spm * backend_abi_leaving_spm calls arch_release_sched_lock * here is where very sneaky the bug happens * arch_release_sched_lock executes following assembly instructions
i. "ldr r1, =scheduler_lock \n" "ldr r0, [r1, #0] \n"
ii. At this point r0 holds scheduler_lock is = SCHEDULER_LOCKED
iii. After these instructions are executed FLIH interrupt arrives
* FLIH handler asserts signal (which should unblock execution of the Partition A) * spm_handle_interrupt calls backend_assert_signal * backend_assert_signal does if (p_pt->signals_asserted & p_pt->signals_waiting) and returns STATUS_NEED_SCHEDULE * spm_handle_interrupt calls arch_attempt_schedule * arch_attempt_schedule checks value of scheduler_lock (which is SCHEDULER_LOCKED) and sets scheduler_lock= SCHEDULER_ATTEMPTED * Interrupt returns
iv. Execution continues, now scheduler_lock is = SCHEDULER_ATTEMPTED But the next line of code in arch_release_sched_lock is "movs r2, #"M2S(SCHEDULER_UNLOCKED)" \n"/* Unlock scheduler */
This effectively overwrites scheduler_lock from SCHEDULER_ATTEMPTED to SCHEDULER_UNLOCKED This means that following SRM scheduling logic will not trigger PendSV and just return to idle_partition – effectively resulting in a hang of a system.
Looks like the solution is to wrap lock logic in critical section. But may be there is other things that can be done to better fix this issue.
Let me know if there are other details that may be helpful to fix this bug.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Hi Nicola,
You are right — the critical section in the top-level function does correctly protect the lock mechanism.
I did some additional debugging and here’s what I’m observing:
1. A partition calls psa_wait() and blocks, waiting for a signal that will be asserted by an IRQ. 2. Idle partition is scheduled and is being executed. 3. A Non-Secure SysTick interrupt preempts the idle partition. 4. A Secure IRQ preempts the NS SysTick and asserts the signal. 5. The scheduling attempt sets PendSV pending. 6. PendSV runs but returns early because the NS context was interrupted, so no scheduling occurs. 7. The signal then remains unhandled indefinitely, because no further PSA calls are made.
This looks like the scenario we discussed in other mailing threads (related to the CONFIG_TFM_SCHEDULE_WHEN_NS_INTERRUPTED option).
However, I’m wondering if I’m missing something. In the idle partition code, I see the following comment and call: /* * There could be other Partitions becoming RUNNABLE after wake up. * This is a dummy psa_wait to let SPM check possible scheduling. * It does not expect any signals. */ if (psa_wait(PSA_WAIT_ANY, PSA_POLL) == 0) {
My understanding from the comment is that this “dummy” psa_wait() is intended to trigger scheduling if another partition became runnable while we were idle.
But in tfm_spm_partition_psa_wait(), the polling path appears to just return the currently asserted signals for the calling partition: /* * After new signal(s) are available, the return value will be updated in * PendSV and blocked thread gets to run. */ if (timeout == PSA_BLOCK) { signal = backend_wait_signals(partition, signal_mask); if (signal == (psa_signal_t)0) { signal = (psa_signal_t)STATUS_NEED_SCHEDULE; } } else { signal = partition->signals_asserted & signal_mask; }
Since the idle partition won’t have any asserted signals, this poll call will always return 0 and never request scheduling — even if another partition has become runnable in the meantime.
This seems to explain why, after returning to the idle partition and executing these poll operations, the runnable partition is still not being scheduled.
Am I interpreting this correctly? If so, what would be the recommended solution (e.g. does adjusting the idle “dummy wait” behavior, or something else)?
Best regards, Bohdan Hunko
Cypress Semiconductor Ukraine LLC Senior Engineer CSS ICW SW INT BFS SFW Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
From: Nicola Mazzucato Nicola.Mazzucato@arm.com Sent: Monday, 22 December 2025 16:59 To: Hunko Bohdan (CSS ICW SW INT BFS SFW) Bohdan.Hunko@infineon.com Cc: Kozemchuk Ivan (CSS ICW SW INT BFS SFW) Ivan.Kozemchuk@infineon.com; Kytsun Hennadiy (CSS ICW SW INT BFS SFW) Hennadiy.Kytsun@infineon.com; tf-m@lists.trustedfirmware.org Subject: Re: Race condition in SPM scheduler lock logic
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Thank you Bohdan,
I am still a bit confused about the setup, because that section in SPM always executes in privileged execution. If the calling partition is not privileged, then the SVC handler will take place to elevate execution.
Thanks Best regards, Nick
________________________________ From: Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com <Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com> Sent: 19 December 2025 10:31 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: Race condition in SPM scheduler lock logic
Hi Nicola,
* Can you please share a bit more about your interrupt configurations, priorities etc?
We don’t do anything special, the IRQ priority is Normal, nothing unusual.
* Am I missing something else?
Looking into the code one thing that comes to mind is that tfm_arch_thread_fn_call can be called from unprivileged partition thus interrupt masking will not take effect. I believe this explains the behavior described in previous mail.
If so then not only this code is effected, but other multithread issues may occur in different places of tfm_arch_thread_fn_call.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Friday, 19 December 2025 11:59 To: Hunko Bohdan (CSS ICW SW INT BFS SFW) <Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com> Cc: Kozemchuk Ivan (CSS ICW SW INT BFS SFW) <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Kytsun Hennadiy (CSS ICW SW INT BFS SFW) <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com>; Anton Komlev via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: Re: Race condition in SPM scheduler lock logic
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Bohdan,
The sequence you provided seems reasonable, however "backend_abi_leaving_spm" and the subsequent "arch_release_sched_lock" execute with all interrupts disabled, so there are no interrupts that should change the scheduler_lock in between [1].
A pending interrupt would execute as soon as L:91, and then would correctly set the PendSV.
Can you please share a bit more about your interrupt configurations, priorities etc?
Am I missing something else?
Thanks
Best regards,
Nick
[1]
https://git.trustedfirmware.org/plugins/gitiles/TF-M/trusted-firmware-m.git/...
________________________________
From: Nicola Mazzucato via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 17 December 2025 08:37 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org>; Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com <Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com> Subject: [TF-M] Re: Race condition in SPM scheduler lock logic
Thanks Bohdan for reporting this.
Let me have a look and try to reproduce it.
Best regards,
Nick
________________________________
From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 16 December 2025 20:54 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com <Ivan.Kozemchuk@infineon.commailto:Ivan.Kozemchuk@infineon.com>; Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com> Subject: [TF-M] Race condition in SPM scheduler lock logic
Hi all,
I have found a bug in SPM scheduler lock logic – this bug is extremely hard to reproduce as it requires precise conditions and timings, but here is the description of the bug scenario:
1. Partition A calls psa_wait to wait for a signal (this signal is going to be asserted by FLIH IRQ later) 2. Currently signal is not asserted, no other partition is runnable, thus SPM marks this signal as being awaited and then schedules idle_thread 3. idle_thread calls psa_wait to poll SPM
* psa_wait calls tfm_arch_thread_fn_call * tfm_arch_thread_fn_call calls backend_abi_entering_spm * backend_abi_entering_spm calls arch_acquire_sched_lock * arch_acquire_sched_lock sets scheduler_lock = SCHEDULER_LOCKED * psa_wait (called by idle_partition) is being processed up to the point of backend_abi_leaving_spm * backend_abi_leaving_spm calls arch_release_sched_lock * here is where very sneaky the bug happens * arch_release_sched_lock executes following assembly instructions
i. "ldr r1, =scheduler_lock \n" "ldr r0, [r1, #0] \n"
ii. At this point r0 holds scheduler_lock is = SCHEDULER_LOCKED
iii. After these instructions are executed FLIH interrupt arrives
* FLIH handler asserts signal (which should unblock execution of the Partition A) * spm_handle_interrupt calls backend_assert_signal * backend_assert_signal does if (p_pt->signals_asserted & p_pt->signals_waiting) and returns STATUS_NEED_SCHEDULE * spm_handle_interrupt calls arch_attempt_schedule * arch_attempt_schedule checks value of scheduler_lock (which is SCHEDULER_LOCKED) and sets scheduler_lock= SCHEDULER_ATTEMPTED * Interrupt returns
iv. Execution continues, now scheduler_lock is = SCHEDULER_ATTEMPTED But the next line of code in arch_release_sched_lock is "movs r2, #"M2S(SCHEDULER_UNLOCKED)" \n"/* Unlock scheduler */
This effectively overwrites scheduler_lock from SCHEDULER_ATTEMPTED to SCHEDULER_UNLOCKED This means that following SRM scheduling logic will not trigger PendSV and just return to idle_partition – effectively resulting in a hang of a system.
Looks like the solution is to wrap lock logic in critical section. But may be there is other things that can be done to better fix this issue.
Let me know if there are other details that may be helpful to fix this bug.
Bohdan Hunko
Cypress Semiconductor Ukraine LLC
Senior Engineer
CSS ICW SW INT BFS SFW
Mobile: +380995019714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1 I 've the following error: $ build_L56_psa_gnu_s -- The C compiler identification is GNU 15.2.0 CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include): include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library): Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred! ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is : cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build") set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library( LIB_NAME psa_arch_tests LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR} LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH FETCH_CONTENT_ARGS GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git GIT_TAG ${PSA_ARCH_TESTS_VERSION} GIT_SHALLOW TRUE GIT_PROGRESS TRUE )
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC735C.C928EC00]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC735C.C928EC00] https://twitter.com/st_world [cid:image004.png@01DC735C.C928EC00] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC735C.C928EC00] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC735C.C928EC00] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps, Best regards, Nick
________________________________ From: Ronan GABOU via TF-M tf-m@lists.trustedfirmware.org Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC735C.C928EC00]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC735C.C928EC00] https://twitter.com/st_world [cid:image004.png@01DC735C.C928EC00] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC735C.C928EC00] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC735C.C928EC00] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hi Nick,
Thank you for your answer. I didn’t succeed ☹ However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file From \trusted-firmware-m\cmake\ To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7E5A.A685B850]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7E5A.A685B850] https://twitter.com/st_world [cid:image004.png@01DC7E5A.A685B850] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7E5A.A685B850] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7E5A.A685B850] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
From: Nicola Mazzucato Nicola.Mazzucato@arm.com Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.org; Ronan GABOU Ronan.GABOU@st.com Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps, Best regards, Nick
________________________________ From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7E5A.A685B850]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7E5A.A685B850] https://twitter.com/st_world [cid:image004.png@01DC7E5A.A685B850] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7E5A.A685B850] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7E5A.A685B850] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps, Anton
From: Ronan GABOU via TF-M tf-m@lists.trustedfirmware.org Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato Nicola.Mazzucato@arm.com; tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer. I didn’t succeed ☹ However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file From \trusted-firmware-m\cmake\ To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7E62.278ED880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7E62.278ED880] https://twitter.com/st_world [cid:image004.png@01DC7E62.278ED880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7E62.278ED880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7E62.278ED880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps, Best regards, Nick
________________________________ From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7E62.278ED880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7E62.278ED880] https://twitter.com/st_world [cid:image004.png@01DC7E62.278ED880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7E62.278ED880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7E62.278ED880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hello Anton,
Thank you for your answer. I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm” To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message: -- The C compiler identification is GNU 15.2.0 CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include): include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library): Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred! ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7EFD.C4AD7540]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7EFD.C4AD7540] https://twitter.com/st_world [cid:image004.png@01DC7EFD.C4AD7540] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7EFD.C4AD7540] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7EFD.C4AD7540] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
From: Anton Komlev Anton.Komlev@arm.com Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU Ronan.GABOU@st.com; Nicola Mazzucato Nicola.Mazzucato@arm.com; tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps, Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer. I didn’t succeed ☹ However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file From \trusted-firmware-m\cmake\ To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7EFD.C4AD7540]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7EFD.C4AD7540] https://twitter.com/st_world [cid:image004.png@01DC7EFD.C4AD7540] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7EFD.C4AD7540] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7EFD.C4AD7540] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps, Best regards, Nick
________________________________ From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7EFD.C4AD7540]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7EFD.C4AD7540] https://twitter.com/st_world [cid:image004.png@01DC7EFD.C4AD7540] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7EFD.C4AD7540] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7EFD.C4AD7540] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks Best regards, Nick
________________________________ From: Ronan GABOU Ronan.GABOU@st.com Sent: 06 January 2026 10:19 To: Anton Komlev Anton.Komlev@arm.com; Nicola Mazzucato Nicola.Mazzucato@arm.com; tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7EFD.C4AD7540]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7EFD.C4AD7540] https://twitter.com/st_world [cid:image004.png@01DC7EFD.C4AD7540] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7EFD.C4AD7540] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7EFD.C4AD7540] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev Anton.Komlev@arm.com Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU Ronan.GABOU@st.com; Nicola Mazzucato Nicola.Mazzucato@arm.com; tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7EFD.C4AD7540]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7EFD.C4AD7540] https://twitter.com/st_world [cid:image004.png@01DC7EFD.C4AD7540] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7EFD.C4AD7540] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7EFD.C4AD7540] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7EFD.C4AD7540]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7EFD.C4AD7540] https://twitter.com/st_world [cid:image004.png@01DC7EFD.C4AD7540] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7EFD.C4AD7540] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7EFD.C4AD7540] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hello Nick,
For sure :
build_L56_psa_gnu_s() { cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE cmake --build $L56_build_s -- install } build_L56_psa_gnu_ns() { cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch -B $L56_build_ns -GNinja -DCONFIG_SPE_PATH=$L56_build_s/api_ns -DTFM_TOOLCHAIN_FILE=$L56_build_s/api_ns/cmake/toolchain_ns_GNUARM.cmake cmake --build $L56_build_ns }
With :
[cid:image007.png@01DC7F02.06629B60]
export L56_tfm_src="$TFM_work_dir_L56/trusted-firmware-m"
export L56_build_s="$TFM_work_dir_L56/build_s" export L56_build_ns="$TFM_work_dir_L56/build_ns"
Thank you for your help
Ronan
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
From: Nicola Mazzucato Nicola.Mazzucato@arm.com Sent: Tuesday, January 6, 2026 11:25 AM To: Ronan GABOU Ronan.GABOU@st.com; tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks Best regards, Nick
________________________________ From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:19 To: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hi Ronan,
I just tried the following with success:
:~tf-m-tests/tests_psa_arch$ cmake -G Ninja -S ///tf-m-tests/tests_psa_arch/spe -B build_stm -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE -DCONFIG_TFM_SOURCE_PATH=///tfm -DPSA_ARCH_TESTS_PATH=///psa-arch-tests -DTFM_TOOLCHAIN_FILE=///tfm/toolchain_GNUARM.cmake -- The C compiler identification is GNU 13.3.1 -- Configuring done -- Generating done -- Build files have been written to: ///tf-m-tests/tests_psa_arch/build_stm
:~/tf-m-tests/tests_psa_arch$ cmake --build build_stm -- install -j 1
If I omit -DPSA_ARCH_TESTS_PATH then I have the same errors as you reported: CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include): include could not find requested file:
remote_library
CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library): Unknown CMake command "fetch_remote_library".
Your commands seem to be missing the required DPSA_ARCH_TESTS_PATH.
Hope that helps
Best regards Nick
________________________________ From: Ronan GABOU Ronan.GABOU@st.com Sent: 06 January 2026 10:46 To: Nicola Mazzucato Nicola.Mazzucato@arm.com; tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Nick,
For sure :
build_L56_psa_gnu_s()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE
cmake --build $L56_build_s -- install
}
build_L56_psa_gnu_ns()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch -B $L56_build_ns -GNinja -DCONFIG_SPE_PATH=$L56_build_s/api_ns -DTFM_TOOLCHAIN_FILE=$L56_build_s/api_ns/cmake/toolchain_ns_GNUARM.cmake
cmake --build $L56_build_ns
}
With :
[cid:image007.png@01DC7F02.06629B60]
export L56_tfm_src="$TFM_work_dir_L56/trusted-firmware-m"
export L56_build_s="$TFM_work_dir_L56/build_s"
export L56_build_ns="$TFM_work_dir_L56/build_ns"
Thank you for your help
Ronan
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato Nicola.Mazzucato@arm.com Sent: Tuesday, January 6, 2026 11:25 AM To: Ronan GABOU Ronan.GABOU@st.com; tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks
Best regards,
Nick
________________________________
From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:19 To: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC7F01.7D334880]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC7F01.7D334880] https://twitter.com/st_world [cid:image004.png@01DC7F01.7D334880] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC7F01.7D334880] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC7F01.7D334880] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Looking at tests_psa_arch/fetch_repo/CMakeLists.txt, it seems that PSA_ARCH_TESTS_PATH should be optional. I suspect that tests_psa_arch/CMakeLists.txt needs to append an additional path to CMAKE_MODULE_PATH, like tests_reg/CMakeLists.txt does…
Chris
From: Nicola Mazzucato via TF-M tf-m@lists.trustedfirmware.org Sent: Tuesday, January 6, 2026 8:30 AM To: Ronan GABOU Ronan.GABOU@st.com; tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Ronan,
I just tried the following with success:
:~tf-m-tests/tests_psa_arch$ cmake -G Ninja -S ///tf-m-tests/tests_psa_arch/spe -B build_stm -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE -DCONFIG_TFM_SOURCE_PATH=///tfm -DPSA_ARCH_TESTS_PATH=///psa-arch-tests -DTFM_TOOLCHAIN_FILE=///tfm/toolchain_GNUARM.cmake -- The C compiler identification is GNU 13.3.1 -- Configuring done -- Generating done -- Build files have been written to: ///tf-m-tests/tests_psa_arch/build_stm
:~/tf-m-tests/tests_psa_arch$ cmake --build build_stm -- install -j 1
If I omit -DPSA_ARCH_TESTS_PATH then I have the same errors as you reported: CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include): include could not find requested file:
remote_library
CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library): Unknown CMake command "fetch_remote_library".
Your commands seem to be missing the required DPSA_ARCH_TESTS_PATH.
Hope that helps
Best regards Nick
________________________________ From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:46 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Nick,
For sure :
build_L56_psa_gnu_s()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE
cmake --build $L56_build_s -- install
}
build_L56_psa_gnu_ns()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch -B $L56_build_ns -GNinja -DCONFIG_SPE_PATH=$L56_build_s/api_ns -DTFM_TOOLCHAIN_FILE=$L56_build_s/api_ns/cmake/toolchain_ns_GNUARM.cmake
cmake --build $L56_build_ns
}
With :
[cid:image007.png@01DC7EEC.C6EB6710]
export L56_tfm_src="$TFM_work_dir_L56/trusted-firmware-m"
export L56_build_s="$TFM_work_dir_L56/build_s"
export L56_build_ns="$TFM_work_dir_L56/build_ns"
Thank you for your help
Ronan
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Tuesday, January 6, 2026 11:25 AM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks
Best regards,
Nick
________________________________
From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:19 To: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
You’re right passing any dependency path should be optional and if not passed explicitly it should be fetched through FetchRepo (and patched on the fly as usual with the .patch files we keep) so if that doesn’t work it means we have a bug that has to be fixed.
Thanks, Antonio
Sent from Outlook for Mac
From: Chris.Brand--- via TF-M tf-m@lists.trustedfirmware.org Date: Tuesday, 6 January 2026 at 17:15 To: Nicola Mazzucato Nicola.Mazzucato@arm.com, Ronan.GABOU@st.com Ronan.GABOU@st.com, tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Looking at tests_psa_arch/fetch_repo/CMakeLists.txt, it seems that PSA_ARCH_TESTS_PATH should be optional. I suspect that tests_psa_arch/CMakeLists.txt needs to append an additional path to CMAKE_MODULE_PATH, like tests_reg/CMakeLists.txt does…
Chris
From: Nicola Mazzucato via TF-M tf-m@lists.trustedfirmware.org Sent: Tuesday, January 6, 2026 8:30 AM To: Ronan GABOU Ronan.GABOU@st.com; tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Ronan,
I just tried the following with success:
:~tf-m-tests/tests_psa_arch$ cmake -G Ninja -S ///tf-m-tests/tests_psa_arch/spe -B build_stm -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE -DCONFIG_TFM_SOURCE_PATH=///tfm -DPSA_ARCH_TESTS_PATH=///psa-arch-tests -DTFM_TOOLCHAIN_FILE=///tfm/toolchain_GNUARM.cmake -- The C compiler identification is GNU 13.3.1 -- Configuring done -- Generating done -- Build files have been written to: ///tf-m-tests/tests_psa_arch/build_stm
:~/tf-m-tests/tests_psa_arch$ cmake --build build_stm -- install -j 1
If I omit -DPSA_ARCH_TESTS_PATH then I have the same errors as you reported: CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include): include could not find requested file:
remote_library
CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library): Unknown CMake command "fetch_remote_library".
Your commands seem to be missing the required DPSA_ARCH_TESTS_PATH.
Hope that helps
Best regards Nick
________________________________ From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:46 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Nick,
For sure :
build_L56_psa_gnu_s()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE
cmake --build $L56_build_s -- install
}
build_L56_psa_gnu_ns()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch -B $L56_build_ns -GNinja -DCONFIG_SPE_PATH=$L56_build_s/api_ns -DTFM_TOOLCHAIN_FILE=$L56_build_s/api_ns/cmake/toolchain_ns_GNUARM.cmake
cmake --build $L56_build_ns
}
With :
[cid:image007.png@01DC7EEC.C6EB6710]
export L56_tfm_src="$TFM_work_dir_L56/trusted-firmware-m"
export L56_build_s="$TFM_work_dir_L56/build_s"
export L56_build_ns="$TFM_work_dir_L56/build_ns"
Thank you for your help
Ronan
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Tuesday, January 6, 2026 11:25 AM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks
Best regards,
Nick
________________________________
From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:19 To: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image009.png@01DC7EEC.C6EB6710]https://www.facebook.com/STMicroelectronics.NV/ [cid:image010.png@01DC7EEC.C6EB6710] https://twitter.com/st_world [cid:image011.png@01DC7EEC.C6EB6710] https://www.linkedin.com/company/stmicroelectronics/ [cid:image012.png@01DC7EEC.C6EB6710] https://www.instagram.com/stmicroelectronics.nv/ [cid:image013.png@01DC7EEC.C6EB6710] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Hello All,
Thank you for your help. I confirm that instead of copy paste from TFM to tf-m-test : remote_library.cmake file
I changed from list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../cmake) include(collect_args) to list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../cmake) list(APPEND CMAKE_MODULE_PATH ${CONFIG_TFM_SOURCE_PATH}/cmake) include(collect_args)
In : c:\TFM_L56\tf-m-tests\tests_psa_arch\spe\CMakeLists.txt
Also solve my build issue.
Are you waiting for me to do something more for this topic or it is now internal to ARM ?
Thank you
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19 MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com online: www.st.com
From: Antonio De Angelis Antonio.DeAngelis@arm.com Sent: Tuesday, January 6, 2026 7:53 PM To: Chris.Brand@infineon.com; Nicola Mazzucato Nicola.Mazzucato@arm.com; Ronan GABOU Ronan.GABOU@st.com; tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com; nd nd@arm.com Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
You’re right passing any dependency path should be optional and if not passed explicitly it should be fetched through FetchRepo (and patched on the fly as usual with the .patch files we keep) so if that doesn’t work it means we have a bug that has to be fixed.
Thanks, Antonio
Sent from Outlook for Mac From: Chris.Brand--- via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Date: Tuesday, 6 January 2026 at 17:15 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>, Ronan.GABOU@st.commailto:Ronan.GABOU@st.com <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>, tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: [TF-M] Re: : PSA API test build issue on main branch TFM Looking at tests_psa_arch/fetch_repo/CMakeLists.txt, it seems that PSA_ARCH_TESTS_PATH should be optional. I suspect that tests_psa_arch/CMakeLists.txt needs to append an additional path to CMAKE_MODULE_PATH, like tests_reg/CMakeLists.txt does…
Chris
From: Nicola Mazzucato via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Tuesday, January 6, 2026 8:30 AM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Ronan,
I just tried the following with success:
:~tf-m-tests/tests_psa_arch$ cmake -G Ninja -S ///tf-m-tests/tests_psa_arch/spe -B build_stm -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE -DCONFIG_TFM_SOURCE_PATH=///tfm -DPSA_ARCH_TESTS_PATH=///psa-arch-tests -DTFM_TOOLCHAIN_FILE=///tfm/toolchain_GNUARM.cmake -- The C compiler identification is GNU 13.3.1 -- Configuring done -- Generating done -- Build files have been written to: ///tf-m-tests/tests_psa_arch/build_stm
:~/tf-m-tests/tests_psa_arch$ cmake --build build_stm -- install -j 1
If I omit -DPSA_ARCH_TESTS_PATH then I have the same errors as you reported: CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include): include could not find requested file:
remote_library
CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library): Unknown CMake command "fetch_remote_library".
Your commands seem to be missing the required DPSA_ARCH_TESTS_PATH.
Hope that helps
Best regards Nick
________________________________ From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:46 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Nick,
For sure :
build_L56_psa_gnu_s()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE
cmake --build $L56_build_s -- install
}
build_L56_psa_gnu_ns()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch -B $L56_build_ns -GNinja -DCONFIG_SPE_PATH=$L56_build_s/api_ns -DTFM_TOOLCHAIN_FILE=$L56_build_s/api_ns/cmake/toolchain_ns_GNUARM.cmake
cmake --build $L56_build_ns
}
With :
[cid:image007.png@01DC8091.C220E060]
export L56_tfm_src="$TFM_work_dir_L56/trusted-firmware-m"
export L56_build_s="$TFM_work_dir_L56/build_s"
export L56_build_ns="$TFM_work_dir_L56/build_ns"
Thank you for your help
Ronan
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Tuesday, January 6, 2026 11:25 AM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks
Best regards,
Nick
________________________________
From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:19 To: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
Thanks Ronan,
I gave that change a quick test and seems to work. I created a patch for that at: https://review.trustedfirmware.org/c/TF-M/tf-m-tests/+/46912
Please have a look and leave your comments.
Thanks Best regards Nick
________________________________ From: Ronan GABOU Ronan.GABOU@st.com Sent: 08 January 2026 10:31 To: Antonio De Angelis Antonio.DeAngelis@arm.com; Chris.Brand@infineon.com Chris.Brand@infineon.com; Nicola Mazzucato Nicola.Mazzucato@arm.com; tf-m@lists.trustedfirmware.org tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com; nd nd@arm.com Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello All,
Thank you for your help.
I confirm that instead of copy paste from TFM to tf-m-test : remote_library.cmake file
I changed
from
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../cmake)
include(collect_args)
to
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../cmake)
list(APPEND CMAKE_MODULE_PATH ${CONFIG_TFM_SOURCE_PATH}/cmake)
include(collect_args)
In : c:\TFM_L56\tf-m-tests\tests_psa_arch\spe\CMakeLists.txt
Also solve my build issue.
Are you waiting for me to do something more for this topic or it is now internal to ARM ?
Thank you
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Antonio De Angelis Antonio.DeAngelis@arm.com Sent: Tuesday, January 6, 2026 7:53 PM To: Chris.Brand@infineon.com; Nicola Mazzucato Nicola.Mazzucato@arm.com; Ronan GABOU Ronan.GABOU@st.com; tf-m@lists.trustedfirmware.org Cc: Anton Komlev Anton.Komlev@arm.com; nd nd@arm.com Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
You’re right passing any dependency path should be optional and if not passed explicitly it should be fetched through FetchRepo (and patched on the fly as usual with the .patch files we keep) so if that doesn’t work it means we have a bug that has to be fixed.
Thanks,
Antonio
Sent from Outlook for Mac
From: Chris.Brand--- via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Date: Tuesday, 6 January 2026 at 17:15 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>, Ronan.GABOU@st.commailto:Ronan.GABOU@st.com <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>, tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Looking at tests_psa_arch/fetch_repo/CMakeLists.txt, it seems that PSA_ARCH_TESTS_PATH should be optional. I suspect that tests_psa_arch/CMakeLists.txt needs to append an additional path to CMAKE_MODULE_PATH, like tests_reg/CMakeLists.txt does…
Chris
From: Nicola Mazzucato via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Tuesday, January 6, 2026 8:30 AM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Caution: This e-mail originated outside Infineon Technologies. Please be cautious when sharing information or opening attachments especially from unknown senders. Refer to our intranet guidehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx to help you identify Phishing email.
Hi Ronan,
I just tried the following with success:
:~tf-m-tests/tests_psa_arch$ cmake -G Ninja -S ///tf-m-tests/tests_psa_arch/spe -B build_stm -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE -DCONFIG_TFM_SOURCE_PATH=///tfm -DPSA_ARCH_TESTS_PATH=///psa-arch-tests -DTFM_TOOLCHAIN_FILE=///tfm/toolchain_GNUARM.cmake
-- The C compiler identification is GNU 13.3.1
-- Configuring done
-- Generating done
-- Build files have been written to: ///tf-m-tests/tests_psa_arch/build_stm
:~/tf-m-tests/tests_psa_arch$ cmake --build build_stm -- install -j 1
If I omit -DPSA_ARCH_TESTS_PATH then I have the same errors as you reported:
CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at ///tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
Your commands seem to be missing the required DPSA_ARCH_TESTS_PATH.
Hope that helps
Best regards
Nick
________________________________
From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:46 To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Nick,
For sure :
build_L56_psa_gnu_s()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE
cmake --build $L56_build_s -- install
}
build_L56_psa_gnu_ns()
{
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch -B $L56_build_ns -GNinja -DCONFIG_SPE_PATH=$L56_build_s/api_ns -DTFM_TOOLCHAIN_FILE=$L56_build_s/api_ns/cmake/toolchain_ns_GNUARM.cmake
cmake --build $L56_build_ns
}
With :
[cid:image007.png@01DC8091.C220E060]
export L56_tfm_src="$TFM_work_dir_L56/trusted-firmware-m"
export L56_build_s="$TFM_work_dir_L56/build_s"
export L56_build_ns="$TFM_work_dir_L56/build_ns"
Thank you for your help
Ronan
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Tuesday, January 6, 2026 11:25 AM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Subject: Re: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
Can you please share your entire build command so we can try replicate it on our side?
Thanks
Best regards,
Nick
________________________________
From: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Sent: 06 January 2026 10:19 To: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hello Anton,
Thank you for your answer.
I use trusted FW main cloned yesterday (13fca17c64af961b36fad741e9b042d43ff29129) and tf-m-tests indicated into trusted firmware (7314943) and mcuboot tagged “tfm”
To be able to build PSA API tests I had to copy paste the .cmake file.
If not the first cmake command failed immediately with this message:
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L55/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Anton Komlev <Anton.Komlev@arm.commailto:Anton.Komlev@arm.com> Sent: Monday, January 5, 2026 5:48 PM To: Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com>; Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: RE: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Ronan,
remote_library.cmake is installed from trusted-firmware-m during the secure image build. There were some changes to this logic not that long ago, so you may need to update both repositories and rebase your changes. Could you give that a try?
Hope that helps,
Anton
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Monday, January 5, 2026 2:53 PM To: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com>; tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: : PSA API test build issue on main branch TFM
Hi Nick,
Thank you for your answer.
I didn’t succeed ☹
However to solve my issue and run correctly the PSA API tests on my STM32L5 DK board I had to copy paste remote_library.cmake file
From \trusted-firmware-m\cmake\
To \tf-m-tests\cmake\
My problem is to be sure it is the correct way to proceed …
Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
From: Nicola Mazzucato <Nicola.Mazzucato@arm.commailto:Nicola.Mazzucato@arm.com> Sent: Monday, December 22, 2025 4:34 PM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Ronan GABOU <Ronan.GABOU@st.commailto:Ronan.GABOU@st.com> Subject: Re: [TF-M] : PSA API test build issue on main branch TFM
Hi Ronan,
I think you may need to add -DPSA_ARCH_TESTS_PATH=<absolute-path-to-psa-arch-tests> to your build command.
Hope that helps,
Best regards,
Nick
________________________________
From: Ronan GABOU via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 22 December 2025 15:19 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] : PSA API test build issue on main branch TFM
Hello All,
I wanted to run regression and PSA API tests before Upstreaming ST patches to community.
However I had issue with PSA API tests.
Note, that I can build Regression tests without any problem.
I use the main branch and latest SHA1
I ‘ve the following error:
$ build_L56_psa_gnu_s
-- The C compiler identification is GNU 15.2.0
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:10 (include):
include could not find requested file:
remote_library
CMake Error at C:/TFM_L56/tf-m-tests/tests_psa_arch/fetch_repo/CMakeLists.txt:15 (fetch_remote_library):
Unknown CMake command "fetch_remote_library".
-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The cmake command is :
cmake -S $TFM_work_dir_L56/tf-m-tests/tests_psa_arch/spe -B $L56_build_s -GNinja -DTFM_PLATFORM=stm/stm32l562e_dk -DTFM_TOOLCHAIN_FILE=$L56_tfm_src/toolchain_GNUARM.cmake -DCONFIG_TFM_SOURCE_PATH=$L56_tfm_src -DTFM_PSA_API=ON -DTEST_PSA_API=PROTECTED_STORAGE;
c:\TFM_L56\tf-m-tests\tests_psa_arch\fetch_repo\CMakeLists.txt content is :
include(remote_library)
set(PSA_ARCH_TESTS_PATH "DOWNLOAD" CACHE PATH "Path to PSA arch test repository used for SPE build")
set(PSA_ARCH_TESTS_VERSION "v24.03_API1.6_CRYPTO_1.1.0" CACHE STRING "The version of PSA arch tests to use")
fetch_remote_library(
LIB_NAME psa_arch_tests
LIB_SOURCE_PATH_VAR PSA_ARCH_TESTS_PATH
LIB_BASE_DIR ${CMAKE_BINARY_DIR}/fetch_repo
LIB_PATCH_DIR ${CMAKE_CURRENT_LIST_DIR}
LIB_FORCE_PATCH PSA_ARCH_TESTS_FORCE_PATCH
FETCH_CONTENT_ARGS
GIT_REPOSITORY https://github.com/ARM-software/psa-arch-tests.git
GIT_TAG ${PSA_ARCH_TESTS_VERSION}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Note In case I use v2.1.3 TFM tag with associated tf-m-tests and mcuboot SHA1 I can build the PSA API binaries without this error.
Does someone can provide me ideas / tracks to solve my problem?
Thank you for your time, Ronan,
[Shape, rectangle Description automatically generated]
Ronan GABOU | Tel: +33 1 58 07 80 19
MDG / General Purpose Microcontroller Sub-Group / Wireless Business Line / Cellular
[cid:image002.png@01DC8091.C220E060]https://www.facebook.com/STMicroelectronics.NV/ [cid:image003.png@01DC8091.C220E060] https://twitter.com/st_world [cid:image004.png@01DC8091.C220E060] https://www.linkedin.com/company/stmicroelectronics/ [cid:image005.png@01DC8091.C220E060] https://www.instagram.com/stmicroelectronics.nv/ [cid:image006.png@01DC8091.C220E060] https://www.youtube.com/user/STonlineMedia ST online: www.st.com
online: www.st.com
tf-m@lists.trustedfirmware.org