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.

CCS/TMS320F28069M: IQmath bug?

Part Number: TMS320F28069M
Other Parts Discussed in Thread: C2000WARE, , TMS320F28069, CONTROLSUITE, MOTORWARE

Tool/software: Code Composer Studio

Hi

I use IQmath v1.6 on F28069M, I have the following code in my program:

    _iq30 nVal;

    float fVal;

...

    nVal = _IQ30(1.7);

    fVal = _IQ30toF(nVal);

The result in fVal is correct when I use IQmath.lib, it is 1.7, but when I use IQmath_fpu32.lib,

the result in fVal changes to 4.35, I don't know if this is a IQmath bug. Although this error

can be aviod if I change code from IQ30 to IQ29.

thanks,

Jiakai

  • Hello,
    I am writing to let you know that a C2000 team member has been assigned to this post and should be answering shortly.

    Regards
    Baskaran
  • Hi Jiakai,

    I'm not seeing that behaviour on my F28069 setup. I'm getting:
    nVal long 1.700000048 (Q-Value(30))
    fVal float 1.70000005

    Please can you check the following items?

    a. Download the latest version (v1.60.01.00) of the library in C2000Ware (nothing has been updated since v1.6 w.r.t. floating point, but there were some historical changes so we should check you are on the latest version).

    b. Check you are building your project with the --float_support=fpu32 compiler switch.

    c. Check you are linking "IQmath_fpu32.lib", not "IQmath.lib".

    Thanks.

    Regards,

    Richard
  • Hi Richard,

    Sorry for replying you so late, I was on a vacation.

    I replaced IQmath_fpu32.lib with the latest one (from C2000ware_1_00_01_00)

    and the result is still not correct. --float_support=fpu32 is also set.

    My project can be reached on the following URL, could you please take a look?

    This is a CCS v3.3 project, I added _IQ30toF function at the very beginning of main function.

     thanks,

    Jiakai

  • Jiakai,

    Everything I try is giving me the right answers: 1.6 for both nVal and fVal. I cannot build your project, but I can insert the five lines at the start of main() into a working CCSv7 project for F28069.

    BTW, I noticed your boot ROM addresses are wrong in the linker command file. For F28069, you should have:

    FPUTABLES : origin = 0x3FD860, length = 0x0006A0
    IQTABLES : origin = 0x3FDF00, length = 0x000B50

    I don't think that is the problem, but you need to change it.

    Can you send me the map file for this project please: "CanTestF2806x.map"?

    Thanks,

    Regards,

    Richard
  • Dear Richard,

    It's my fault, I forgot to let you know my project is generated for a TMS320F28069M, not a normal TMS320F28069.

    I tried to generate a normal F28069 project and run it on a F28069 MPU, every thing works fine, This error only occurs on F28069M MPU.

    The generated project is for CCS v3.3, CCS v7 has problem to import it (although CCS4 to CCS6 can import it without problem).

    You can check on the following project (it can be run at F28069M LaunchPad). It has been transferred to a CCS6 project.

    thanks,

    Jiakai

  • Jiakai,

    I am also using F28069M. Thanks for attaching the last file, however I'm having difficulty downloading it. Can you do whatever you did with the previous .zip attachment please? I could get that one.

    Regards,

    Richard
  • Hi Richard,

    I put it to previous website, please download it at the following URL.
    powersimtech.com/.../CanTestF2806xM.zip

    thanks
    Jiakai
  • Jiakai,

    I'm sorry for the delay in replying - I've had some IT problems which kept me from looking at this.  Thank you for sending the project.

    I can see the IQ30toF call in main(), however from the .map file I see only this:

    IQmath     0    000096a8    00000035    
                      000096a8    00000016     IQmath_fpu32.lib : IQ28toF.obj (IQmath)
                      000096be    00000016                      : IQ29toF.obj (IQmath)
                      000096d4    00000009                      : IQ15int.obj (IQmath)

    i.e. for some reaons IQ30toF.obj is not linked. 

    As I said, I am inserting the lines into a working F28069M project and it works as expected.  Here is what the .map file reports for that project:

    IQmath     0    00008851    00000016    
                      00008851    00000016     IQmath_fpu32.lib : IQ30toF.obj (IQmath)


    Your project did not contain the IQmathLib.h file, so I'm wondering if that has become corrupted somehow.  Can you check to that that file is OK please?  Download the latest controlSUITE or C2000Ware if you need a new copy.


    Regards,

    Richard

  • Dear Richard,

    Thank you very much!

    In the project there is a file named 2806xRevB_IQmath_BootROMsymbols_fpu.lib

    and it is copied from motorware 1_01_00_17.

    I know everything goes fine if I removed this file from the project, but I still want to 

    use ROM functions if it is possible.

    Do you have a latest 2806xRevB_IQmath_BootROMsymbols_fpu.lib?

    thanks,

    Jiakai

  • Hi Richard,

    I finally find a new 2806xRevB_IQmath_BootROMsymbols_fpu.lib from motorware 1-01-00-18.

    The problem disappears if I use this new library.

    thank you very much.

    Jiakai