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.

RM48HDK delay function?

Other Parts Discussed in Thread: TMDSRM48HDK

Is there a delay function for the Hercules Safety processors?

I've found references to __delay_cycles(), but I haven't been able to find it in any of the headers that i have for my installation.  For reference I am using a TMDSRM48HDK, with Code Composer Studio  Version: 5.3.0.00083.

I would expect some sort of delayms/delayus/delayXX function.  This is what I've found with other development environment/compilers.  Hopefully I'm just missing it.

Thank you!

  • Terry,

    There is a __delay_cycles() intrinsic in our code generation tools.

    I did a try with release V5.2.5 and it compiles fine.

    There are some limitation using this intrinsic as explains in the compiler readme file.

    ===================================================================

    The __delay_cycles intrinsic inserts code to consume precisely the number of
    specified cycles with no side effects.  The number of cycles delayed must be
    a compile-time constant.

    NOTE: Cycle timing data is based on 0 wait states.  Results will vary with
    additional wait states. The implementation does not account for dynamic
    prediction.  Lower delay cycle counts may be less accurate given pipeline
    flush behaviors.

    ===================================================================

    Your code will very certainly run from Flash, and depending on the CPU frequency, waitstate are necessary to execute from Flash.
    Also the Cortex R4F includes a Branch Prediction Unit that may change the execution time of a loop.

    Please let me know if this could be a starting point to solve your problem.

  • In the interim I did try to use the __delay_cycles() function, but I am getting the following warning:

    "../source/sys_main.c", line 170: warning #225-D: function declared implicitly

    This then results in the following errors while linking, and the project does not build successfully...
    ---------------------------------------------------------------------------------------------------------
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    __delay_cycles ./source/sys_main.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "XXXXXXX.out" not built
    ---------------------------------------------------------------------------------------------------------

    Is there an include that needs to be added to allow for __delay_cycles() to link properly? Or am I possibly missing an include path for the project?

    Thank you!
  • Terry,

    Which compiler version are you using?
    In my case it is V5.2.5

    This intrinsic is supported since V5.2.x

  • I'm not positive how to check it, but I'm assuming from the paths used, that it is version 5.0.1.

    "C:/ti/ccsv5/tools/compiler/arm_5.0.1/bin/armcl" -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -me -Ooff -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.1/include"
  • You can find the compiler version by checking the project properties, CCS General tab Advanced Settings.

    To update the compiler, you can do that within CCS in Help, Install New Software.
    In the work with field, select Code Generation Tools Updates. Than a list of available updates will be shown.
    Pickup the latest one.
  • It was version 5.0.1... I updated to version 5.2.5. It is much happier now. It compiles as I would expect. So, I'm guessing that __delay_cycles() got added somewhere between those 2 versions. I'll have to dig around to see what other goodies showed up too.

    Thank you!