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.

Clock differ if flash-section is used

Other Parts Discussed in Thread: C2000WARE, TMS320F28069

Hello everybody,

I am quite new in TI µControllers so I try to explain my problem as good as possible.

I have to program an ISR  to get the duty-cycle of an external PWM using an eCAP-Module (Module 2). 

So far, I started using one of the examples of the C2000Ware for the µController TMS320F28069 and it works when I use the linker-command-file "28069_RAM_lnk.cmd"

The next step is to save the program in the Flash-section (and later to copy the code to RAM - but later).

To do this I choose in [Project Settings] --> CSS General --> Linker Command File the file F28069.cmd

Once applied and flashed I saw the duty-cycle was calculated completely wrong.

Because I didn't know where the difference are, I started debugging without success.

Then I inserted at the end of main-function following statements:

for(;;){
 GPIODataRegs.GPBTOGGLE.bit.GPIO40 = 1;
}

The results  were following (measured with an oscilloscope):

Using the file F28069.cmd the pin toggles every ~706ns

Using the file file 28069_RAM_lnk.cmd the pin toggles every ~88ns 

I examined the linker command files but I didn't find anything unusual.

I also compared the SYSCTRL-registers and in both cases they look identical ( except of the clock-counter, of course)

Now, I really don't know what to do next and I'd appreciate any help.



Kind regards,

Elvys

  • Hi Elvys,

    It sounds like portions of the code may not be getting copied from Flash to RAM correctly. I'd suggest reviewing the below application note:

    http://www.ti.com/lit/spra958

    The issue your having may be one of the below:

    1. Adding the memcpy function in main():

    //
    // Copy time critical code and Flash setup code to RAM (such as ISRs)
    // The  RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart
    // symbols are created by the linker.
    //
    memcpy((uint16_t *)&RamfuncsRunStart,(uint16_t *)&RamfuncsLoadStart, 
            (unsigned long)&RamfuncsLoadSize);

    2. including 'F2806x_CodeStartBranch.asm' in your project

    Best,

    Kevin