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.

[FAQ] F05 Flash: How can I speed-up execution of code running from Flash memory?

Q: I have just ported my code from internal RAM to internal flash. The execution is much slower from flash. Why is this occurring? How can I speed-up performance of code running from Flash memory?

  • A:

    Note: This answer applies to devices with F05 flash.  Refer to:  [FAQ] F05 Flash: Which C2000 devices have "F05 flash"?

    The flash hardware requires wait-states for proper code execution. As a result performance compared to zero wait-state RAM will be slower. Time critical code can be copied from flash to RAM at run-time for a performance boost. There are two methodologies for this.

    1. The first and the most commonly used approach is copying time critical functions upon entering the application code. This method is described in the Running an Application from Internal Flash Memory (SPRA958) Application Note.
    2. The second approach is to copy the complete compiler sections (.text, .cinit, etc) to RAM at boot time before entering the application code. This is intended for smaller application code. This method is described in the Copying Compiler Sections From Flash to RAM on the TMS320F28xxx DSCs (SPRAAU8) Application Note.


    In addition, check your code to make sure the flash wait-states are initialized properly and the prefech buffer is enabled. Refer to  Running an Application from Flash (spra958) and examples related to flash in: C2000Ware_<version>\device_support\f<device>\docs\

    For more F05 related FAQs refer to [FAQ] F05 Flash: Frequently Asked Questions