Skip to main content
Associate
July 30, 2026
Question

Can you bank swap from nonsecure code on a STM32H563 with Trustzone enabled?

  • July 30, 2026
  • 1 reply
  • 68 views

I am working on a project on a STM32H563 with trustzone enabled. Our firmware update strategy relies on using the dual bank flash and swapping when needed. I was wondering if you can set the SWAP_BANK option byte and trigger a bank swap from non-secure code with SECBOOT_LOCK not set?. I am asking because do not I want a hacked non-secure application to be able to trigger a bank swap to potentially untrusted code on the other bank. I could not find a clear answer in the reference manual.

1 reply

Bubbles
ST Employee
August 21, 2026

Hi ​@JWagner ,

the H5 is limited to only swap using the OB programming. I’d recommend to use TZ to prevent the non-secure from any flash write access (the NS app has to request secure service to write flash) and this will prevent the NS to SWAP.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.