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.

TMS320F280039C: When I use the flash_cmd file, the time of the delay_us() function increases.

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi, TI engineers,
When I used the ram_ink.cmd file to test the time of the delay_us() function, the time matched. When I use the flash_ink.cmd file, the measured time is larger than the set value. But I saw the CMD file lieutenant General. The TI.ramfunc segment runs at RAMLS3S7 and also runs by copying the Flash code to RAM via memcpy(&RamfuncsRunStart,&RamfuncsLoadStart,(size_t)&RamfuncsLoadSize). But judging from the running results, it is not running in RAM. Is there anything else I need to configure?

  • Part Number: TMS320F280039C

    Tool/software:

    Hi, TI engineers,
    When I used the ram_ink.cmd file to test the time of the delay_us() function, the time matched. When I use the flash_ink.cmd file, the measured time is larger than the set value. But I saw the CMD file lieutenant General. The TI.ramfunc segment runs at RAMLS3S7 and also runs by copying the Flash code to RAM via memcpy(&RamfuncsRunStart,&RamfuncsLoadStart,(size_t)&RamfuncsLoadSize). But judging from the running results, it is not running in RAM. Is there anything else I need to configure?

  • Hi Zhen,

    Thanks for your patience during the holidays. I'm taking a look at your forum post and will get back to you with more information shortly.

    Regards,

    Ozino

  • Hi Zhen,

    Can you confirm if you mapped DELAY_US() to .TI.ramfunc section; and map this section to flash address for load and RAM address for run in linker cmd?

    Please refer to this post on how to properly setup the delay_us() function: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/942115/tms320f28069-problem-with-delay_us

    Regards,

    Ozino

  • Hi Ozino,

    Thank you for your reply. First of all, I have the following definition of the SysCtl_delay function in the sysctl.c file, I think I should define the function in. TI.ramfunc segment.

    Then I checked the CMD file, which is defined as follows, the memcpy() function is added to the program and _FLASH is defined.

    Finally, I see in the.map file. The load address of TI.ramfunc is 0x826f0 and the run address is 0xe000. But SysCtl_delay runs at 0x826d7, and it is not in. TI.ramfunc segment. Is the problem that SysCtl_delay is not defined in. In the TI.ramfunc section? Because I don't understand the definition of the macro in Figure 1, do I need a different identifier?

  • Hi Zhen,

    Can you confirm if you are project is using an EABI output format. You can see if the predefined symbol for _TI_EABI in the project properties under the compiler section.

    Additionally, please confirm if you have switched use to the SysCtl_delay macro instead of the delay_us() function.

    Regards,

    Ozino

  • Hi Ozino,

    I see Output format: eabi(ELF) from the CCS General attribute, but I don't see _TI_EABI defined on this Predefined Symbols. However, I see from the compiler manual that if --abi=eabi is used, __TI_EABI__ is 1. In the program, I use the DEVICE_DELAY_US() macro definition.

    Regards,

    Zhen

  • Hi Zhen,

    Can you import the led blinky example and perform your timing test for both FLASH and RAM build configurations? Please let me know what the results look like. Thanks!

    Regards,

    Ozino

  • Hi Ozino,

    Sorry for replying so late because I didn't see the message reminder. I imported the led_ex1_blinky project and changed the delay time parameter to 5000. When I use 28003x_generic_ram_Ink.cmd, I get the following waveform with a delay time of 5ms, which is correct. When I used 28003x_generic_flash_Ink.cmd and changed the predefined parameter RAM to _FLASH, I got the same waveform with 5ms delay.

  • Hi Zhen,

    It looks like you are able to see the desired delay for the examples in C2000Ware. Can you confirm if you have modified the clock for your example? Any chance you could use the same linker command file in the example as part of your code? Or can you apply your code changes on top of of this example.

    Regards,

    Ozino