cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H563 I2C doesn't work when TrustZone enabled with OEMiROT boot path.

Ivan2307
Associate II

Hello,

I am working on implementing secure firmware with OEMiRoT boot on the STM32H563. I have configured I2C1 and TIM1 as non-secure peripherals. While the TIM1 interrupt works as expected, I am encountering an issue where the I2C1 slave interrupt handler is never entered. (Note: The I2C slave works correctly if TrustZone is disabled.)

I am wondering if the I2C1 slave interrupt handler requires special handling when configured as a non-secure peripheral with TrustZone enabled?

Additionally, if I need to change the start offset and application size for secure and non-secure applications, what changes are required beyond updating flash_layout.h in OEMiROT project?

Any assistance on these issues would be greatly appreciated.

 

Thanks,

Ivan

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello @Ivan2307 ,

I could reproduce your issue.

The reason is related to the usage of both .sh and .bat scripts and on windows we are more used to .bat 🙂

BUT, when you use STM32CubeIDE, only .sh scripts are updated in ROT_Provisioning/OEMiROT

And I used provisioning.bat instead of provisioning.sh like you and fell in same issue.

In fact, in the postbuild of OEMiROT_Boot, you update all needed files to make everything consistent.

The point is that you will update the ob_flash_programming.sh where you can see sec1_end=0x16 which is the good value for last secure flash sector, but ob_flash_programming.bat is not updated.

So, just launch provisioning.sh and it will work.

Best regards

Jocelyn

View solution in original post

6 REPLIES 6
Jocelyn RICARD
ST Employee

Hello @Ivan2307 

I2C interrupt needs to be allocated to non secure. I don't see other reason why you wouldn't get this interrupt.

If you use the OEMiROT as it is, after changing the mapping in flash_layout.h, when building SBSFU_Boot, the linker files of the secure and non secure application will be updated.

Best regards

Jocelyn

 

 

Hello @Jocelyn RICARD 

Thanks for your reply.
As regarding to OEMiROT, I saw the linker files were updated automatically after changing the mapping "in flash_layout.h". If I want to change the secure firmware and non-secure firmware size. How many parameters (Macro) I need to change in flash_layout.h? Looks if just changing "FLASH_S_PARTITION_SIZE" and "FLASH_NS_PARTITION_SIZE", it doesn't work.

Thanks, Ivan

Jocelyn RICARD
ST Employee

Hello @Ivan2307 ,

the tools were made to make it easy so it should work in theory 🙂

What values did you use ? Did you change other settings?

Best regards

Jocelyn

Ivan2307
Associate II

Hello @Jocelyn RICARD ,

Thanks for your reply. I still have question regarding the issue I am facing. I also thought the change should work, but I noticed the VCP port printout is different before and after modifying the 'flash_layout.h' file.

The original firmware VCP port printout is as follows:

Ivan2307_1-1719249106713.png

The VCP port printout after changing the flash layout is as follow:

Ivan2307_2-1719249224271.png

I have also attached the modified firmware for your reference. If possible, could you please help me check it? What other changes I need to make to the flash layout to get it working correctly?

Thank you very much for your assistance.

Regards, Ivan

 

Jocelyn RICARD
ST Employee

Hello @Ivan2307 ,

I could reproduce your issue.

The reason is related to the usage of both .sh and .bat scripts and on windows we are more used to .bat 🙂

BUT, when you use STM32CubeIDE, only .sh scripts are updated in ROT_Provisioning/OEMiROT

And I used provisioning.bat instead of provisioning.sh like you and fell in same issue.

In fact, in the postbuild of OEMiROT_Boot, you update all needed files to make everything consistent.

The point is that you will update the ob_flash_programming.sh where you can see sec1_end=0x16 which is the good value for last secure flash sector, but ob_flash_programming.bat is not updated.

So, just launch provisioning.sh and it will work.

Best regards

Jocelyn

Hello @Jocelyn RICARD ,

Thanks for your help. after updating .bat script, launch provision.bat and it works.

Regards, Ivan