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.

Query related project property setting for file Enable/Disable.

Other Parts Discussed in Thread: MOTORWARE, TEST2, CONTROLSUITE, DRV8301

Dear All/chris,

           I am using motorware13 for instaspin in CCS 6. I saw that in example code of motorware, CCS 6 provides selection for flash and ram files under Build Configurations -> Set Active -> flash/ram and based on that selection some file enable and disable in project.

My query is, I want to use same configuration for file selection in my project but could not find from where this type of settings in this motorware project. So any one have idea about this please share me.

Regards,

Abbas

  • Abbas,

    When you change a build configuration it is changing the active *.cmd file (memory map) which allocates for the device, RAM/FLASH, etc.

    These are located for each device variant at

    C:\ti\motorware\motorware_1_01_00_13\sw\ide\ccs\cmd\

    Here's an example where the F28069F RAM build is active and you can see the Flash build (F28069F.cmd) is being ignored from the project.

  • Dear Chris,

    That is some miss understanding regarding query.

    I already aware of that by selecting ram/flash in build configuration we can enable or disable  *.cmd file but if I want to select another files (like test1.c and test2.h) for different project, please tell me how can I set this type of configuration for my project files. 

    Like example:

    I have a project that contains files file1.c, file2.c and file3.c, if I select one option like flash/ram it selects file1.c and file2.c, other file file3.c would be disabled. And I select another option, file3.c gets included and file1.c and file2.c get disabled.

    Thanks & Regards,

    Abbas

  • I'm no sure you can exclude .c and .h files based on a build selection. I think you need to have separate projects for these...but I could be wrong.  Actually, I do recall that we have a controlSUITE example project for the DRV8301 board that has active configurations for different devices (F2803x and F2806x) so when you switch it changes the .cmd file as well as using different .h/.c files....I'm not an expert on this though.

    I think you will get a better response on HOW to do this on the CCS forum

    http://e2e.ti.com/support/development_tools/code_composer_studio/default.aspx

     

  • Dear Chris,

    Thanks for your solution, now I can able to enable/disable files from my project .

    I have another problem regarding Timer1 initialisation. I could not find sample Timer1 initialisation example so I made custom module but i dint work.  Will you provide me initialisation module for Timer1.

    My module:-

    void HAL_enabletimer1ints(HAL_Handle handle)
    {
                HAL_Obj *obj = (HAL_Obj *)handle;

                PIE_enableTimer1Int(obj->pieHandle);

                TIMER_start(obj->timerHandle[1]);

                // enable the cpu interrupt for timer1 interrupts
                //CPU_enableInt(obj->cpuHandle,CPU_IntNumber_13);
                IER |= 0x1000;

                return;
    }


    void PIE_enableTimer1Int(PIE_Handle pieHandle)
    {
               PIE_Obj *pie = (PIE_Obj *)pieHandle;

               uint16_t setValue = 1<<13;

               pie->INT13 =(intVec_t)setValue;

               return;
    } 

    Thanks & Regards

    Abbas

  • Hello,

    I think there is void TIMER_enableInt(TIMER_Handle timerHandle) in timer.c in motorware that you can call in HAL_setupTimers() in hal.c.

    And for setting timer interrupt in PIE, you should go to HAL_initIntVectorTable() in hal.h.

    For your example, this is my setting for timer 2 that I added in HAL_setupTimers() in hal.c

        uint32_t timerPeriod2_cnts = ((uint32_t) systemFreq_MHz * 5000) - 1;
        // Timer 2
        TIMER_setPeriod(obj->timerHandle[2], timerPeriod2_cnts);
        TIMER_setPreScaler(obj->timerHandle[2], 0);
        TIMER_stop(obj->timerHandle[2]);
        TIMER_reload(obj->timerHandle[2]);
        TIMER_setEmulationMode(obj->timerHandle[2], TIMER_EmulationMode_StopAfterNextDecrement);

        TIMER_start(obj->timerHandle[2]);
        TIMER_enableInt(obj->timerHandle[2]);
        CPU_enableInt(obj->cpuHandle, CPU_IntNumber_14);

    And in hal.h, HAL_initIntVectorTable(), I added:

      pie->TINT2 = &timer2ISR;

     


    Best regards,

    Maria

     

  • Hello Maria,  

    Thanks for solution, Timer1 starts working. :-)

    I have another query ;-) regarding qualification setting of gpio in Control register.I could not found that in sample programs, not even gpio.h and gpio.c . Help me through this. Thanks again.

    Regards

    Abbas

  • Hello Abbas,

    Amtech said:
    regarding qualification setting of gpio in Control register

    F2802x has this API.

    You can copy and paste from \motorware\motorware_1_01_00_13\sw\drivers\gpio\src\32b\f28x\f2802x, gpio.c,

    void GPIO_setQualification()


    Best regards,

    Maria

  • Ah, sorry, just realized that Chris said that the one in F2802x doesn't work properly.

    Actually, I have modified this API by myself (but I forgot the reason and from where I got this because actually the original ones look fine).

    This is the modification:

    void GPIO_setQualification(GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber, const GPIO_Qual_e qualification)
    {
        GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;


        ENABLE_PROTECTED_REGISTER_WRITE_MODE;

      /*  if(gpioNumber <= GPIO_Rsvd_15)
        {
            gpio->GPAQSEL1 = (uint32_t)qualification << (2 * gpioNumber);
        }
        else if(gpioNumber <= GPIO_Rsvd_31)
        {
            gpio->GPAQSEL2 = (uint32_t)qualification << (2 * (gpioNumber - GPIO_Rsvd_15));
        }
        else if(gpioNumber <= GPIO_Number_38)
        {
            gpio->GPBQSEL1 = (uint32_t)qualification << (2 * (gpioNumber - GPIO_Rsvd_31));
        } */
        // Modified by Maria
        if(gpioNumber < GPIO_Number_16)
              {
                uint_least8_t lShift = gpioNumber << 1;
                uint32_t clearBits = (uint32_t)GPIO_GPQSEL_CONFIG_BITS << lShift;
                uint32_t setBits = (uint32_t)qualification << lShift;

                // clear the bits
                gpio->GPAQSEL1 &= (~clearBits);

                // set the bits
                gpio->GPAQSEL1 |= setBits;
              }
            else if(gpioNumber < GPIO_Number_32)
              {
                uint_least8_t lShift = (gpioNumber - GPIO_Number_16) << 1;
                uint32_t clearBits = (uint32_t)GPIO_GPQSEL_CONFIG_BITS << lShift;
                uint32_t setBits = (uint32_t)qualification << lShift;

                // clear the bits
                gpio->GPAQSEL2 &= (~clearBits);

                // set the bits
                gpio->GPAQSEL2 |= setBits;
              }
            else
            {
              uint_least8_t lShift = (gpioNumber - GPIO_Number_32) << 1;
              uint32_t clearBits = (uint32_t)GPIO_GPQSEL_CONFIG_BITS << lShift;
              uint32_t setBits = (uint32_t)qualification << lShift;

              // clear the bits
              gpio->GPBQSEL1 &= (~clearBits);

              // set the bits
              gpio->GPBQSEL1 |= setBits;
            }

        DISABLE_PROTECTED_REGISTER_WRITE_MODE;

        return;
    } // end of GPIO_setQualification() function

    Best regards,

    Maria

  • Hello Chris/Maria,

    Thanks for your solution, I will use and update you.

    Regards

    Abbas

  • Hello Chris/Maria,

    We have modified our code by new GPIO files(pre-released) provided by Chris. Gladly its working fine and  we have tested it successfully. Thanks for help.

    Regards,

    Abbas