Skip to main content
Raggio
Associate III
April 11, 2022
Solved

Use External Flash (QSPI) for CubeAI weights

  • April 11, 2022
  • 2 replies
  • 1621 views

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.

    This topic has been closed for replies.

    2 replies

    Raggio
    RaggioAuthor
    Associate III
    April 11, 2022

    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.

    Raggio
    RaggioAuthor
    Associate III
    April 13, 2022

    Thank you so much for your reply Tesla.

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