2025-10-13 3:17 AM
Hello everyone,
I am working with the STM32N6570-DK discovery kit and I have encountered a strange behavior that I cannot explain.
When I use the ST-provided example projects that include both an FSBL (First Stage Boot Loader) and an Application image — for example:
Template_LRUN
Template_FSBL_XIP
JPEG_EncodingFromOSPI_DMA
they fail to run correctly on my STM32N6570-DK boards.
However, the exact same projects (same binaries, same flashing procedure) work perfectly on another identical STM32N6570-DK board (I was able to test the same projects on another STM32N6570-DK discovery kit provided by a friend).
Interestingly, simpler examples that only contain an FSBL project (for example GPIO_IOToggle) work fine on my board.
Before testing the ST-provided examples, I had tried to debug my own application on the same board.
During debugging, my code ended up in a HardFault error, and since then, it seems that any project which includes both an FSBL and an Application can no longer run properly on this board.
This makes me wonder whether something in the memory configuration might have been altered or locked after the crash — preventing the Application stage from being correctly loaded or executed.
I would like to understand what could cause this behavior and how to restore the board so that FSBL + Application projects can run again normally.
Any advice or diagnostic steps would be greatly appreciated.
Thank you in advance!
2025-10-13 6:25 AM
Hello @Pfaa, and welcome to ST community!
Have you checked the BOOT0 and BOOT1 switches on your board? Since your board was able to run FSBL examples, it means developer mode is set with BOOT1 set to HIGH. Try setting both BOOT1 and BOOT0 to LOW to enable booting from FLASH.
Best regards,
2025-10-13 7:22 AM
Hello @STackPointer64, and thank you for your reply!
So I tried to debug it and followed this tutorial: How to debug STM32N6 using STM32CubeIDE - STMicroelectronics Community and as I said it doesn't work with my board but with the other one it did. There I have BOOT1 set to high. Now I tried booting from FLASH with both switches set to LOW. But it did not work. I also used the Template_FSBL_XIP.
Best regards,
2025-10-13 7:43 AM
I see. Could you specify the error messages you see when trying to run the application? Also, during your latest successful debugging session, did you program any option bytes? To resolve this, try connecting to your board using STM32CubeProgrammer, select the OB tab from the left bar, click the arrow next to Read, and choose Reset MCU to factory settings.
2025-10-13 9:14 AM
So when I debug it and let it run, I jump to the HardFault_Handler(). The Fault Analyzer looks like this:
Unfortunately under the OB tab I can not find the option Reset MCU to factory settings. It looks like this:
And as far as I know, I didn't program any option bytes, at least I didn't do it on purpose.
2025-10-13 10:32 AM
Could you export your OTP configuration and attach it to the thread?
Could you also answer the following questions?
2025-10-13 10:49 AM
2025-10-16 4:36 AM
Hello @Pfaa,
Thank you for your patience. That is unusual. Could you please attach the project that failed to execute and caused the hard fault? I understand it is the example provided by ST, but I am interested in any changes made to the environment by STM32CubeIDE. Debugging crashes may leave the debugger in an inconsistent state or corrupt the CubeIDE workspace metadata. Meanwhile, I suggest downloading a fresh firmware project and running it in a new workspace in CubeIDE.
Best regards,
2025-10-16 8:23 AM
Hello @STackPointer64 ,
Sure, thank you for your efforts. I exported the whole folder with the project and attach it here. I hope that's what you meant.
Also while following your suggestions, I noticed some strange behaviour I can not explain.
I removed the firmware version V1.2.0 and installed it new, and I also used a new workspace and tried to debug the project Template_FSBL_XIP and it did not work. When I started debbuging the first breakpoint is at BOOT_Application (like in the tutorial How to debug STM32N6 using STM32CubeIDE - STMicroelectronics Community). Then I wanted to run the code, clicked resume and lost the connection to the board.
Then I used the firmware version V1.1.1 and also tried to debug the project Template_FSBL_XIP and this time it worked and the LED was blinking.
I have no idea why this the case, maybe you have an idea...
Best regards,
2025-10-18 3:42 AM
Hello @Pfaa
There are no Option bytes on the STM32N6, only OTPs (One-Time Programmable bits). And I have checked the list of OTPs you sent, and it seems correct to me.
I understand your issue is that on a single board, you cannot debug a project in DEV_BOOT (BOOT1=1) nor execute it in FlashBoot (from flash memory).
Can you confirm the following points:
In DEV_BOOT, after a reset, is LED2 (red) is on?
Please find below the images you need to check:
Best regards
Romain
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.