Signal state of GPIO[52] when power is turned on.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_2585021
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

I have a question.

when FX3 power is on, After loading ROM from I2C,GPIO[52] output signal signal behaves as follows.

             ___________

______|                        |__________________  <GPIO[52] signal condition>

   ↑

End of loading

Stable to low level after high level period of 1ms occurs.

I would like to fix the low period after loading. Can you give me advice on what to do?

0 Likes
1 Solution

Hello

https://ejje.weblio.jp/content/WeI've solved the problem.

The changed code is changed to bold.

int main( void )

{

    CyU3PIoMatrixConfig_t io_cfg;

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    /* Initialize the device */

    status = CyU3PDeviceInit( NULL ); // CPU=200MHz, MMIO=100MHz, DMA=100MHz

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* Initialize the caches */

    status = CyU3PDeviceCacheControl( CyTrue,   // enable instruction cache

                                      CyFalse,  // disable data cache

                                      CyFalse); // disable DMA data cache

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* Configure the IO matrix */

    io_cfg.isDQ32Bit = CyTrue;

    io_cfg.useUart   = CyTrue;

    io_cfg.useI2C    = CyTrue;

    io_cfg.useI2S    = CyFalse;

    io_cfg.useSpi    = CyFalse;

    io_cfg.lppMode   = CY_U3P_IO_MATRIX_LPP_DEFAULT;

    /* No GPIOs are enabled here. Initialized in */

    io_cfg.gpioSimpleEn[0]  = 0x00000000;

    io_cfg.gpioSimpleEn[1]  = 0x00100000;    // pre-change I2S_WS to GPIO on GPIO[52] port

    io_cfg.gpioComplexEn[0] = 0;

    io_cfg.gpioComplexEn[1] = 0;

    status = CyU3PDeviceConfigureIOMatrix( &io_cfg );

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* This is a non returnable call for initializing the RTOS kernel */

    CyU3PKernelEntry();

    /* Dummy return to make the compiler happy */

    return 0;

handle_fatal_error:

    /* Cannot recover from this error. */

    while(1);

}

void AppThread_Entry( uint32_t input )

{

    /* Initialize the UART example application */

CyFxDebugInit();

// Debug

CyU3PGpifRegisterSMIntrCallback( GpifSMIntrCb );

    // Initialize FX3

   Init();

    // Application Loop

    while(1){

      //=== USB operation loop(cut) ===

    }

}

void Init(){

    CyU3PGpioClock_t        gpioClock;

    CyU3PGpioSimpleConfig_t gpioConfig;

    CyU3PReturnStatus_t     apiRetStatus = CY_U3P_SUCCESS;

    CyU3PReturnStatus_t     dswRetStatus = CY_U3P_SUCCESS;  // @200807-check

//===================================================

//    Follow : GPIO initialize

//===================================================

    //=========================================================================

    // Initialize the GPIO module's clock 100MHz

    //=========================================================================

    gpioClock.fastClkDiv = 2;

    gpioClock.slowClkDiv = 0;

    gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

    gpioClock.clkSrc = CY_U3P_SYS_CLK;

    gpioClock.halfDiv = 0;

    apiRetStatus = CyU3PGpioInit( &gpioClock, IsrGpio_CB );

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    //=========================================================================

    // Configure as Input

    //=========================================================================

    gpioConfig.outValue = CyFalse;

    gpioConfig.driveLowEn = CyFalse;

    gpioConfig.driveHighEn = CyFalse;

    gpioConfig.inputEn = CyTrue;

  

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    apiRetStatus = CyU3PDeviceGpioOverride( 23, CyTrue );                       // GPIO[23]/CTL6 (Din#0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(23, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 25, CyTrue );                       // GPIO[25]/CTL8 (INTn1)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetIoMode( 25, CY_U3P_GPIO_IO_MODE_WPU );           // pull-up

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(25, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

  

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 22, CyTrue );                       // GPIO[22]/ (CMTRQn)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(22, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 24, CyTrue );                       // GPIO[24]/ (Intn0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(24, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//=======================================================================================

    //=========================================================================

    // Configure as Output

    //=========================================================================

    gpioConfig.driveLowEn = CyTrue;

    gpioConfig.driveHighEn = CyTrue;

    gpioConfig.inputEn = CyFalse;

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 27, CyTrue );

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(27, &gpioConfig);                   // GPIO[27]/CTL10 (RESETn)

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    // GPIOs are output to notify message to FPGA's LED

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 45, CyTrue );                       // GPIO[45] (LED1:USB3.0=High/USB2.0=Low)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 50, CyTrue );                       // GPIO[50]/I2S_CLK (Dout#0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(50, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//========================================================================

//  The following Code : GPIO[52] to Lo Level

//  GPIO [52] has already been overridden by the I2S peripheral to GPIO.

//  Therefore, it is not neesarry to call the override API.

//========================================================================

    gpioConfig.outValue = CyFalse; // Low

//    apiRetStatus = CyU3PDeviceGpioOverride( 52, CyTrue );               @comment out

//   if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }    @comment out

    apiRetStatus = CyU3PGpioSetSimpleConfig(52, &gpioConfig);     // GPIO[52]/I2S_WD (Dout#1 : start Lo level)

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//====================================================================

//===================================================

//    Follow : GPIF initialize

//                I2C Initialize

//                Initialize USB, Register the callback routines, and Set the descriptors.

//===================================================

  //  === cut  ===

    return;

}

I was able to confirm the expected behavior with the above code.

Thanks.

Best Regards,

Hiro.

View solution in original post

0 Likes
3 Replies
YashwantK_46
Moderator
Moderator
Moderator
100 solutions authored 50 solutions authored 50 likes received

Hello,

Can you please elaborate on your requirement?

Is it like the GPIO[52] should stay low even after loading the firmware from I2C EEPROM?
(Restricting the GPIO[52] from going high for 1ms after loading the firmware)?

Also, can you please let me know which firmware you are using? Is it a default example or a custom firmware?

Regards,
Yashwant

0 Likes

Dear Yashwant

Thank you for your quick response.

My project is custom firmware. The code from the start of main until GPIO [52] becomes Low level is described below.

int main( void )

{

    CyU3PIoMatrixConfig_t io_cfg;

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    /* Initialize the device */

    status = CyU3PDeviceInit( NULL ); // CPU=200MHz, MMIO=100MHz, DMA=100MHz

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* Initialize the caches */

    status = CyU3PDeviceCacheControl( CyTrue,   // enable instruction cache

                                      CyFalse,  // disable data cache

                                      CyFalse); // disable DMA data cache

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* Configure the IO matrix */

    io_cfg.isDQ32Bit = CyTrue;

    io_cfg.useUart   = CyTrue;

    io_cfg.useI2C    = CyTrue;

    io_cfg.useI2S    = CyFalse;

    io_cfg.useSpi    = CyFalse;

    io_cfg.lppMode   = CY_U3P_IO_MATRIX_LPP_DEFAULT;

    /* No GPIOs are enabled here. Initialized in */

    io_cfg.gpioSimpleEn[0]  = 0;

    io_cfg.gpioSimpleEn[1]  = 0;

    io_cfg.gpioComplexEn[0] = 0;

    io_cfg.gpioComplexEn[1] = 0;

    status = CyU3PDeviceConfigureIOMatrix( &io_cfg );

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* This is a non returnable call for initializing the RTOS kernel */

    CyU3PKernelEntry();

    /* Dummy return to make the compiler happy */

    return 0;

handle_fatal_error:

    /* Cannot recover from this error. */

    while(1);

}

void AppThread_Entry( uint32_t input )

{

    /* Initialize the UART example application */

CyFxDebugInit();

// Debug

CyU3PGpifRegisterSMIntrCallback( GpifSMIntrCb );

    // Initialize FX3

   Init();

    // Application Loop

    while(1){

      //=== USB operation loop(cut) ===

    }

}

void Init(){

    CyU3PGpioClock_t        gpioClock;

    CyU3PGpioSimpleConfig_t gpioConfig;

    CyU3PReturnStatus_t     apiRetStatus = CY_U3P_SUCCESS;

    CyU3PReturnStatus_t     dswRetStatus = CY_U3P_SUCCESS;  // @200807-check

//===================================================

//    Follow : GPIO initialize

//===================================================

    //=========================================================================

    // Initialize the GPIO module's clock 100MHz

    //=========================================================================

    gpioClock.fastClkDiv = 2;

    gpioClock.slowClkDiv = 0;

    gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

    gpioClock.clkSrc = CY_U3P_SYS_CLK;

    gpioClock.halfDiv = 0;

    apiRetStatus = CyU3PGpioInit( &gpioClock, IsrGpio_CB );

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    //=========================================================================

    // Configure as Input

    //=========================================================================

    gpioConfig.outValue = CyFalse;

    gpioConfig.driveLowEn = CyFalse;

    gpioConfig.driveHighEn = CyFalse;

    gpioConfig.inputEn = CyTrue;

   

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    apiRetStatus = CyU3PDeviceGpioOverride( 23, CyTrue );                       // GPIO[23]/CTL6 (Din#0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(23, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 25, CyTrue );                       // GPIO[25]/CTL8 (INTn1)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetIoMode( 25, CY_U3P_GPIO_IO_MODE_WPU );           // pull-up

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(25, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

   

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 22, CyTrue );                       // GPIO[22]/ (CMTRQn)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(22, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 24, CyTrue );                       // GPIO[24]/ (Intn0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(24, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//=======================================================================================

    //=========================================================================

    // Configure as Output

    //=========================================================================

    gpioConfig.driveLowEn = CyTrue;

    gpioConfig.driveHighEn = CyTrue;

    gpioConfig.inputEn = CyFalse;

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 27, CyTrue );

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(27, &gpioConfig);                   // GPIO[27]/CTL10 (RESETn)

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    // GPIOs are output to notify message to FPGA's LED

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 45, CyTrue );                       // GPIO[45] (LED1:USB3.0=High/USB2.0=Low)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 50, CyTrue );                       // GPIO[50]/I2S_CLK (Dout#0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(50, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//=======================================================================================

//  The following Code : GPIO[52] to Lo Level

//=======================================================================================

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 52, CyTrue );                       // GPIO[52]/I2S_WD (Dout#1 : start Lo level)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(52, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//=======================================================================================

//===================================================

//    Follow : GPIF initialize

//                I2C Initialize

//                Initialize USB, Register the callback routines, and Set the descriptors.

//===================================================

  //  === cut  ===

    return;

}

             ?????????????? ← Who is high level?

             ___________

______|                        |__________________  <GPIO[52] signal condition>

   ↑          ↑

End of loading        Source code shown above : GPIO[52] to Lo Level

I would be grateful if you could give me some advice.

Regards,

Hiro.

0 Likes

Hello

https://ejje.weblio.jp/content/WeI've solved the problem.

The changed code is changed to bold.

int main( void )

{

    CyU3PIoMatrixConfig_t io_cfg;

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    /* Initialize the device */

    status = CyU3PDeviceInit( NULL ); // CPU=200MHz, MMIO=100MHz, DMA=100MHz

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* Initialize the caches */

    status = CyU3PDeviceCacheControl( CyTrue,   // enable instruction cache

                                      CyFalse,  // disable data cache

                                      CyFalse); // disable DMA data cache

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* Configure the IO matrix */

    io_cfg.isDQ32Bit = CyTrue;

    io_cfg.useUart   = CyTrue;

    io_cfg.useI2C    = CyTrue;

    io_cfg.useI2S    = CyFalse;

    io_cfg.useSpi    = CyFalse;

    io_cfg.lppMode   = CY_U3P_IO_MATRIX_LPP_DEFAULT;

    /* No GPIOs are enabled here. Initialized in */

    io_cfg.gpioSimpleEn[0]  = 0x00000000;

    io_cfg.gpioSimpleEn[1]  = 0x00100000;    // pre-change I2S_WS to GPIO on GPIO[52] port

    io_cfg.gpioComplexEn[0] = 0;

    io_cfg.gpioComplexEn[1] = 0;

    status = CyU3PDeviceConfigureIOMatrix( &io_cfg );

    if( status != CY_U3P_SUCCESS ){ goto handle_fatal_error; }

    /* This is a non returnable call for initializing the RTOS kernel */

    CyU3PKernelEntry();

    /* Dummy return to make the compiler happy */

    return 0;

handle_fatal_error:

    /* Cannot recover from this error. */

    while(1);

}

void AppThread_Entry( uint32_t input )

{

    /* Initialize the UART example application */

CyFxDebugInit();

// Debug

CyU3PGpifRegisterSMIntrCallback( GpifSMIntrCb );

    // Initialize FX3

   Init();

    // Application Loop

    while(1){

      //=== USB operation loop(cut) ===

    }

}

void Init(){

    CyU3PGpioClock_t        gpioClock;

    CyU3PGpioSimpleConfig_t gpioConfig;

    CyU3PReturnStatus_t     apiRetStatus = CY_U3P_SUCCESS;

    CyU3PReturnStatus_t     dswRetStatus = CY_U3P_SUCCESS;  // @200807-check

//===================================================

//    Follow : GPIO initialize

//===================================================

    //=========================================================================

    // Initialize the GPIO module's clock 100MHz

    //=========================================================================

    gpioClock.fastClkDiv = 2;

    gpioClock.slowClkDiv = 0;

    gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

    gpioClock.clkSrc = CY_U3P_SYS_CLK;

    gpioClock.halfDiv = 0;

    apiRetStatus = CyU3PGpioInit( &gpioClock, IsrGpio_CB );

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    //=========================================================================

    // Configure as Input

    //=========================================================================

    gpioConfig.outValue = CyFalse;

    gpioConfig.driveLowEn = CyFalse;

    gpioConfig.driveHighEn = CyFalse;

    gpioConfig.inputEn = CyTrue;

  

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    apiRetStatus = CyU3PDeviceGpioOverride( 23, CyTrue );                       // GPIO[23]/CTL6 (Din#0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(23, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 25, CyTrue );                       // GPIO[25]/CTL8 (INTn1)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetIoMode( 25, CY_U3P_GPIO_IO_MODE_WPU );           // pull-up

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(25, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

  

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 22, CyTrue );                       // GPIO[22]/ (CMTRQn)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(22, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

    apiRetStatus = CyU3PDeviceGpioOverride( 24, CyTrue );                       // GPIO[24]/ (Intn0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(24, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//=======================================================================================

    //=========================================================================

    // Configure as Output

    //=========================================================================

    gpioConfig.driveLowEn = CyTrue;

    gpioConfig.driveHighEn = CyTrue;

    gpioConfig.inputEn = CyFalse;

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 27, CyTrue );

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(27, &gpioConfig);                   // GPIO[27]/CTL10 (RESETn)

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    // GPIOs are output to notify message to FPGA's LED

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 45, CyTrue );                       // GPIO[45] (LED1:USB3.0=High/USB2.0=Low)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

    gpioConfig.outValue = CyFalse; // Low

    apiRetStatus = CyU3PDeviceGpioOverride( 50, CyTrue );                       // GPIO[50]/I2S_CLK (Dout#0)

    if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }

    apiRetStatus = CyU3PGpioSetSimpleConfig(50, &gpioConfig);

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//========================================================================

//  The following Code : GPIO[52] to Lo Level

//  GPIO [52] has already been overridden by the I2S peripheral to GPIO.

//  Therefore, it is not neesarry to call the override API.

//========================================================================

    gpioConfig.outValue = CyFalse; // Low

//    apiRetStatus = CyU3PDeviceGpioOverride( 52, CyTrue );               @comment out

//   if( apiRetStatus != 0 ){ CyFxAppErrorHandler( apiRetStatus ); }    @comment out

    apiRetStatus = CyU3PGpioSetSimpleConfig(52, &gpioConfig);     // GPIO[52]/I2S_WD (Dout#1 : start Lo level)

    if( apiRetStatus != CY_U3P_SUCCESS ){ CyFxAppErrorHandler( apiRetStatus ); }

//====================================================================

//===================================================

//    Follow : GPIF initialize

//                I2C Initialize

//                Initialize USB, Register the callback routines, and Set the descriptors.

//===================================================

  //  === cut  ===

    return;

}

I was able to confirm the expected behavior with the above code.

Thanks.

Best Regards,

Hiro.

0 Likes