cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U585 TZEN Program Error when reset command is used

PJose.4
Senior

Hi @channel

I am using the B-U585-IOT2A board based on STM32U585 and am configuring TZEN and checking some sample programs. i am not able to reset the board either through the push button or through the software code "NVIC_System_Reset()" and when debugging am getting a break error as shown below:

PJose4_0-1690804143370.png

The debgug console is returning the error:

PJose4_1-1690804228703.png

On searching the community i found that there is some error in the memory configuration of the secure and non secure area. the linker script i have used is the default one that stmcube mx has generated. the option byte i have used is as below:

PJose4_2-1690804321549.png

PJose4_3-1690804334101.png

The issue is i can run my program only once(functionality works) but neither am i able to reset or run the program again while debugging again.
please assist me in solving the issue.

Awaiting support in this regard

Thanks and Regards
Philip Jose

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Pierre_Paris 
Thanks for your update

At last was able to find the solution. The problem was the address configured in the NSBOOTADDRESS0. There was a wrong value given. I modified the values to the following:

PJose4_0-1690892673753.png

Now that issue is solved.(SRAM_RST is checked) that was unchecked while testing the TF-M SBSFU Application.
Now i am able to reset the board and is able to debug multiple times. Now the example code and my code is working fine.

Thanks for your valuable support
Philip Jose

View solution in original post

5 REPLIES 5
Pierre_Paris
ST Employee

Hello Philip Jose @PJose.4 ,

Thank you for your question, I have listed some points / questions :

  • Are you sure about the start and end address of secure area 2 ?
  • What is your boot configuration and your OB values ?
  • Can you also please share the linker file ?
  • Can you tell me a bit more about your application ? Are you performing illegal access in your application ? (Check the TZIC registers...)

Best Regards, 
Pierre

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.

PJose.4
Senior

Hello @Pierre_Paris 
Thanks for your update

I am trying one basic TF-M implementation with the following functionality:

1. Secure Peripheral - LED, UART

2. Non Secure Peripheral - LED

3. Secure to Non secure control - Non secure LED control from Secure Code

4. Non Secure to secure (SG ) - Access secure UART from Non secure code

Following is my option byte configuration(boot Configuration)

PJose4_0-1690865141170.png

User Configuration Option Bytes

PJose4_1-1690865190147.pngPJose4_2-1690865206895.png

PJose4_3-1690865216357.png

I am attaching the Linker script for both secure and non secure code.

I have changed the secwm2 option byte value like SECWM2_PSTRT>SECWM2_PEND from information got from the community(Sorry not able to recollect exact reference)
I tested the GPIO_Toggle_TZen code from STM32U5 package with the above configuration.
Please let me know for any other information that is required from my side.
Thanks

PJose.4
Senior

@Pierre_Paris 
Attaching the secure and non secure code RAM linker script also.

I have checked the GTZC TZIC values as well. The values are 0. the values are disabled.

PJose4_0-1690875078265.png

I have used the reference code from Stm32 firmware package- official release 

en.stm32cubeu5-v1-2-0\STM32Cube_FW_U5_V1.2.0\Projects\B-U585I-IOT02A\Examples\GPIO\GPIO_IOToggle_TrustZone.

The cube MX project also i have just enabled the TZEN bit and not made any changes to the configuration(from the reference code GPIO_IOToggle_TrustZone). Is there any other configuration that i have to do?


Thanks

Pierre_Paris
ST Employee

Hello @PJose.4 ,

As the Embedded flash memory (FLASH) chapter of the Reference Manual describe :

PierrePARIS_1-1690878450040.png

  • All your configuration seems correct but why did you uncheck SRAM2_RST ? The RAM_NSC is stored in SRAM2. That can be a part of the problem.
  • Can you zip me your project please ?
  • You are using the example firmware but did the code run correctly ?

Best Regards,

Pierre

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.

Hi @Pierre_Paris 
Thanks for your update

At last was able to find the solution. The problem was the address configured in the NSBOOTADDRESS0. There was a wrong value given. I modified the values to the following:

PJose4_0-1690892673753.png

Now that issue is solved.(SRAM_RST is checked) that was unchecked while testing the TF-M SBSFU Application.
Now i am able to reset the board and is able to debug multiple times. Now the example code and my code is working fine.

Thanks for your valuable support
Philip Jose