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.

TMDSCNCD28379D: System behaves differently with code run in RAM and FLASH

Part Number: TMDSCNCD28379D
Other Parts Discussed in Thread: C2000WARE

Hello,

I am using the TMDSCNCD28379D control card to control my converter and found the system would behave differently with the code running in RAM and FLASH.

When I was running the code in RAM using CCS8, the system would work very well. The system works under both rated input voltage and half rated input voltage conditions.

When I was running the code in FLASH using CCS8, the system control loop would run away at half rated input voltage.

When I was running the code in FLASH using CCS10, the system works at half rated input voltage. But the system control loop would run away at rated input voltage.

My guess is that there might be some project configuration difference that caused this problem. But I checked project configuration of each project, no much difference is found.

Part of the project files are put in the attachments. Pictures of my control card used for test is also shown.  When I runs the code from FLASH,SW1 on card is switched to mode 03. When I runs code from RAM, the SW1 is switched to mode  01.

Could you please help me figure out the problem? Thanks

     

RAM_ccs8.zipFLASH_ccs8.zipFLASH_ccs10.zip

  • Thanks for reaching out to the E2E forum.

    One thing to keep in mind is that code in the flash will have a slower execution speed vs RAM.  This is due to the access time of the flash having max 50MHz access time.  There is a function in SysCtrl.c that will set the flash WS according to the device speed that is defined, for instance if you are running at 200MHz CPU clock then it will set the waitstates = 3. 

    All this to say that you may need to copy the most time critical pieces of your code back into RAM from Flash to get true 200MHz.  A good place to start is to map all your control related ISRs into RAM and see if that resolves the issue.  You may need to try different sections out to see where the gap is vs a pure RAM implementation.

    Most of the projects in C2000Ware have a RAM or Flash build config.  You can look at these to find the memcpy function in use as well as how to structure your linker file to load to flash but run from RAM.

    Best,

    Matthew

  • Qingxuan,

    Adding to the details that Matt mentioned above:

    1. You might have noticed the flash initialization routine in InitSysCtrl().  Please make sure it is not commented out in your application.  That function enables prefetch and data cache - this helps to improve performance for the linear code considerably given the extra wait states involved for flash access.

    2. Also, please take a look at this FAQ post:  https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/878674 

    Thanks and regards,
    Vamsi