This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0L1117: Inquiry Regarding Flash Memory Operations and Execution Strategies

Part Number: MSPM0L1117

Hello Team,

I am writing to seek clarification regarding best practices for flash memory operations. Currently, our system is configured with both data and code residing within the same flash bank.

Based on our review of the SDK, we have noted two primary methods for function execution: execution from RAM and execution directly from Flash. To ensure the stability and performance of our implementation, we would appreciate your guidance on the following points:

  • Necessity of RAM Execution: Under our current configuration, is it mandatory to relocate flash-management functions to RAM?

  • Flash Execution Feasibility: Is it permissible to execute these functions directly from Flash while operations are in progress?

  • Side Effects: Are there known risks or side effects—such as CPU stalls, read-while-write (RWW) violations, or bus contention—associated with these methods?

  • Use Case Criteria: Could you define the specific scenarios in which execution from RAM is required versus those where execution from Flash is sufficient?

  • Technical Recommendations: Based on your experience with this SDK and hardware architecture, what is your recommended approach for our specific setup?

Thank you for your time and professional insights.

Best regards,

Kostadin

  • Hi Kostadin,

    Let me consult with my team about these questions. In the meantime, how big is your project size, and exactly is your setup referring to, is it how you allocate the project in the device's memory?

    Best Regards,

    Diego Abad

  • Hello Diego,

    We are planning to use both banks for data and code.

    We are wondering, if it is mandatory to execute flash erase or flash write from RAM or they can be execute simply from flash.

    Regards,

    Kostadin

  • Hi Kostadin,
    Thank you for your patience. 

    It is not mandatory to relocate flash management functions to RAM, but it is recommended to do so. Given that if you are trying to execute a piece of code to perform a flash erase/write on the same flash bank, you might end up erasing your own code. Additionally, the FLS (Flash) interrupt functionality cannot be used when you are trying to erase from the same flash bank." 2. "Yes, it is possible to execute functions from flash as well.

    It is possible to execute functions from flash as well.

    The CPU gets stalled until the FLS operation finishes when you are trying to erase from the same flash bank. Therefore, the interrupt feature in FLS does not help/work in this case. However, if you are trying to execute a flash operation from one bank to erase/write on another flash bank, this would not be an issue.

    It is always recommended to execute flash erase or flash write from RAM in order to avoid unintended execution flows.

    Best Regards,

    Diego Abad