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/MOTORWARE: motorware + controlsuite

Part Number: MOTORWARE
Other Parts Discussed in Thread: CONTROLSUITE,

Tool/software: Code Composer Studio

I am using proj_lab07a.(f28069m)

I'm going to add a controlsuite example code.

I added the following code.

void main(void)
{
    /////////////////////////////190403
    // Step 1. Initialize System Control:
        // PLL, WatchDog, enable Peripheral Clocks
        // This example function is found in the F2806x_SysCtrl.c file.

        InitSysCtrl();

        // Step 2. Initalize GPIO:
        // This example function is found in the F2806x_Gpio.c file and
        // illustrates how to set the GPIO to it's default state.
        // InitGpio();  // Skipped for this example
        // Setup only the GP I/O only for SPI-A functionality
        InitSpiGpio();
        InitMcbspaGpio();

        EALLOW;
        GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO31 = 1;

        GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0;
        GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1;
        EDIS;

        // Step 3. Initialize PIE vector table:
        // Disable and clear all CPU interrupts
        DINT;
        IER = 0x0000;
        IFR = 0x0000;

        // Initialize PIE control registers to their default state:
        // This function is found in the F2806x_PieCtrl.c file.
        InitPieCtrl();

        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        // This will populate the entire table, even if the interrupt
        // is not used in this example.  This is useful for debug purposes.
        // The shell ISR routines are found in F2806x_DefaultIsr.c.
        // This function is found in F2806x_PieVect.c.
        InitPieVectTable();
///////////////////////////////190403

When I build, an error occurs as follows:

  • You are missing the bitfield source files that contain the API you are trying to call. If you do not have the source file, or the header if it is an inlined function, either in the workspace or on the search path, then CCS has no idea what the API is or how to define it. These API are defined in files like F2806x_PieCtrl.c and F2806x_PieVect.c, for example. These files reside in ControlSuite here: C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_common\source

    My suggestion would be to load a ControlSuite file that uses these API and look at the included source files and header include path. Once you've ascertained which files you need for the API you're calling in the Motorware project, you can add them to the CCS workspace as needed by selecting "Add Files.." from the right-click project drop-down menu in the CCS workspace

    Sean
  • I've solved all the above problems.
    BUT Another problem arose.
    Controlsuite use Uint16.
    so there are conflicts with the data type of motorware.
    Tell me how to solve it.
  • You need to include the right "F2806x_Device.h" in the project that includes the definitions for "Uint16" or other types.
    Please post the error messages that will help us to understand your question to solve it. Thanks.
  • We haven’t heard back from you for a week, I’m assuming you were able to resolve your issue. If not, just post a reply below (or create a new thread if the thread has locked due to time-out). Thanks.