cancel
Showing results for 
Search instead for 
Did you mean: 

XSPI2 stays BUSY after FSBL boot on STM32N6

Konstantina
Associate

I’m using the NUCLEO-N657X0-Q board and I'm creating a custom NN project using lwIP (that has the necessary weights stored at 0x7100 0000 - external Flash) and I'm trying to make it run when booting from Flash.
I am currently using the “Template_FSBL_LRUN” example from STM32Cube_FW_N6_V1.2.0 as my first-stage bootloader. The FSBL correctly copies my main application from external Flash (mapped at 0x7010 0000) into internal RAM and then jumps to it. But then I noticed my app crashed when including parts of the code related to lwIP or the NN and after reading some XSPI2 registers I saw that the SR register had a value of 0x 0000 3C20 when entering my application which means the XSPI2 is already busy and its FIFO is full, so every fetch hangs.
When trying to debug to see when the XSPI2 gets busy I noticed it was after this line in stm32_boot_lrun.c:
source = (uint8_t*)(MapAddress + EXTMEM_LRUN_SOURCE_ADDRESS);
Also when running the application straight from the STM32CubeIDE I noticed that the SR was 0x0000 0000 and everything is working as expected with my project.
Moreover when running my main application from STM32CubeIDE the register DCR1 has a value of 0x011A0100 which means the DEVSIZE is almost equal to 134.21 MB but when I run my main application after loading it in external flash and using the FSBL to run it I see that the register DCR1 has a value of 0x01190100 which means the DEVSIZE is almost equal to 67.1 MB.

What are the steps I should take to fix my issue regarding the XSPI2?

0 REPLIES 0