TMS320F28386D: SFRA does not work (magnitude vector not filled)

Part Number: TMS320F28386D
Other Parts Discussed in Thread: SFRA, C2000WARE

Hello,

I am trying to run a SFRA acquisition on the F28386 microcontroller but it is not working properly. I have experience running SFRA in other microcontrollers and projects (with 32bit FPU), so I thought this would be pretty much the same, but im encountering some issues.

To test SFRA on this microcontroller I am doing the following:

    test_value = SFRA_F32_inject(0);
    test_output = 100*test_value;
    SFRA_F32_collect(&test_value,&test_output);

So, I would expect the result of the SFRA scan to be a gain of 40dB and phase of 0. 

The reality is that when I run the scan, I can only see the phase arrays being updated in the debugger, but the magnitude arrays stay at 0.

When running the SFRA sweep, i can see that the frequency index is increasing properly, and if I insert debug points, i can see that both test_value and test_output are being properly excited by the perturbation. 

More details on how I am implementing the SFRA library:

  • Since its a F28386D, i am linking directly against the "sfra_f64_tmu_eabi.lib" library
  • I am placing the sfra section correctly in the linker:

/* SFRA library data */
   SFRA_F32_Data: > RAMGS5_13, PAGE = 1, ALIGN = 64

  • I am correctly initializing SFRA:
void sfra_reset(void)
{
    SFRA_F32_reset(&SFRA.object);

    SFRA_F32_config(&SFRA.object,
                    SFRA_IV.freq_routine,
                    SFRA_IV.amplitud,
                    SFRA_FREQ_LENGTH,
                    SFRA_IV.freq_start,
                    SFRA_FREQ_STEP_MULT,
                    SFRA_IV.plant_Mag,
                    SFRA_IV.plant_Phase,
                    SFRA_IV.OL_Mag,
                    SFRA_IV.OL_Phase,
                    SFRA_IV.CL_Mag,
                    SFRA_IV.CL_Phase,
                    SFRA_IV.freq,
                    1.0);

    SFRA_F32_resetFreqRespArray(&SFRA.object);

    SFRA_F32_initFreqArrayWithLogSteps(&SFRA.object,SFRA_IV.freq_start,SFRA_FREQ_STEP_MULT);
}
  • I am also calling the SFRA_F32_runBackgroundTask function with a periodicity of 1 milisecond
  • I am calling the SFRA_F32_inject/collect functions in an ISR that runs at 6 KHz.
  • I checked that the array pointers of the SFRA object are correctly pointing to the arrays hoding the data.

3ce37b8d-7ab2-4d57-a031-0b1a0a9618b9.png

What am i doing wrong? Is SFRA not compatible with this microcontroller or is there anything that I am missing?

Thank you very much beforehand.