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.

TMS320F28377D: TMS320F28377D

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE

Hi.
I write the C2000 project, running on TMS320F2837xD. The project was developed from blinky_cpu1 example.  I run the program via JTAG from RAM, measure duration of calculations and then change configuration to FLASH, because the application finally will be run from FLASH. The duration takes much more time (6-8 times more!) I looked for the information how to load to FLASH and run from RAM and was confused. I have several questions:
1. Can I change the project to the DSP/BIOS configuration? May be it will be the easiest way to solve the problem?
2. In order to copy functions to the section "ramfuncs" what exactly should I do? In the linker command file or/and in the code. I use 2837xD_FLASH_lnk_cpu1.cmd file. My code is written in C/C++.
3. If functions call other functions, all of them should be moved to RAM or linker will do it automatically?
4. I need examples which matching to my microcontroller TMS320F2837xD.
Thanks.

  • Hi Gregory,

    Moving code to Flash should not make code execution 6-8 times slower. It look like that flash has not been setup properly in your case and it is still running with default wait states. We have all examples in controlSUITE with build configuration "FLASH" so you can refer them. Import the example from controlSUITE in CCS and change the build configuration to FLASH and then check the project settings. Also you don't have to copy all the functions from Flash to RAM. Only flash initialization need to be copied from Flash and it is taken care in InitSysCtrl function (like below) -

    --------

    #ifdef _FLASH
    //
    // Copy time critical code and Flash setup code to RAM. This includes the
    // following functions: InitFlash()
    //
    // The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
    // symbols are created by the linker. Refer to the device .cmd file.
    //
    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    //
    // Call Flash Initialization to setup flash waitstates. This function must
    // reside in RAM.
    //
    InitFlash();
    #endif

    -----

    But you need to have "_FLASH" pre defined in your project for this to run which I think may be missing in your project.

    Regards,

    Vivek Singh

  • Thank you very much Vivek Singh. I added "_FLASH" as a predefined symbol and this solved my problem.

    Maybe you can help with another problem? I still not sutisfied with the thruput. Running while(i++<1000) in RAM takes more then 1 msec.

  • Can you tell the number of cycles. Also how many instructions you see in assembly this line of code ?

    Vivek Singh
  • Hi Vivek.

    Sorry for delay.

    The code in C:  while(i++<100); It is 4 lines in assembly takes more than 100 micro.

            C$L17:

    00c28a:   9249        MOV          AL, *-SP[9]
    00c28b:   0A49        INC          *-SP[9]
    00c28c:   5264        CMPB         AL, #0x64
    00c28d:   64FD        SB           C$L17, LT

    Thanks, Gregory.

  • Gregory, as asked in earlier post, please tell the number of CPU cycles for execution of the loop.
  • Vivek, I do not know how many CPU cycles takes the loop but in assembly this line of code (while(i++<100)) takes exactly 4 instructions: MOV, INC, CMPB, SB. If each instruction takes 1 cycle it should be 4 cycles. The system clock is 200 MHz. I measure 1 microsecond per loop. Something is wrong.

    00c28a: 9249 MOV AL, *-SP[9]
    00c28b: 0A49 INC *-SP[9]
    00c28c: 5264 CMPB AL, #0x64
    00c28d: 64FD SB C$L17, LT
  • Hi Gregory,

    Sorry for late reply. Have you checked that there is no interrupt happening while executing this code? Also when you step through the code, how many cycles you see for each instruction?

    Vivek Singh