i.MX8QM SC_GPIO_02 (LED) toggle

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8QM SC_GPIO_02 (LED) toggle

Jump to solution
559 Views
rkohli2000
Contributor III

Hi, 

I tried to toggle an LED from imx8QM MEK SCU FW (board.c function board_init()) using SCU_LED on SC_GPIO_02.

Can someone suggest what's the issue here ?

In board_init(), I call a test function (DEBUG_Toggle_GPIO) from the BOOT_PHASE_FINAL_INIT case. The DEBUG function gets called but no LED toggles :

void DEBUG_Toggle_GPIO(uint32_t secs)
{
    pad_force_mux(SC_P_SCU_GPIO0_02, 0,SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF);

    rgpio_pin_config_t config;
    config.pinDirection = kRGPIO_DigitalOutput;

    /* SCU_LED on SC_GPIO_02 */
    config.outputLogic = 1U;
    for (uint32_t i = 0; i<secs; i++)
    {
        FGPIO_PinInit(FGPIOA, 2U, &config);
        SYSTICK_CycleDelay(SC_SYSTICK_NSEC_TO_TICKS(30U) + 1U);
        if (i%2 == 0)
        {
            FGPIO_PinWrite(FGPIOA, 1U, 1U);

        }
        else
        {
            FGPIO_PinWrite(FGPIOA, 1U, 0U);
        }
        SystemTimeDelay(1000000U);
    }
}

Thanks

0 Kudos
1 Solution
547 Views
rkohli2000
Contributor III

So, I found my typo in FGPIO_PinInit()....I needed to correct the Pin (1U):

FGPIO_PinInit(FGPIOA, 2U 1U, &config);

Now, I can see the LED toggle properly in my test, that's great.

Please ignore this question. 

View solution in original post

0 Kudos
1 Reply
548 Views
rkohli2000
Contributor III

So, I found my typo in FGPIO_PinInit()....I needed to correct the Pin (1U):

FGPIO_PinInit(FGPIOA, 2U 1U, &config);

Now, I can see the LED toggle properly in my test, that's great.

Please ignore this question. 

0 Kudos