Standard CubeMX project ICACHE error handler (STiRot + Secure Application)
- April 24, 2026
- 0 replies
- 64 views
Hi all,
I'm trying to replay the demo from this video
https://www.youtube.com/watch?v=Kn6JHVcY7hA
The provisioning and debug authentication works fine, but the application hangs.
I never passes the MX_ICACHE_Init() function.
And sometimes in the MPU init or config function.
The project is standard generated code, I'm using STM32H573I-DK but empty chip project like in the video.
Project settings :
- Select STM32H573IIKxQ
- Click yes on enabling ICACHE and MPU

- Enable trustzone
- Secure project only
- Generate DA folder
- Bootpath : STiRot + Secure Application (offset 0, offset 0x100000, size 0x100000)
- PI9 as output and PC13 as input
- Generate project
- Add loader.h and loader.c and add blinky like in the video
The project was imported in STM32CubeIDE 2.1.1 and build fine.
I've used provisioning.bat to provision my board to CLOSED.
LD1 on the board turns on but doesn't blink.
After connecting to the board with Debug Authentication it seems to hang in
MX_ICACHE_Init -> if (HAL_ICACHE_ConfigAssociativityMode(ICACHE_1WAY) != HAL_OK) -> Error_Handler()
Why would it go into Error_Handler out of MX_ICACHE_Init when this is enabled by default by CubeMX? I haven't changed anything on this.
My project is attached including IOC file. I've used default keys so no secrets here.
Edit 1 :
When I comment out MX_ICACHE_Init() it works fine!
So for some reason the MX_ICACHE_Init() function causes issues...
