cancel
Showing results for 
Search instead for 
Did you mean: 

Use External Flash (QSPI) for CubeAI weights

Raggio
Associate III

Hi all,

I would like to ask if there is a suggested procedure to move the network weights, the one generated inside network_data.h, to external memory-mapped QSPI FLASH.

I've already moved both input/output data and activation to external SRAM, but I'm facing with a compile time error when I do the same with weights (initializer element is not constant).

Before start changing things to solve it, maybe someone of you can help!

I've analysed the example FP-AI-VISION1, but it seems to move only input/output data and activations, not weights.

Thank you and kind regards.

1 ACCEPTED SOLUTION
3 REPLIES 3
Raggio
Associate III

Ok, sorry, I've missed the definition at the head of FP-AI-VISION1, network_data.h, file:

#if WEIGHT_QSPI == 1 && WEIGHT_QSPI_PROGED == 0

#if defined ( __ICCARM__ )

#pragma location="ExtQSPIFlashSection"

__root /* force linker to keep variable */

#elif defined ( __CC_ARM ) || ( __GNUC__ )

__attribute__((section(".ExtQSPIFlashSection"), used))

#endif

#endif

I will add the section to the linker file and keep you posted.

If you have any other suggestion I thank you in advance.

Thank you so much for your reply Tesla.

The solution proposed by the FP-AI-VISION1 works very well.