Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > GPIF II 32bit CyU3PDeviceGpioOverride does not work

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



GPIF II 32bit CyU3PDeviceGpioOverride does not work
Moderator:
RSKV

Post Reply
Follow this topic



GPIF II 32bit CyU3PDeviceGpioOverride does not work

TIE posted on 14 Aug 2012 4:38 PM PST
Member
6 Forum Posts

Here is my code

    CyU3PGpioSimpleConfig_t gpioConfig;
   
    gpioConfig.outValue = CyFalse;
    gpioConfig.inputEn = CyFalse;
    gpioConfig.driveLowEn = CyTrue;
    gpioConfig.driveHighEn = CyTrue;
    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;
   

    CyU3PDeviceGpioOverride(17, CyTrue);
    CyU3PGpioSetSimpleConfig(17, &gpioConfig);
    CyU3PGpioSimpleSetValue(17       , CyTrue);     
 

In this way, I can not set GPIO17(CTL0) to high. I just test it with DVK. The pin only connect to oscilloscope.

Thanks

 

 




Re: GPIF II 32bit CyU3PDeviceGpioOverride does not work

RSKV posted on 15 Aug 2012 05:02 AM PST
Cypress Employee
655 Forum Posts

Hi,

It should work normally.

I am assuming that you are initializing the GPIO module before calling the code that you pasted here.

GPIO module can be initialized as follows:

/* Init the GPIO module */
        gpioClock.fastClkDiv = 2;
        gpioClock.slowClkDiv = 0;
        gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;
        gpioClock.clkSrc = CY_U3P_SYS_CLK;
        gpioClock.halfDiv = 0;

        /* Initialize Gpio interface */
        apiRetStatus = CyU3PGpioInit(&gpioClock, NULL);

Are you saying that it is not working only when you configure GPIF II in 32-bit mode. or it is not working at all for you. Please let me know.

Thanks,

sai krishna.

 



Re: GPIF II 32bit CyU3PDeviceGpioOverride does not work

RSKV posted on 15 Aug 2012 05:08 AM PST
Cypress Employee
655 Forum Posts

Are you seeing any of these APIs returning some error code?.

Thanks,

sai krishna.



Re: GPIF II 32bit CyU3PDeviceGpioOverride does not work

TIE posted on 15 Aug 2012 11:43 AM PST
Member
6 Forum Posts

void
GpioOutputThread_Entry (
        uint32_t input)
{
    CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

    /* Initialize Debug module */
    apiRetStatus = CyFxDebugInit();
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        /* Error handling */
        CyU3PDebugPrint (4, "Debug module initialization failed, error code = %d\n",
                apiRetStatus);
        CyFxAppErrorHandler(apiRetStatus);
    }

    /* Initialize GPIO module. */
    CyFxGpioInit ();

    CyU3PGpioSimpleConfig_t gpioConfig;
    CyU3PGpioClock_t gpioClock;


    for (;;)
    {
        gpioClock.fastClkDiv = 2;
        gpioClock.slowClkDiv = 0;
        gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;
        gpioClock.clkSrc = CY_U3P_SYS_CLK;
        gpioClock.halfDiv = 0;

        /* Initialize Gpio interface */
        apiRetStatus = CyU3PGpioInit(&gpioClock, NULL);
        if (apiRetStatus != CY_U3P_SUCCESS)
        {
            /* Error handling */
            CyU3PDebugPrint (4, "CyU3PGpioInit failed, error code = %d\n",
                    apiRetStatus);
//            CyFxAppErrorHandler(apiRetStatus);
        }

    gpioConfig.outValue = CyFalse;
    gpioConfig.inputEn = CyFalse;
    gpioConfig.driveLowEn = CyTrue;
    gpioConfig.driveHighEn = CyTrue;
    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    apiRetStatus = CyU3PDeviceGpioOverride(17, CyTrue);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        /* Error handling */
        CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",
                apiRetStatus);
        CyFxAppErrorHandler(apiRetStatus);
    }

    apiRetStatus = CyU3PGpioSetSimpleConfig(17, &gpioConfig);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        /* Error handling */
        CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",
                apiRetStatus);
        CyFxAppErrorHandler(apiRetStatus);
    }

    apiRetStatus = CyU3PGpioSimpleSetValue(17       , CyTrue);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        /* Error handling */
        CyU3PDebugPrint (4, "CyU3PGpioSimpleSetValue failed, error code = %d\n",
                apiRetStatus);
        CyFxAppErrorHandler(apiRetStatus);
    }
   

        /* Set the GPIO 21 to high */
        apiRetStatus = CyU3PGpioSimpleSetValue (21, CyTrue);
        if (apiRetStatus != CY_U3P_SUCCESS)
        {
            /* Error handling */
            CyU3PDebugPrint (4, "CyU3PGpioSetValue failed, error code = %d\n",
                    apiRetStatus);
            CyFxAppErrorHandler(apiRetStatus);
        }

        /* Wait for two seconds */
        CyU3PThreadSleep(2000);

        CyU3PGpioSetValue(17       , CyFalse);
        if (apiRetStatus != CY_U3P_SUCCESS)
        {
            /* Error handling */
            CyU3PDebugPrint (4, "CyU3PGpioSetValue failed, error code = %d\n",
                    apiRetStatus);
            CyFxAppErrorHandler(apiRetStatus);
        }


        /* Set the GPIO 21 to low */
        apiRetStatus = CyU3PGpioSimpleSetValue (21, CyFalse);
        if (apiRetStatus != CY_U3P_SUCCESS)
        {
            /* Error handling */
            CyU3PDebugPrint (4, "CyU3PGpioSetValue failed, error code = %d\n",
                    apiRetStatus);
            CyFxAppErrorHandler(apiRetStatus);
        }

        /* Wait for two seconds */
        CyU3PThreadSleep(2000);
    }
}

 

 I only modify this function in GpioApp project.  GPIO21 work prefect and  GPIO17 always 0.  Here is serial port output:  CyU3PGpioInit failed before output, error code = 67

 

 

Thanks

 

 



Re: GPIF II 32bit CyU3PDeviceGpioOverride does not work

TIE posted on 15 Aug 2012 01:51 PM PST
Member
6 Forum Posts

It worked. The 38-MIC-BRK-2 board is not pin to pin connect. I tested wrong pin.

 

Thanks






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.