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.

Problems with the fastRTS67x library functions

Hi,guys.... I am using the fastRTS67x library functions in my CCS program. There are some mistakes with the powf function.

As the configuration step in the document with the title TMS320C67x FastRTS Library Programmer's Reference, I have add the fastRTS67x.lib and rts6700.lib in my libraries folders. The command file also contains the linker command to the two libraries as follows: -l fastrts67x.lib, -l rts6700.lib.

In my C program file, I have added the fastrts67x.h as the header file. When compling and linking the program, then a warning message appears:

>> warning: creating output section text without SECTIONS specification

The program without powf function is absolutely right. Meanwhile, the result by the function powf is totaly wrong (e.g.  powf(2.0,2.0) returns 1.6e+00019).  As the fastrts67x reference document, the function with name powsp just acts the same. When the powsp is used alternatively, the program just can't step over the line where the powsp function is.

I don't know what is wrong with my c program or the fastrts67x libray. Any suggestion will be sincerely appreciated~!!

  • Some additional information will be helpful:

    • Versions: CCS, CodeGen, BIOS (if using it)
    • Which DSP are you using?
    • EVM or DSK or your board or simulator (which one)?
    • SPRCnnn - which version did you download for the FastRtsC67x library?

    I was able to duplicate your problem with the C6713 simulator, CCS 3.3 SR12, CGT 6.1.11, sprc060. But is this the same as what you are using? SPRC060 is pretty old, so there could be some unusual incompatibilities. I would not expect this, but I could not figure out what was wrong with the execution.

    The simulator reports some odd execution errors, so this is why I suspect some incompatibilities. But if you are using other target and versions, it may not matter.

    The warning is because the exp functions were assembled with a ".sect text" directive for some reason. This should have been ".text". The linker will put this somewhere with space, and in my case it went into L2 anyway. You can workaround this by adding

    SECTIONS
    {
    text:    >    IRAM
    }

    into your linker command file, using the right region name from your MEMORY part - the same as is used for .text right now.

    With your additional information, we will then need to find someone to examine this more closely.

  • I assume you didn't include <math.h>. This is your problem. Please include that and the issue should disappear. The summary of problem is this. If you don't include math.h, the compiler doesn't see the definition of powf and assumes the arguments are double. Which makes the arguments incorrect and so the result is not correct as well. Note the UG also states this requirement. See section 2.3.2

    >> The math.h header file must be included if you are using the standard run-time-support function names.

    Gagan

  • Some additional information about my developing environment is as follows:

    CCS version; V3.3.54.1

    BIOS version: V5.31.02

    CGT version: V6.0.8

    The fast67x libray function version is SPRC060 as you said.

    The warning message disappers when adding the "text:   > IRAM" section directive.

    but the powsp function just can't work perfectly.

    3x very much~!!

  • 3x for your patient reply~

    Actually in my C program, only powsp and recipsp functions are used. I have added the fastrts67x.h and recip.h header files in my c program so that the Fast RTS special functions could be used.

    As you said in the UG section 2.3.2, there are two ways to use the fast RTS library functions:

    1. The math.h header file must be included if you are using the standard run-time-support function names. (Standard syntax form)

    2. The fastrts67x.h header file must be included if you use the special FastRTS function names. If any of recipf, recipsp, recipdp function is used, the recip.h header file should be also included. (FastRTS form)

    The chapter 4 in the UG docment  has explained clearly how to use the RTS libray function in Standard Syntax form or FastRTS form. So if the header files fastrtx67x.h and recip.h are included in my c program file, the function powsp and recipsp should work correctly. But the result turns my down~~

  • Jerome, if you use the rts function name you need to include math.h. If you use fastRTS function name you need to include fastRTS.h. Attached a simple pjt that demonstrates the correct usage. If you comment out math.h, powf will give incorrect result. If you comment out fastRTS.h, powsp will give incorrect result. With both header files included, both the invocations return correct results
    Gagan

    fastRTSTest.zip
  • 3x for your demonstration project which gives me a cleary picture how to use the RTS functions and fastRTS functions. The program works correctly now and it helps me a lot.  By the way, Some directives that missed or differed from waht in the fastRTS UG document  are as followings, that could help to use the fastRTS functions and RTS functions correctly :

    if the fastRTS functions are used in the program, the linker command should add the section directive "text:   > IRAM" to avoid the warning message that indicates some functions in the program don't specify the section. The functions defined in the fastrts67x.h can be invoked in your programs file if the fast67x.h header file is included. Here some mistakes in the fastRTS referece UG in chapter 4(fastRTS reference), for example, the powf/powsp function reference section, float powf(float x, float y) or float powsp(float x, float y) could be available in the fastRTS syntax if the fastrts67x.h header file is included. But actually you can't get the correct result from the powf function. As Gagan said, the result from powf function is correct only if the math.h file is included.

    if the RTS functions are used in the program, it is only need to include the math.h head file. The section directive "text:    > IRAM " can be also deleted.

    Sincerely appreciate for the advices and demonstrate project from RANDY and GAGAN.