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.

MSPM0L1306: Confused about flastCTL driverlib API that have a 'from RAM' variant

Part Number: MSPM0L1306

Hello there

I have two questions for FlashCTL driverlib for the MSPM0130x. Here they are:

  1. I am confused about the use case for DL_FlashCTL_eraseMemory vs DL_FlashCTL_eraseMemoryFromRAM . Does the later presume that the content/value at the address specified is an executable piece of code? If yes then why is it not mentioned anywhere even though it may be obvious?
  2. The multi write example in CCS selects a hard coded address which is not a good practice. It makes more sense to define a memory section as part of the linker cmd file. How do I use that in C code? Do you have a simple enough example that does that aka creates a separate section and then uses that with FlashCTL APIs?

Keen to hear

  • Hi Aj,

    The difference between DL_FlashCTL_eraseMemory and DL_FlashCTL_eraseMemoryFromRAM is DL_FlashCTL_executeCommandFromRAM.

    DL_FlashCTL_executeCommandFromRAM is to run the FlashCTL command in RAM rather than read the code from flash. It can avoid read FLASH and write/erase FLASH at the same time.

    Thanks,

    Yuhao

  • Thank you for your answer Yuhao. I still need some clarification. Would appreciate you answering inline:

    1. What does 'executing from RAM' mean? I suppose it means a 'read-modify-write' sequence but would like you to confirm if that is so.
    2. Secondly, how would 'Read-verify' and 'Blank-verify' differ vis-a-vis executing from the RAM vs the Flash?
    3. Lastly, considering that we are talking flash here with limited erase cycles, what would then be the use case for the non-RAM versions of these APIs?

    Keen to hear from you soon

  • Hi Aj,

    • DL_FlashCTL_executeCommandFromRAM is defined by RAMFUNC, which means it is defined in RAM. So the code will run from RAM rather than FLASH.
    • There is no difference between executing from the RAM vs the Flash.
    • Currently only the API with RAM version is recommended. Not running in RAM may cause the CPU to stuck.

    Thanks,

    Yuhao

  • So as per TI's recommendation, executing from RAM is the way to go. Noted. Thank you!

    Lastly, does TI have an simple example which creates a new memory section in flash and then references it somewhere in the code?

  • Hi Aj,

    No, i don't think there is such example. But actually the .cmd file is easy to modify.

    There are some examples which modify the .cmd, for example secondary_bsl_uart_LP_MSPM0L1306_nortos_ticlang

    With the memory allocation, you can observe the flash section. 

    Thanks,

    Yuhao