Skip to main content
Visitor II
November 10, 2025
Solved

Slow programming with TrustZone

  • November 10, 2025
  • 1 reply
  • 149 views

Hi,

I've started working with the SBSFU example recently on an STMU585. I have noticed that flashing the sbsfu_app_init.bin file is much slower (10x maybe?) if TrustZone is enabled.

My workaround has been to create a script to do a regression to RDP level 0 with TrustZone disabled, which will mass erase the device, and then reflash both sbsfu_app_init.bin and the bootloader each time before renabling TrustZone at the end.

I was wondering what the specific root cause of the slower flashing is, and if there is a better workflow that would allow me to update just the sbsfu_app_init.bin, or potentially just the NS part, with speeds comparable to those I get when the device is blank.

Thanks,

Mike

Best answer by

Yes, the slower flashing is normal when TrustZone and RDP1 are enabled. The ST-Link has to use secure access paths instead of direct flash writes, which makes programming much slower.

Your workaround (RDP0 + disable TrustZone for dev) is fine for now, but for production you should use the SBSFU secure update process to load new app images. Keeping RDP0 during development is the best way to maintain normal flashing speed — especially when you're also relying on a small external tool for quick checks.

 

 

1 reply

Best answer
November 10, 2025

Yes, the slower flashing is normal when TrustZone and RDP1 are enabled. The ST-Link has to use secure access paths instead of direct flash writes, which makes programming much slower.

Your workaround (RDP0 + disable TrustZone for dev) is fine for now, but for production you should use the SBSFU secure update process to load new app images. Keeping RDP0 during development is the best way to maintain normal flashing speed — especially when you're also relying on a small external tool for quick checks.