cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 boot application >64kB from external QSPI

northh_sven
Associate II

Hi,

I'm adapting the NUCLEO-N657X0-Q template "Template_FSBL_LRUN" to boot a tested application from the QSPI

Unfourtunately, as soon as the binary becomes larger than 64kB and uses a second sector, the application will not boot anymore.
I can reproduce this by adding a large printf statement to push the binary over the 64kB boundary or by changing the optimization level to either favor binary size or speed and thereby affecting the binary size.

What am I missing?

Thanks in advance for every advice!

1 ACCEPTED SOLUTION

Accepted Solutions
northh_sven
Associate II

Ok, so I solved it.
In the file "/FSBL/Inc/stm32_extmem_conf.h", there is a preprocessor directive "EXTMEM_LRUN_SOURCE_SIZE" that needs to be manually adjusted.

 

This really feels like something that should be clearly stated in the template's readme. Especially when the header of the application already contains the size of it at a fixed offset. Hence it could easily be read by the FSBL.

View solution in original post

2 REPLIES 2
northh_sven
Associate II

Ok, so I solved it.
In the file "/FSBL/Inc/stm32_extmem_conf.h", there is a preprocessor directive "EXTMEM_LRUN_SOURCE_SIZE" that needs to be manually adjusted.

 

This really feels like something that should be clearly stated in the template's readme. Especially when the header of the application already contains the size of it at a fixed offset. Hence it could easily be read by the FSBL.

Hello @northh_sven 

In the context of executing the Template_FSBL_LRUN example, it is the BootROM that is responsible for copying the binary that is in the external XSPI Flash, into the AXISRAM2, then the BootROM jumps to start the code at address 0x34180400 (refer to the linker file "Template_FSBL_LRUN\STM32CubeIDE\Boot\STM32N657XX_AXISRAM2_fsbl.ld").

Consequently, you have  an AXISRAM2 memory size of 511KB.
Indeed, I confirm that the #define EXTMEM_LRUN_SOURCE_SIZE is limiting this size to 64KB, and the user should be able to be extended it for his application.

I hope it clarify your question?

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.