2025-04-30 11:48 AM
Currently, I have a project using a secure application for the STM32N6570-DK. I am able to run and debug the FSBL and Application with the system in Dev Boot, but have yet to be able to attach and debug when booting from the external flash (Boot1 and Boot0 both LOW).
I have placed the following code toward the beginning of my FSBL, and configured my STM32CubeIDE debug to not load the program, and the not reset the chip when attaching for debug. However, I am still unable to attach and debug the system.
__HAL_RCC_BSEC_CLK_ENABLE();
BSEC->AP_UNLOCK = 0xB4;
BSEC->DBGCR = 0xB4B4B400;
__asm("bkpt 255");
Has anyone been able to debug their application with the MCU booting from external flash?
2025-05-02 2:17 AM
Hi @aroby95 ,
Probably you find some help in the article How to create an STM32N6 FSBL load and run (focus on second application case).
-Amel
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.
2025-05-02 1:27 PM
Hi aroby95
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
Regards
Joe
STMicro Support
2025-06-03 5:34 AM
Hello @aroby95 @Joe WILLIAMS ,
I’m experiencing the same issue. I wonder what the solution is?
Best regards,
Egemen Aksoy
2025-06-07 10:30 PM - edited 2025-06-07 10:30 PM
Hi,
I use the following approach for the XIP configuration.
The FSBL is without changes.
In the Appli code, in main.c, add code as shown below. Make sure that the debugger does load symbols from Aplpli ELF only, and does not download the firmware, and does not reset the chip (see the pics below).
Now you can power up (or reset) the board after flashing, run the Appli debug, set breakpoints and press the USER1 button to debug.
BSP_PB_Init (BUTTON_USER1, BUTTON_MODE_GPIO);
// loop that can be used to catch the application for debug.Set mini to 1, build and flash target as normally.
// Set BOOT1 switch to the left position, press reset without removing cable.
// Use the Connect to running debug config to connect, then change mini value from watch.
// For breakpoints to work they seem to need to be manually changed to ahrdware breakpoint
static volatile int debugFlag = 1;
while (debugFlag == 1 && BSP_PB_GetState(BUTTON_USER1) == 0)
{
__NOP();
}
/* USER CODE END 1 */