Skip to main content
Visitor II
January 17, 2025
Question

using external flash in command mode while running firmware from it in memory-mapped mode?

  • January 17, 2025
  • 2 replies
  • 551 views

My firmware application is stored in external NOR flash which is memory mapped using XSPI and then loaded by a bootloader. However I also need to interface with the external NOR flash in command mode so I can e.g. store a filesystem there. I can't switch out of memory mapped mode because then my application can't run. How am I meant to get around this dilemma?

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    February 10, 2025

    Hello @roganmorrow and welcome to the community;

     

    Could you give more details about the external NOR flash memory and the STM32MCUs? Is the external memory supporting the multibank feature?

    Are you using the XSPI read-while-write feature and XIP on STM32 MCUs?

     

    Thank you.

    Kaouthar

     

     

     

    Graduate II
    February 10, 2025

    >>How am I meant to get around this dilemma?

    Going to be awkward.

    You could make some hard choices.

    You can HAL_QSPI_Abort() out of memory mapped mode, but then you'd need to prevent other code from accessing and running from the external memory during that period. Watch for interrupts and threaded execution. Probably not ideal going out-to-lunch for 10's or 100's of milliseconds.

    Put read-only portion of the file system on the NOR Flash? Use a RAM-DISK for volatile stuff.

    You could put your file system on a more suitable memory like an eMMC, or use another NOR Flash on a SPI bus.