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/TMS320F28335: Migrating DSP/Bios to SYS/BIOS

Part Number: TMS320F28335
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hello,

I am trying to migrate my DSP/BIOS project to SYS/BIOS.

I moved all  my DSP/BIOS project's files to this (except .tcf files) and cleared most of all errors.

Still I am getting following functional error. Can some one please help.

1> Description Resource Path Location Type unresolved symbol _SEM_count, first referenced in ./TaskScheduling.obj

2> Do I need InitPieVect()? 

3> I am using task.cfg for setting clk() in target specific support and set timer 0 for 500000 us but that is not exact. where should i look?

4> How to define Idle function loop that we used to define in task in .tcf?

Thanks in advance.

Thanks

Jigar 

  • Jigar Patel93027 said:
    1> Description Resource Path Location Type unresolved symbol _SEM_count, first referenced in ./TaskScheduling.obj

    SEM_count() is defined in sem.h. Please ensure that you're doing #include <sem.h>.

    Jigar Patel93027 said:
    2> Do I need InitPieVect()?

    I don't know what that function is.  Can you provide some context for its use?

    Jigar Patel93027 said:
    3> I am using task.cfg for setting clk() in target specific support and set timer 0 for 500000 us but that is not exact. where should i look?

    I don't know what you mean here.  Are you saying that you're trying to get a timer 0 interrupt every 1/2 second but it is not interrupting at that rate?

    Jigar Patel93027 said:
    4> How to define Idle function loop that we used to define in task in .tcf?

    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    Idle.addFunc('&myIdleFunc');

    See

    Regards,

    - Rob

  • Hello,

    I tried using following configurations to add this function and it did not work.

    Here is what i want to copy from my DSP/BIOS program

    My project works very well with DSP/BIOS, since i have a need to move it to SYS/BIOS, I have tried fillowings

    1> Tried migrating using migration manual, Did not work.

    2> Migrated my project on SYS/BIOS Task example and I have been facing all following issues 

    1> Memcpy to RAM did not work. (Whitney helped me to solve that.)

    2> DSP2833x_SysCtrl's InitPLL() does not seems to be working.

    3> I dont see any interrupts generating.

    Can you please guide me how to set up? 

    Thanks

    Jigar

  • Jigar Patel93027 said:
    I tried using following configurations to add this function and it did not work.

    Did you check the checkbox "Add the Idle function management module ...":

    You could just add the text from my original reply straight into your .cfg file if you're having trouble with the GUI.

    Jigar Patel93027 said:
    2> DSP2833x_SysCtrl's InitPLL() does not seems to be working.

    I don't know what this function is, it's not from SYS/BIOS.

    Jigar Patel93027 said:
    3> I dont see any interrupts generating.

    What interrupts do you expect that you are not seeing?

    It would be helpful to see your .cfg file and your program's .c file, can you attach them?

    Regards,

    - Rob

  • task.cfgHere are the files.

    1> Task.cfg --- > I want to run idle function with 512K and all other task are 256K. When i enable it through BIOS or add your script above gives me error. My DSP/BIOS project had a idle function named IDL_F_loop

    2>  My project.c  --- > I have ADC ISR and timer interrupt to trigger different fu

    isr_adc.c
    /*
     * LVD_90700_isr.c
     *
     *  Created on: Jun 10, 2016
     *      Author: yduan
     *
     *  Revision history
     *  CFS000  '06/06/2016'   Y.Duan    create file
     *
     */
    #include "DSP28x_Project.h"     // Device Header file and Examples Include File
    #include "DSP2833x_Adc.h"
    #include "TC_C000DEF.h"
    #include "TC_V100PIN.h"
    #include "LVD_90700_write_ePWM.h"
    #include "PNE_TC_PWM_para.h"
    #include "PNE_TC_V100DRV.h"
    #include "PNE_TC_AD_buffer.h"
    #include "PNE_TC_GateBlock.h"
    #include "PNE_TC_IO.h"
    #include "dlog4ch.h"
    #include "LVD_90700_isr_adc.h"
    #include "LVD_90700_isr_tripzone.h"
    #include "dlog_debug.h"
    #define DYNAMIC_DB 1
    /************* only for graph display, debug purpose*********************/
    #include "TC_V060DED.h"
    #include "TC_V300GET.h"
    #include "TC_V560SCC.h"
    #include "TC_M030CND.h"
    #include "TC_M023CIN.h"
    #include "TC_V800MAC.h"
    /************* end only for graph display, debug purpose*********************/
    
    Uint16 EH_adis_until_current_control_uc=1;
    Uint16 EH_do_current_control;
    Uint16 EH_AD_rawdata[4];
    Uint16 adc_isr_count = 0;
    Uint16 EH_gateblock = 0;
    Uint16 EH_v_adi_event_c = 0;
    Uint16 EH_AD_DCVnoise;
    
    extern int16 polar_deadtime_comp_u; // temp, debug only
    int16 EH_gateblock_prev = 0;
    
    /**************** debug plot*********************/
    extern int16 v_cur_daxis_s;
    extern int16 v_cur_qaxis_s;
    extern int16 v_cur_tuned_vphase_s;
    extern int16 v_cur_tuned_wphase_s;
    
    /**************** end debug plot*********************/
    
    void v_updateADrawdata();
    void v_updateAD_DCVnoise();
    void Set_high_Gpio_for_PBRD_control(void);
    void Set_low_Gpio_for_PBRD_control(void);
    /*for graphical display*/
    void Graphic_display(void);
    
    /**************************************************/
    
    __interrupt void  adc_isr(void)
    {
    	GpioDataRegs.GPBSET.bit.GPIO60 = 1;
    
    	adc_isr_count++;  // ISR needs to come here 
    	EH_v_adi_event_c = 0;
    
    
    
    	v_updateADrawdata(); /* read AD data */
    	PNE_v_UpdateAdRingBuffer(EH_AD_rawdata);
    
    	GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;
      if(EH_do_current_control ==1)
      {
    
    	AdcRegs.ADCTRL2.bit.SOC_SEQ2 = 1; // trigger SEQ2 conversion by software for noise reduction, 4 us from regular ADC
    
    	EH_adis_until_current_control_uc = PNE_getADperCurrentControl();
    	AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;         // Reset SEQ1
    	AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;       // Clear INT SEQ1 bit
    	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;   // Acknowledge interrupt to PIE
    	PieCtrlRegs.PIEIER1.bit.INTx1 = 0;		 // Disable
    
    	v_updateAD_DCVnoise();
    	PNE_write_DCVnoise(EH_AD_DCVnoise);
    
    	PNE_v_CarrierPeakOperation();
    
        if(PNE_v_GetEPwmPRD_change())
        {
        	v_WritePWMADfreq();
        	v_ResetEPwmPRD_change();
        }
    
    
    
    
    	EH_gateblock = PNE_getGateBlockStatus();
    	if(EH_gateblock == 0)
    	{
    		Disable_pwm();
    	}
    	else
    	{
    		if(EH_gateblock_prev == 0) Enable_pwm();
    		v_WritePWMdutyratio();
    	}
    	EH_gateblock_prev = EH_gateblock;
    
    
        if(PNE_getPBDRcommand() == 1) /*PBRD command*/
        {
    
        	Set_high_Gpio_for_PBRD_control(); // IGBT7 on
        }
        else
        {
        	Set_low_Gpio_for_PBRD_control(); // IGBT7 off
    
        }
    
    
    	/*graphic display, debug only*/
    		Graphic_display();	//for debug only
    
    
    	  if(PieCtrlRegs.PIEIFR1.bit.INTx1==1) /*another ADC already finished*/
    	  {
    		  v_updateADrawdata(); /* read AD data */
    		  PNE_v_UpdateAdRingBuffer(EH_AD_rawdata);
    		  AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;         // Reset SEQ1
    		  AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;       // Clear INT SEQ1 bit
    		  PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;   // Acknowledge interrupt to PIE
    		  PieCtrlRegs.PIEIFR1.bit.INTx1=0;
    		  EH_adis_until_current_control_uc--;
    	  }
    
        PieCtrlRegs.PIEIER1.bit.INTx1 = 1;
    
    
      }
      else
      {
    
    	AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;         // Reset SEQ1
    	AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;       // Clear INT SEQ1 bit
    	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;   // Acknowledge interrupt to PIE
      }
    //	GpioDataRegs.GPBCLEAR.bit.GPIO60 = 1;
    return;
    }
    
    
    void v_updateADrawdata()
    {
    //Update ADC results
    }
    
    void v_updateAD_DCVnoise() // only for DCV noise reduction
    {
    // Update DCV Noise
    }
    
    void Disable_pwm(void)
    {
    //Disable PWMs
    
    
    }
    
    void Enable_pwm(void)
    {
    	// PWM enable
    
    }
    
    
    
    int m_AdInterruptLossCheck()
    {
    //EH Interrupt loss
    }
    
    
    
    5165.Main.c
    //###########################################################################
    // Description
    
    //
    //
    
    #include "DSP28x_Project.h"     // Device Headerfile and Examples Include File
    #include "F28335_example.h"				// Main include file for set up run from flash
    #include "TC_C000DEF.h"
    #include "TC_V100PIN.h"
    #include "LVD_90700_write_ePWM.h"
    #include "LVD_90700_PortInit.h"
    #include "LVD_90700_I100INI.h"
    #include "LVD_90700_initEPWM.h"
    #include "LVD_90700_initAdc.h"
    #include "LVD_90700_isr_adc.h"
    #include "LVD_90700_isr_maincontrol.h"
    #include "LVD_90700_InterruptInit.h"
    #include "LVD_90700_ECap.h"
    #include "dlog4ch.h"
    #include "TC_Comm.h"
    #include "D005COM.H"
    #include "RamInit.h"
    #include "Eeprom.h"
    
    #include <xdc/std.h>
    #include <xdc/runtime/Log.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Semaphore.h>
    /*********************************/
    static void InitWatchDog(void);
    
    
    extern Uint16 RamfuncsLoadStart;
    extern Uint16 my_RamfuncsLoadSize;
    extern Uint16 RamfuncsLoadEnd;
    extern Uint16 RamfuncsRunStart;
    
    extern unsigned int my_RamfuncsLoadStart;
    extern unsigned int my_RamfuncsLoadSize;
    //extern unsigned int my_RamfuncsLoadEnd;
    extern unsigned int my_RamfuncsRunStart;
    
    // Global variables used in this example:
    //void Graphic_display(void);
    int16 DlogCh1 = 0;
    int16 DlogCh2 = 0;
    int16 DlogCh3 = 0;
    int16 DlogCh4 = 0;
    Uint16 svpwm_graph=1;
    // Create an instance of DATALOG Module
    DLOG_4CH dlog = DLOG_4CH_DEFAULTS;
    
    Uint16 EH_LoopCount = 0;
    
    //static volatile int testCount = 0;
    //#pragma CODE_SECTION(myFunction, ".ramfuncs")
    //void myFunction()
    //{
    //   testCount += 1;
    //}
    
    void main(void)
    {
    
    //
    //#ifdef EXAMPLE_FLASH					// EXAMPLE_FLASH, if defined, is in CCS project options
    //
    ////--- Copy all Flash sections that need to run from RAM (use memcpy() from RTS library)
    //
    // Section secureRamFuncs contains user defined code that runs from CSM secured RAM
    //	memcpy(&secureRamFuncs_runstart, &secureRamFuncs_loadstart, (Uint32)&secureRamFuncs_loadsize);
    //
    ////--- Initialize the Flash and OTP
    //	InitFlash();						// Initialize the Flash
    //
    //#endif
    
        memcpy(&my_RamfuncsRunStart, &my_RamfuncsLoadStart, (Uint32)&my_RamfuncsLoadSize);
        InitFlash();
    
    //    myFunction();
    
    	   InitSysCtrl(); // Initialize System Control:
    	   i_PortInit();		//initialize GPIO
    //	   InitSpi();
    //	   InitParam();
    
    	   EALLOW;
    	   SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;	//disable clock first
    	   EDIS;
    
    	   Init_ePWM(); // init the ePWM
    	   i_AdtrigInit();		//initialize ADC
    	   Init_TripZoneIFOC(); //init TripZone for OC and IF
    
    
    
    	   i_CommInit();
    	   d_SIOInitialize();
    	   StatusInit();		//debug
    
    	   i_FirmwearInit(); // firmwear parameter initialization
    	   i_IntInit();		//initialize interrupt
    	   Init_TripZoneCL(); // initialize CL
    	   InitECap();
    	   InitWatchDog();
    	   EALLOW;
    	   SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;	//synchronize all ePWM modules to the time base clock (TBCLK)
    	   EDIS;
    
    	    BIOS_start();    /* does not return */
    	    return(0);
    
    		// Initialize DATALOG module
    //	   dlog.iptr1 = &DlogCh1;
    //	   dlog.iptr2 = &DlogCh2;
    //	   dlog.iptr3 = &DlogCh3;
    //	   dlog.iptr4 = &DlogCh4;
    //	   dlog.trig_value = 0x1;
    //	   dlog.size = 0x0C8;
    //	   dlog.prescalar = 1;
    //	   dlog.init(&dlog);
    
    
    } // end of main()
    
    /**********************************************************************
    * Function: UserInit()
    *
    * Description: This is the user initialization file to be specified in
    * the DSP/BIOS configuration file, System - Global Settings.
    **********************************************************************/
    void UserInit(void)
    {
    #ifdef EXAMPLE_FLASH					// EXAMPLE_FLASH, if defined, is in CCS project options
    
    // Section .trcdata is generated by DSP/BIOS.
    // It must be copied from its load to its run address BEFORE main().
    //	memcpy(&trcdata_runstart, &trcdata_loadstart, (Uint32)&trcdata_loadsize);
    
    #endif
    
    } // end of UserInit()
    
    /*=================================================================================================*\
    | Description : InitWatchDog
    | Arguments   : Void
    | Returns     : Void
    | Date        : 05/16/2013
    | Author      : JMP
    Enable Watchdog
    \*=================================================================================================*/
    static void InitWatchDog(void)
    {
    	/*
    	 Enable Watchdog WDDIS = 0 Enable the DOG
    	 WDCK = 1 0 1
    	 WDPS = Clock /512 / 1
    	 1010 111*/
    	EALLOW;
    	SysCtrlRegs.WDCR = 0xAF;
    	EDIS;
    }
    
    
    
    //--- end of file -----------------------------------------------------
    
    nctions. Which also does not run.

    Please advise what is missing.

    3> isr_adc.c where interrupt needs to increment adc_isr_count.

    Thanks

    Jigar

  • To add an idle function, please add this into your .cfg (and edit as a text file, not XGCONF)

    Idle.addFunc('&myIdleFxn');

    and then add the myIdleFxn code into a source file.

    How are you creating the ADC_isr? If you are using Hwi, you must not use the interrupt keyword.

    Todd
  • Jigar,

    Did this get resolved?

    Todd
  • No. I am working with Whitney to get this issue resolved.

    Thanks
    Jigar
  • ok. I'm going to mark this as TI Thinks Resolved since you are working offline with a TI engineer.