STM32U5A5 Jump to Bootloader from ThreadX Application with TrustZone enabled
I'm currently using a NUCEO-U5A5ZJ-Q development board and having an issue jumping from the Application code into the Bootloader. Two major issues are the Application is running ThreadX, and the board has the TrustZone enabled.
Through experimentation, I've determined how to successfully jump into the bootloader when the TrustZone is disabled. Effectively, the code to jump into the bootloader must be done BEFORE executing the "MX_ThreadX_Init( )" instruction in main.c. Any attempt to jump into the bootloader after the MX_ThreadX_Init call results in a HardFault during the execution (initialization?) of the bootloader code.
However, now with the TrustZone enabled, I have been unsuccessful at bringing up the bootloader code without a HardFault being generated. The jump into the System Memory bootloader at 0x0BF90000 is successful, but always results in a HardFault due to trying to access a NULL value during the execution (initialization?) of the bootloader code.
Is there any advice you can give me to on how to get this to work?
Some questions I have:
- does the application code that contains the bootloader jump instructions need to be in the secure section, nonsecure section, or a mix of both?
- are there additional processor registers that must be initialized before the jump?
- are there any special settings needed in either the Option Bytes or the STM32CubeMX configuration?
Thank you!
Steve.
-
