Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

LAUNCHXL-F28379D: SFRA

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: SFRA, TIDA-01606, TMS320F28379D, CONTROLSUITE

Hello,

I'm using and modifying the example solution tida_01606 for my own application and am having some trouble connecting the SFRA GUI. I've gone through my code comparing to the tida_01606 solution, and there are no differences for the SFRA portions of the code. I also attempted to connect the SFRA GUI to the original tida_01606 solution, but it also does not connect. In the GUI, I select floating point and the proper COM port, but no connection occurs. Any suggestions on where to begin debugging to find out why the GUI won't connect? I've been following the instructions in 'spruik4a'.

here i am attaching  SFRA code for your reference.

//
// Included Files
//
#include "F2837xD_device.h"
#include "F2837xD_Examples.h"
#include "sfra_f32.h"
#include "sfra_gui_scicomms_driverlib.h"
//
// SFRA related
//
#define TINV_SFRA_ISR_FREQ 20000
#define TINV_SFRA_AMPLITUDE (float32_t)0.01
#define TINV_SFRA_FREQ_START 1
#define TINV_SFRA_FREQ_LENGTH 30
#define TINV_SFRA_SPEED 1
//
// SFRA step Multiply = 10^(1/No of steps per decade(52))
//
#define TINV_SFRA_FREQ_STEP_MULTIPLY (float)1.2f
#define TINV_SFRA_GUI_SCI_BASE SCIA_BASE
#define TINV_SCI_VBUS_CLK 100000000
#define TINV_SFRA_GUI_SCI_BAUDRATE 57600
#define TINV_SFRA_GUI_SCIRX_GPIO 85
#define TINV_SFRA_GUI_SCITX_GPIO 84
#define TINV_SFRA_GUI_SCIRX_GPIO_PIN_CONFIG GPIO_85_SCIRXDA
#define TINV_SFRA_GUI_SCITX_GPIO_PIN_CONFIG GPIO_84_SCITXDA
//
// if the following #define is set to 1 SFRA GUI indicates status on an LED
// otherwise LED code is ignored
//
#define TINV_SFRA_GUI_LED_INDICATOR 1
#define TINV_SFRA_GUI_LED_GPIO 31
#define TINV_SFRA_GUI_LED_GPIO_PIN_CONFIG GPIO_31_GPIO31
#define TINV_SFRA_GUI_PLOT_OL_PLANT 1
//
// SFRA Related Variables
//
float32_t TINV_plantMagVect[TINV_SFRA_FREQ_LENGTH];
float32_t TINV_plantPhaseVect[TINV_SFRA_FREQ_LENGTH];
float32_t TINV_olMagVect[TINV_SFRA_FREQ_LENGTH];
float32_t TINV_olPhaseVect[TINV_SFRA_FREQ_LENGTH];
float32_t TINV_freqVect[TINV_SFRA_FREQ_LENGTH];
SFRA_F32 TINV_sfra1;
//
//extern to access tables in ROM
//
extern long FPUsinTable[];
void TINV_setupSFRA(void)
{
    SFRA_F32_reset(&TINV_sfra1);
    SFRA_F32_config(&TINV_sfra1,
                    TINV_SFRA_ISR_FREQ,
                    TINV_SFRA_AMPLITUDE,
                    TINV_SFRA_FREQ_LENGTH,
                    TINV_SFRA_FREQ_START,
                    TINV_SFRA_FREQ_STEP_MULTIPLY,
                    TINV_plantMagVect,
                    TINV_plantPhaseVect,
                    TINV_olMagVect,
                    TINV_olPhaseVect,
                    NULL,
                    NULL,
                    TINV_freqVect,
                    TINV_SFRA_SPEED);
    SFRA_F32_resetFreqRespArray(&TINV_sfra1);
    SFRA_F32_initFreqArrayWithLogSteps(&TINV_sfra1,
                                       TINV_SFRA_FREQ_START,
                                       TINV_SFRA_FREQ_STEP_MULTIPLY);
    SFRA_GUI_config(TINV_SFRA_GUI_SCI_BASE,
                    TINV_SCI_VBUS_CLK,
                    TINV_SFRA_GUI_SCI_BAUDRATE,
                    TINV_SFRA_GUI_SCIRX_GPIO,
                    TINV_SFRA_GUI_SCIRX_GPIO_PIN_CONFIG,
                    TINV_SFRA_GUI_SCITX_GPIO,
                    TINV_SFRA_GUI_SCITX_GPIO_PIN_CONFIG,
                    TINV_SFRA_GUI_LED_INDICATOR,
                    TINV_SFRA_GUI_LED_GPIO,
                    TINV_SFRA_GUI_LED_GPIO_PIN_CONFIG,
                   &TINV_sfra1,
                   TINV_SFRA_GUI_PLOT_OL_PLANT);
}
void TINV_runSFRABackGroundTasks(void)
{
    SFRA_F32_runBackgroundTask(&TINV_sfra1);
    SFRA_GUI_runSerialHostComms(&TINV_sfra1);
}

 

Thanks and regards,
R&D team,
Scientific Mes Technik Pvt ltd.
  • hi

    i followed the steps provided in doc.

    The issue is not resolved and am still having some trouble connecting the SFRA GUI.

    is there any mistake in the code?

    kindly help me in resolving the issue.

  • Hi 

    You were mentioning you cannot connect even with original TIDA-01606 code. Could you use the original code to connect by following the provided document? If it connects, you can compare with your code to figure out what's the difference.

  • Hi

    i tried with the original code with same steps as listed in the doc. Still the issue remains unresolved.

  • Hi

    It is probably because of the wrong GPIO being assigned. In this ref design with tms320f28379d control card, the SCI TX and RX pins are GPIOs 28 and 29. For launchpad, SCI TX and RX pins are GPIOs 42 and 43.

    Please change the GPIO setting accordingly and try again.

    #define TINV_SFRA_GUI_SCIRX_GPIO 28
    #define TINV_SFRA_GUI_SCITX_GPIO 29

    #define TINV_SFRA_GUI_SCIRX_GPIO_PIN_CONFIG GPIO_28_SCIRXDA
    #define TINV_SFRA_GUI_SCITX_GPIO_PIN_CONFIG GPIO_29_SCITXDA

  • Hi

    i have corrected the code and tried to run. Here is the modified code. I have run the SFRA background task in a slow loop of frequency 100Hz triggered by EPWM2 interrupt. But soon i try to connect to GUI the code is terminating and pointing the interrupt void PIE_RESERVED_ISR(void). Here is the screen shot of that.

    /*
     * sfra.c
     *
     *  Created on: 19-Oct-2022
     *      Author: rndl6
     */
    //
    // Included Files
    //
    #include "F2837xD_device.h"
    #include "F2837xD_Examples.h"
    #include "sfra_f32.h"
    #include "sfra_gui_scicomms_driverlib.h"
    //
    // SFRA related
    //
    
    #define TINV_SFRA_ISR_FREQ 20000
    #define TINV_SFRA_AMPLITUDE (float32_t)0.01
    #define TINV_SFRA_FREQ_START 1
    #define TINV_SFRA_FREQ_LENGTH 30
    #define TINV_SFRA_SPEED 1
    //
    // SFRA step Multiply = 10^(1/No of steps per decade(52))
    //
    #define TINV_SFRA_FREQ_STEP_MULTIPLY (float)1.2f
    
    #define TINV_SFRA_GUI_SCI_BASE SCIA_BASE
    #define TINV_SCI_VBUS_CLK 100000000
    #define TINV_SFRA_GUI_SCI_BAUDRATE 57600
    #define TINV_SFRA_GUI_SCIRX_GPIO 43
    #define TINV_SFRA_GUI_SCITX_GPIO 42
    #define TINV_SFRA_GUI_SCIRX_GPIO_PIN_CONFIG GPIO_43_SCIRXDA
    #define TINV_SFRA_GUI_SCITX_GPIO_PIN_CONFIG GPIO_42_SCITXDA
    //
    // if the following #define is set to 1 SFRA GUI indicates status on an LED
    // otherwise LED code is ignored
    //
    #define TINV_SFRA_GUI_LED_INDICATOR 1
    #define TINV_SFRA_GUI_LED_GPIO 31
    #define TINV_SFRA_GUI_LED_GPIO_PIN_CONFIG GPIO_31_GPIO31
    
    #define TINV_SFRA_GUI_PLOT_OL_PLANT 1
    //
    // SFRA Related Variables
    //
    float32_t TINV_plantMagVect[TINV_SFRA_FREQ_LENGTH];
    float32_t TINV_plantPhaseVect[TINV_SFRA_FREQ_LENGTH];
    float32_t TINV_olMagVect[TINV_SFRA_FREQ_LENGTH];
    float32_t TINV_olPhaseVect[TINV_SFRA_FREQ_LENGTH];
    float32_t TINV_freqVect[TINV_SFRA_FREQ_LENGTH];
    SFRA_F32 TINV_sfra1;
    //
    //extern to access tables in ROM
    //
    extern long FPUsinTable[];
    
    
    void TINV_setupSFRA(void)
    {
        SFRA_F32_reset(&TINV_sfra1);
        SFRA_F32_config(&TINV_sfra1,
                        TINV_SFRA_ISR_FREQ,
                        TINV_SFRA_AMPLITUDE,
                        TINV_SFRA_FREQ_LENGTH,
                        TINV_SFRA_FREQ_START,
                        TINV_SFRA_FREQ_STEP_MULTIPLY,
                        TINV_plantMagVect,
                        TINV_plantPhaseVect,
                        TINV_olMagVect,
                        TINV_olPhaseVect,
                        NULL,
                        NULL,
                        TINV_freqVect,
                        TINV_SFRA_SPEED);
    
        SFRA_F32_resetFreqRespArray(&TINV_sfra1);
    
        SFRA_F32_initFreqArrayWithLogSteps(&TINV_sfra1,
                                           TINV_SFRA_FREQ_START,
                                           TINV_SFRA_FREQ_STEP_MULTIPLY);
    
        SFRA_GUI_config(TINV_SFRA_GUI_SCI_BASE,
                        TINV_SCI_VBUS_CLK,
                        TINV_SFRA_GUI_SCI_BAUDRATE,
                        TINV_SFRA_GUI_SCIRX_GPIO,
                        TINV_SFRA_GUI_SCIRX_GPIO_PIN_CONFIG,
                        TINV_SFRA_GUI_SCITX_GPIO,
                        TINV_SFRA_GUI_SCITX_GPIO_PIN_CONFIG,
                        TINV_SFRA_GUI_LED_INDICATOR,
                        TINV_SFRA_GUI_LED_GPIO,
                        TINV_SFRA_GUI_LED_GPIO_PIN_CONFIG,
                       &TINV_sfra1,
                       TINV_SFRA_GUI_PLOT_OL_PLANT);
    
    }
    
    
    void TINV_runSFRABackGroundTasks(void)
    {
        SFRA_F32_runBackgroundTask(&TINV_sfra1);
        SFRA_GUI_runSerialHostComms(&TINV_sfra1);
    }
    

  • Hi,

    It is difficult to tell why it stop when putting SFRA background task in the interrupt. Could you try to put this task in a timer based tasks (A0) following the ref design? 

    Thanks,

    Qing 

  • Hi,

    i tried running SFRA background task in timer based tasks, but the issue is not resolved.

  • Can you try the ref design code? if it works fine, can you compare the SFRA code difference between your code and the ref design code? 

  • Just to confirm that after changing the GPIO setting, you are able to connect SFRA and run it with ref design code right?

  • No, the connection is not happening even with the Ref code.

  • Does it mean that you can connect SFRA unstably with your own code, with the GPIO pin corrected. However, you can not connect SFRA with ref code, with GPIO pin corrected?

  • The SFRA GUI connection is not happening with my own code as well as with the Ref code provided by TI. In both the cases i corrected GPIO pin according to the LAUNCHXL F28379D data sheet. As per the data lanchpad data sheet the SCI TX and RX pins are GPIOs 42 and 43.

  • Hi,

    I also tried existing TI code 'FCL_SFRA' from the path "C:\ti\controlSUITE\libs\app_libs\motor_control\libs\FCL_SFRA\v01_00_00_00\Examples",  for checking SFRA GUI connectivity.

    I select the build level as 'FCL_LEVEL6' and debug the program into MCU . Then I launched SFRA GUI , selected appropriate COM port , Baurd rate, Math mode.

    I didnt change the code but the connection with GUI is not happening. I even tried with other PC but issue remain same.Can you please provide webex call support to our time line.

  • It seems you are already in talk with TI internal people about this. Let's see how the support will be provided from there.