cancel
Showing results for 
Search instead for 
Did you mean: 

Standard CubeMX project ICACHE error handler (STiRot + Secure Application)

Marty_Revival
Associate II

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.
Marty_Revival_0-1777034564249.png


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

Marty_Revival_0-1777030195738.png

  • 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...

1 REPLY 1
Jocelyn RICARD
ST Employee

Hello @Marty_Revival ,

This issue is very probably related to the fact that Icache is already enabled in STiROT.

The MX_ICACHE_Init is expecting an execution from non active cache.

So, you need first to deinit the cache if it is not setup in the way you want.

Best regards

Jocelyn