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.

Compiler/TMS320F28379D: Error: rts2800_fpu32_fast_supplement.lib<sqrt_f32.obj> redefined in rts2800_fpu32.lib<e_sqrtf.obj>

Part Number: TMS320F28379D
Other Parts Discussed in Thread: SFRA, C2000WARE, C2000WARE-DIGITALPOWER-SDK

Tool/software: TI C/C++ Compiler

Hi guys,

I have problem with SFRA. When I put SFRA_F_BACKGROUND function into my code, I get the following linker error.

rts2800_fpu32_fast_supplement.lib<sqrt_f32.obj> redefined in rts2800_fpu32.lib<e_sqrtf.obj>

I have found a similar problem in the thread below. and tried to apply same solution, but I've got this error message: #310 more than one instance of overloaded function "__relaxed_cosf" matches the argument list. And same error for sinf and sqrt functions. 

Is there any other way to solve this "sqrt redefined" error? By the way I use CCS 7.4 and C2000  compiler v16.9.8 LTS.

Thanks,

Hakan

  • By the way I managed to compile it using compiler V6.2.6. But I am not sure that version of compiler is suitable for F28379D. I would rather use a new compiler (v16.x or v18.x) for my application. But they are not working with fastRTS library correctly. Someone has also experienced this problem before (link below). So guys, is there any workaround to solve this problem?

    e2e.ti.com/.../511916
  • Any suggestion?

    As far as I understand, fastRTS and as a result SFRA do not work on F28379d. At least it is true for latest compilers 16.X and 18.X. I hope TI updates the SFRA library so that we have no problem during compilation.

    Regards,
    Hakan
  • I will need to loop in someone from the C2000 team.  Note that there are examples fro Fast RTS in C2000Ware.  I just tried importing them and they are building ok for me.  One thing I noticed is that the "standard RTS CCS Project" in Resource Explorer imports the Fast RTS project and the "Fast RTS CCS Project" imports the standard one.  I will file a bug for that.

    However if you import both of them you can compare the build options, specifically the link order.  The capture below is for the Standard RTS project and you can see that the regular RTS is ahead of the fast one.  In the Fast RTS project it is the reverse.

    As far as 28379D support I will need to differ to the C2000 team.  The examples are for F28335.  

    Regards,

    John

  • I spoke with a C2000 expert and they were not aware of any reason why this library would not work with F28379D.  You should be able to apply the linker build options and link order settings from the example.

    I have done this in a project myself with no issues.

    First I have modified my linker options to look like this.  You can see the 2 RTS libraries I am including and the order shown.  Below that you can see the search paths.  The key thing here was to add the path to where the fast RTS library is.  And then note the 2 options set at the very bottom.

    Next I made sure the link order has the supplemental library prior to the regular RTS library.  I had to click the add button to add them both.

    Regards,

    John

  • John,

    First of all thank you very much for your reply. I have already done what you said (also what is written in the pdfs) but didn't work for me.

    Then I created a new empty project and managed to run fastRTS and SFRA together on F28379d without a problem. But I didn't understand why it doesn't work for my actual project. Then I tried to use SFRA FTMU lib instead of SFRA F lib in my project and it worked!!!

    I am really busy right now, but when I have got time, I will move everything step by step from my actual project to this new project and find out what is the cause of this error. (just for engineering curiosity :)

    Regards,
    Hakan

  • Hakan,

    One reason the non TMU version of SFRA lib may not work on F28379 is if you do not copy the FPU tables.

    On F28379 with advent of TMU, we no longer have the FPUmath table in ROM. Hence the user must add them through the CMD file. Make sure you copy these tables in FLASH because then if you are running standalone you do not have an issue.

    Other than that, there is no issue running the FPU only lib on the F28379. It will just not use the TMU operation, and some of the imporovements from a background task cycle perspective will not be there.

    Also, regarding your other question,

    "On my old friend F28335, it takes about 3-3.5 seconds for each step of frequency test on a sampling rate 20Khz. (Maybe the library takes 65535 sample for each frequency, because 65535/20000 = 3.27, I don't know:) On my new friend F28379D I couldn't run SFRA F lib and only managed to run SFRA FTMU lib. "

    We made some imporovements to the TMU lib, to eliminate noise at low frequency readings. However I noticed that this slowed the sweep. We will be releasing a new version of this lib (TMU and FPU) which will be a lot faster. This will be v1_30_00_00 and will release inside the C2000Ware-DIGITALPOWER-SDK on Sep 21st 2018.

    Also we do have a issue tracked for this library, to enable the the user choose how fast to run these sweeps, but we will only be able to get to that by next year. (bandwidth issue becauase of different projects).

    Regards
    Manish Bhardwaj
  • Manish,

    How can I copy FPUTables if there are not in the ROM anymore? What can I use as the source of FPUTables for copy operation? I was suspicious about that could be the source of my problem and that's why I asked this: e2e.ti.com/.../710898

    I am looking forward to have the new version of SFRA on Sep 21st.

    Regards,
    Hakan
  • Hakan,

    You can simply use the below,

    Just put it in FLASH to begin with, this way when you run from FLASH you don;t have to worry about anything.

    FPUmathTables : > FLASH<>, PAGE =1
  • Manish,

    I have already put that in my cmd file and it didn't help. But I work on RAM, so I put FPUmathTables in RAM PAGE 1. I don't think putting tables into FLASH or RAM makes any difference, right?

    By the way, let me give you some feedback for the new SFRA library. Maybe you can find some of them useful.

    1) Instead of start frequency and step, you can define start and stop/end frequency, which is more logical to me. Because in frequency analysis, first I define frequency range that I am interested. Maybe its different in power electronics,  but for general, I think it is more natural way to define start and stop frequencies. I know I can calculate step value from stop frequency (and I do it that way), but it is better to put that calculation inside the library.

    2)Instead of one amplitude value, you can define start and stop amplitude like frequencies. It is very useful, when your system response is very low in higher frequencies you want to test. Because the weak response of your system at high frequency, the output of the system can diminish in the noise during the test. So, you may want to increase the amplitude to have better SNR value at high frequencies. But increasing the amplitude can also damage your system in the low frequency during the test. As a workaround I do multiple test for lower and higher frequency ranges with different amplitude value, but it will be an improvement if I can do everything in a single test.

    3) In SFRA, test frequencies are increasing in a logarithmic way using step value. I think it would be nice to have an option of increasing in a linear way.

    4) Like DC offset, you may want to add phase offset to the generated sinusoidal ref. Maybe it is not important for power electronics, but it could be very useful if you have a mechanical control system with a limited motion capability.

    5) You can eliminate jumps on sinusoidal reference during frequency switching and produce continuous sinusoidal signal with increasing frequency like MATLAB chirp signal.  This will decrease the settling time of the system output when the frequency is changed.


    Best Regards,
    Hakan

  • John & Manish,

    I found the source of the linker error. It is the "pow" function. Whenever I use SFRA (with SFRA F lib) and pow function together in a project, I get the "sqrt redefined" linker error. I get this error even in a new and clean project.

    If I change pow to powl, it is working. powf also does not work.

    FYI.
    Hakan
  • I have already put that in my cmd file and it didn't help. But I work on RAM, so I put FPUmathTables in RAM PAGE 1. I don't think putting tables into FLASH or RAM makes any difference, right?

    If you are connected to the debugger it does not make a difference, if you are running standalone, you will need some routine in code that will copy the tables from FLASH to RAM, if you use the RAM option. Hence i recommend using FLASH to begin with.  

    By the way, let me give you some feedback for the new SFRA library. Maybe you can find some of them useful.

    1) Instead of start frequency and step, you can define start and stop/end frequency, which is more logical to me. Because in frequency analysis, first I define frequency range that I am interested. Maybe its different in power electronics,  but for general, I think it is more natural way to define start and stop frequencies. I know I can calculate step value from stop frequency (and I do it that way), but it is better to put that calculation inside the library.F32

    Hakan, in the v1_30_00_00, the setup of SFRA will be independent of SFRA frequency points setup, i.e. the SFRA_init function which will be called SFRA_F32_config() .. now will not initialize the freq step array.

    Instead, there will be a separate function that will set the frequency points. Note , even in the current SFRA library, even though we setup SFRA for log steps, we often over-ride the frequency step by a following routine to setup according to your needs. This is done at init time.

        SFRA_F32_reset(&sfra1);
        SFRA_F32_config(&sfra1,
                        SFRA_ISR_FREQ,
                        SFRA_AMPLITUDE,
                        SFRA_FREQ_LENGTH,
                        SFRA_FREQ_START,
                        SFRA_FREQ_STEP_MULTIPLY,
                        plantMagVect,
                        plantPhaseVect,
                        olMagVect,
                        olPhaseVect,
                        freqVect);
    
        SFRA_F32_resetFreqRespArray(&sfra1);
    
    	
    	i=0;
    
    	#if SFRA_TYPE==SFRA_CURRENT// current loop
    		sfra1.freqVect[i++]=SFRA_FREQ_START;
    		for(;i<sfra1.vecLength;i++)
    		{
    			if(sfra1.freqVect[i-1]<10)
    				sfra1.freqVect[i]=sfra1.freqVect[i-1]+2;
    			else if(sfra1.freqVect[i-1]<50)
    				sfra1.freqVect[i]=sfra1.freqVect[i-1]+10;
    			else
    				sfra1.freqVect[i]=sfra1.freqVect[i-1]*sfra1.freqStep;
    		}
    	#else
    		sfra1.freqVect[0]=2;
    		sfra1.freqVect[1]=4;
    		sfra1.freqVect[2]=6;
    		sfra1.freqVect[3]=8;
    		sfra1.freqVect[4]=10;
    		sfra1.freqVect[5]=12;
    		sfra1.freqVect[6]=14;
    		sfra1.freqVect[7]=16;
    ....

    For example in the above, we set the frequency points to be more coarse at lower frequency, to make sweep go fatser and then finer at higher frequency etc..

    2)Instead of one amplitude value, you can define start and stop amplitude like frequencies. It is very useful, when your system response is very low in higher frequencies you want to test. Because the weak response of your system at high frequency, the output of the system can diminish in the noise during the test. So, you may want to increase the amplitude to have better SNR value at high frequencies. But increasing the amplitude can also damage your system in the low frequency during the test. As a workaround I do multiple test for lower and higher frequency ranges with different amplitude value, but it will be an improvement if I can do everything in a single test.

    Hakkan, We are adding a new function SFRA_F32_updateInjectionAmplitude , which you can call periodically to get the behavior you want. For example, the below can be used, you do not have to setup multiple runs of the SFRA. The reason why I do not want to add a linear scale in the library is because user may want different behavior depending on the system.

        SFRA_F32_runBackgroundTask(&sfra1);
        new_injection_amplitude = injectionAmplitudeStartFreq + slopeInjectionAmplitude * sfra1.freqIndex;
        SFRA_F32_updateInjectionAmplitude(&sfra1, new_injection_amplitude);
        SFRA_GUI_serialHostComms();

    3) In SFRA, test frequencies are increasing in a logarithmic way using step value. I think it would be nice to have an option of increasing in a linear way.

    As i mentioned earlier, SFRA does not care if the freqStep is log, even now, you can override the freq points by writing your own values to the freqVect array after the init routine. 


    4) Like DC offset, you may want to add phase offset to the generated sinusoidal ref. Maybe it is not important for power electronics, but it could be very useful if you have a mechanical control system with a limited motion capability.

    Can you elaborate a little more on this?

    5) You can eliminate jumps on sinusoidal reference during frequency switching and produce continuous sinusoidal signal with increasing frequency like MATLAB chirp signal.  This will decrease the settling time of the system output when the frequency is changed.

    I'll have to look at this more. 

  • Hakan,

    I will close this thread as your original question is answered, we did discuss some items about a future release.

    Please post a new thread if you have subsequent questions.

    regards
    Manish