STM32U5 - GPIO_IOToggle_TrustZone example gets stuck in HardFault-handler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-08-23 3:16 AM
I followed the GPIO_IOToggle_TrustZone Example for STM32U5, which is documented in UM2883 (STM32CubeU5GettingStarted.pdf; section 5.1.1).
The development board used is a NUCLEO-U575ZI-Q.
Details:
- I've set the TZEN-Bit in FLASH_OPTR using STM32CubeProg successfully
- Used STM32CubeIDE to import existing project (%USERPROFILE%\STM32Cube\Repository\STM32Cube_FW_U5_V1.0.0\Projects\NUCLEO-U575ZI-Q\Examples\GPIO\GPIO_IOToggle_TrustZone) from filesystem into default workspace (%USERPROFILE%\STM32CubeIDE\workspace_1.7.0)
- sticked to the guide in UM2883:
- Open the STM32CubeIDE toolchain
- Open Multi-projects workspace file .project
- Rebuild xxxxx_Secure project
- Rebuild xxxxx_NonSecure project
- Launch Debug as STM32 Cortex-M C/C++ Application for the secure project.
- In the Edit configuration window, select the Startup panel, and add load image and symbols of the non-secure project.
- Be careful, the non-secure project has to be loaded before the secure project.
- Then click "OK"
- Run the example on debug perspective.
When I set a breakpoint in HAL_SYSTICK_Callback (where the LED is toggelt) this breakpoint is never hit. Instead, when initialization is done, the HardFault_Handler() in %USERPROFILE%\STM32Cube\Repository\STM32Cube_FW_U5_V1.0.0\Projects\NUCLEO-U575ZI-Q\Examples\GPIO\GPIO_IOToggle_TrustZone\Secure\Src is entered.
All steps were checked by one of my colleagues, so my last hope is this expert forum here.
- Labels:
-
STM32Cube MCU Packages
-
STM32U5 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-08-24 3:52 AM
Hello @SReic.1 ,
Welcome to STM32 Community!
I recommend you to have a look to readme file under STM32Cube directory:
STM32Cube\Repository\ STM32Cube_FW_U5_V1.0.0/Projects/B-U585I-IOT02A/Examples/GPIO/GPIO_IOToggle_TrustZone/readme.html
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-08-25 12:01 AM
Hi Imen,
Thank you. In the meantime I have found my mistake. It was that I forgot to set the values for SECWM[1-2]_PSTRT and SECWM[1-2]_PEND with STM32CubeProgrammer.
I sticked to STM32Cube_FW_U5_V1.0.0\Projects\NUCLEO-U575ZI-Q\Examples\GPIO\GPIO_IOToggle_TrustZone\Readme.html.
Stephan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-08-25 2:28 AM
Hello @SReic.1 ,
Really glad to know you overcame your problem
Thank you.
Imen
