i.MX8QM SC_GPIO_02 (LED) toggle

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX8QM SC_GPIO_02 (LED) toggle

跳至解决方案
639 次查看
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 项奖励
回复
1 解答
627 次查看
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 项奖励
回复
1 回复
628 次查看
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 项奖励
回复