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.

problems with loaded code execution on DSK6416

Other Parts Discussed in Thread: CCSTUDIO

Hi,
I am working with C6416T DSK board and CCStudio 3.1. I want to implement the ability to upload some compiled code into running DSP and then execute it. There is a section called UserCode in L2 RAM at some fixed address. I'm using following procedure:
1. Place function into UserCode section and build my CCS project.
2. Use hex utility hex6x to convert UserCode section from .out into hex file.
3. Modify function in UserCode section.
4. Again build, load and run in DSP.
5. Upload .hex into running DSP on address of UserCode section (uploaded through EMIFA).
6. Execute code in UserCode section.
But my newly loaded code doesn't execute. I can see that the correct machine code was loaded (in memory view, also in disassembly window), but the old code is executed.
Does anyone have any idea, where is the problem?

Thanks.

Tomas

  • Tomas,

     

    Although the DSK has a large SDRAM, your post leads me to believe you have configured L2 as SRAM and not cache.  Confirm that this is so.

     

    Whatever the location of your UserCode section, you need to be sure you're handling the L1P cache correctly. See especially spru656a.pdf, section 2.4 "Self-Modifying Code and L1P Coherence.", page 2-30.  If you are using DSP/BIOS, you may have success calling some of their cache control functions.

    See also sprz216i.pdf (silicon errata), page 7 for a use case that may be similar to your experience.

     

    Best Regards,

    Cameron

     

  • Thank you Cameron,

    yes, I use the whole L2 as SRAM and don't use the SDRAM.

    And invalidating L1P cache helped, now it works.