STM32H503 core enters Lockup state when bootloader "Go" command is used
My board uses the STM32H503KBU6 and I'm using the built-in bootloader with the FDCAN interface, as documented in AN5405.
My firmware application is located at 0x08000000, and I am attempting to use the "Go" command to jump to it while the bootloader is running. This is required for our manufacturing and provisioning processes.
As specified in AN5405, I send a frame with ID 0x021, with DLC 4 and the data bytes containing the address, MSB first. The bootloader sends me two ACK frames as expected.
TX B - 021 [04] 08 00 00 00
RX B - 021 [01] 79
RX B - 021 [01] 79
At this point, all activity stops. The bootloader is not running, and neither is my application.
When I attach a debugger, the debug register tells me the chip is in the Lockup state. This is defined in the Armv8-M architecture reference manual as follows:
Lockup is a PE state where the PE stops executing instructions in response to an error for which escalation to an appropriate HardFault handler is not possible because of the current execution priority. An example is a synchronous exception that escalates to a Secure HardFault, but cannot escalate to a Secure HardFault because a Secure HardFault is already active.
The Armv8-M RM gives some examples of scenarios that can cause this state, but I am currently unable to determine which (if any) apply.
My application, for the purposes of testing this issue, is a barebones application generated by CubeMX; it does nothing particularly special. It has the standard init procedures, then blinks an LED in a loop. This application runs absolutely fine upon power-on reset, and pin/pad reset.
My current debugger setup just aborts when the Lockup state is detected - I am currently fixing this issue, then hopefully I can provide register dumps, backtraces, etc.
In the meantime, if anyone has any advice I would greatly appreciate it!
Adding some tags: H5, H503, STM32H503, STM32H503KB, CAN-FD
