MSP430FR6047: Double Precision Issue in IAR with MSP430 – "__double_size" Conflict

Part Number: MSP430FR6047

Tool/software:

I am working on an MSP430 project in IAR and need higher precision for floating-point calculations.

In CCS project, i was able to use the double (64-bit) and it resolved my precision issues. We have moved our projects to IAR and in IAR, setting double to 64-bit causes a linker error:

Error[e117]: Incompatible runtime models. Module app_metrology (C:\Users\xxx.r43) specifies that "__double_size" must be "64", but module _atoIQN (C:\Users\xxx\ussSWLib\IQMathlib\IQmathLib_IAR_MPY32_5xx_6xx_CPUX_large_code_large_data.lib) has the value "32".

It seems the IQMath library expects double to be 32-bit, conflicting with my project settings. How can I resolve this while maintaining 64-bit precision in IAR? Any guidance on IQMath compatibility or alternative solutions would be helpful.

Thanks!

  • Hi Nandkishor,

    Could you go to Project Options --> General Options --> Floating-point and try configuring double size to 64 bit, and let me know if this resolves the issue?

  • Hi Dylan,

    I have configured the double size to 64 bit only. And the error says: "__double_size" must be "64", but module _atoIQN (C:\Users\xxx\ussSWLib\IQMathlib\IQmathLib_IAR_MPY32_5xx_6xx_CPUX_large_code_large_data.lib) has the value "32"

  • Oh I see.

    Reading through the IQMath user's guide, I am not seeing support for using 64 bit inputs, regardless of compiler. In the CCS version, you are using a 64 bit value as an input to an IQMath function as well? Based on the documentation I am seeing I would not expect that to work.

  • The only way to cure that is to recompile the IQmath library. Not an option if the source isn't available.

  • I am not directly using the 64 bit value as an input to an IQMath function. I am performing this floating point operation, double_sum += float_variable*constant; 
    MSP  doesn't have hardware support for floating-point arthimetic i think it handles these operations at software level. 
    TI has provided different IQmath libraries for CCS and IAR: IQmathLib_CCS_MPY32_5xx_6xx_CPUX_large_code_large_data and IQmathLib_IAR_MPY32_5xx_6xx_CPUX_large_code_large_data. 

    I don't have the source code available for these libraries. 

  • You do know, of course, that IQ math is not floating point, right?

    Floating point is only used to convert back and forth to and from IQ representations.

  • atoIQ(char *) (the routine triggering this complaint) would appear to use floating point while converting a string to IQ format. Perhaps doing an explicit string to floating point conversion before using one of the IQ conversions, which use macros, would bypass the error.

  • I was thinking that, just do the conversion on your own.

  • Not getting why string to floating point conversion is required becuase I am already using float. And I am not explicitly using any IQ conversion. May be I am not understanding the exact problem here. Can you please show how does the solution that you are suggesting fits below

    Here is what is happening:

    pseudo code:

    float FlowRate;
    #define constant 2.777

    Discharge += FlowRate*constant;

    When i use Discharge as float (32 bit), I am able to complie code without any errors. But when i change the Discharge type to double (64 bit), I get the that error from IQmathLib_IAR_MPY32_5xx_6xx_CPUX_large_code_large_data.lib


  • I wanted to work with the floating point arithmetic only. But yes other backup I am having is to do the operation in fixed points and do the conversions on my own. 

  • This is not clear, if you "work with floating point arithmetic only", how does "do the operation in fixed point" enter in?

  • My aim is to obtain certain precision for the operation Discharge += FlowRate*constant;
    To obtain this precision in floating point arithmetic I need to choose Discharge as of double type (which is a easy change for my application) but getting some run time library errors. 
    So, the other workaround is I take FlowRate in IQxx format (which is available in my case) and calculate the Discharge in fixed point. 

    Changing discharge variable type from float to double is very basic (and I am able to this in CCS with provided CSS libraries) and I was hoping that there should be some resolution for IQmathLib_IAR_MPY32 library as well. 

  • You seem to be laser focused on this one thing (Discharge += FlowRate*constant;) but haven't addressed why the function causing the error (_atoIQN) is being called. Something you have done has  prompted the linker to drag in this function.

  • I have attached below the disassebly screenshot for the equation mentioned. The run time library is being used for this multiplication. In the below screenshot you can see the subroutines to address E9CC (?Mul32fHw32). And from the MAP file its evident that this address falls in the run time libray(IQmathLib_IAR_MPY32_5xx_6xx_CPUX_large_code_large_data) functions. 

    The issue I am facing with IQmathLib_IAR_MPY32_5xx_6xx_CPUX_large_code_large_data is only because of changing double size from 32 bit to 64 bit.

    This e2e post also refers to the same issue I am facing. 

  • The floating point library is not going to call for function in the fixed point library so you have misunderstood the .map file.

**Attention** This is a public forum