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.

TDA4AL-Q1: GPIO0_32 can not output high level

Part Number: TDA4AL-Q1
Other Parts Discussed in Thread: SYSCONFIG

Hi Ti

    My code is as follows, But  GPIO0_32 can not output high level; Please help me check,Thank you very much

GPIO_PinConfig gpioPinConfigs[] =
{
    GPIO_DEVICE_CONFIG(0, 12)  | GPIO_CFG_INPUT,  //FRONT_CAMERA_LINK_LOCK_GPIO
    GPIO_DEVICE_CONFIG(0, 29)  | GPIO_CFG_INPUT,  //FRONT_CAMERA_MAX_PMIC_INT_PIN
    GPIO_DEVICE_CONFIG(0, 39)  | GPIO_CFG_INPUT,  //SURROND_CAMERA_LINK_LOCK_GPIO
    GPIO_DEVICE_CONFIG(0, 14)  | GPIO_CFG_INPUT,  //SURROND_CAMERA_MAX_PMIC_INT_PIN
    GPIO_DEVICE_CONFIG(0, 32)  | GPIO_CFG_OUTPUT, 
    GPIO_DEVICE_CONFIG(1, 6)   | GPIO_CFG_OUT_HIGH ,  //FCAM_96716_PWDN
    GPIO_DEVICE_CONFIG(1, 20)  | GPIO_CFG_OUT_HIGH ,  //SCAM_96717A_PWDNB
    GPIO_DEVICE_CONFIG(1, 26)  | GPIO_CFG_OUT_HIGH ,  //MAX20087_EN
    GPIO_DEVICE_CONFIG(1, 32)  | GPIO_CFG_OUT_HIGH ,  //FCAM_96717_PWDNB
    GPIO_DEVICE_CONFIG(1, 30)  | GPIO_CFG_OUT_HIGH ,  //ADAS_VDD_1V2_EN
    GPIO_DEVICE_CONFIG(1, 33)  | GPIO_CFG_OUT_HIGH ,  //MAX20089_EN
    GPIO_DEVICE_CONFIG(1, 35)  | GPIO_CFG_OUT_HIGH ,  //SCAM_96712_PWDN
    GPIO_DEVICE_CONFIG(1, 53)  | GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_OUT_HIGH ,
    GPIO_DEVICE_CONFIG(1, 57)  | GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_OUT_HIGH ,
};

/* GPIO Driver call back functions */
GPIO_CallbackFxn gpioCallbackFunctions[] =
{
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
};
GPIO_v0_Config GPIO_v0_config =
{
    gpioPinConfigs,
    gpioCallbackFunctions,
    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
    0x8U
};


/* ========================================================================== */
/*                         Structure Declarations                             */
/* ========================================================================== */

static int32_t appSetupI2CInst(uint8_t i2cInst);
static int32_t appCloseI2CInst(void);
static int32_t appOv2775Config(AppSensorCmdParams *prms);
static int32_t appImx390Config(AppSensorCmdParams *prms);

int32_t appRemoteServiceSensorHandler(char *service_name, uint32_t cmd,
    void *prm, uint32_t prm_size, uint32_t flags);

/* ========================================================================== */
/*                          Function Declarations                             */
/* ========================================================================== */

static void appInitGpio(void);

/* ========================================================================== */
/*                            Global Variables                                */
/* ========================================================================== */

static I2C_Handle gI2cHandle = NULL;


/* ========================================================================== */
/*                  Internal/Private Function Declarations                    */
/* ========================================================================== */

void appInitGpio(void)
{
    {
    GPIO_v0_HwAttrs gpio_cfg;
    GPIO_socGetInitCfg(1, &gpio_cfg);
    gpio_cfg.baseAddr = CSL_WKUP_GPIO0_BASE;

    gpio_cfg.intCfg[53].eventId = 0;
    gpio_cfg.intCfg[53].intcMuxNum = INVALID_INTC_MUX_NUM;
    gpio_cfg.intCfg[53].intcMuxInEvent = 0;
    gpio_cfg.intCfg[53].intcMuxOutEvent = 0;

    gpio_cfg.intCfg[57].eventId = 0;
    gpio_cfg.intCfg[57].intcMuxNum = INVALID_INTC_MUX_NUM;
    gpio_cfg.intCfg[57].intcMuxInEvent = 0;
    gpio_cfg.intCfg[57].intcMuxOutEvent = 0;
    
    GPIO_socSetInitCfg(1, &gpio_cfg);
    }

    GPIO_init();
}

static TimerP_Params   timerParams;
static TimerP_Handle  timerHandle = NULL;
static uint8_t timer_count = 0;
static void timerFxn(uintptr_t arg)
{
    if(timer_count == 0){
        GPIO_write(4, 0);
        timer_count++;
    }
    else if(timer_count == 9)
    {
          GPIO_write(4, 1);
          timer_count = 0;
    }else
       timer_count++;

       //appLogPrintf("timer ........................\n");
}

/* ========================================================================== */
/*                          Function Definitions                              */
/* ========================================================================== */

int32_t appGpioInit(void)
{
    pinmuxPerCfg_t gGpio0PinCfg[] =
    { 
        /* MyGPIO0 -> GPIO0_12 -> T26 */
        {
            PIN_MCAN12_RX, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },

        /* MyGPIO0 -> GPIO0_29 -> R28 */        
        {
            PIN_MCAN2_TX, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },  

        /* MyGPIO0 -> GPIO0_39 -> T24 */
        {
            PIN_MCASP0_AXR11, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },

         /* MyGPIO0 -> GPIO0_14 -> AB28 */
        {
            PIN_MCASP0_ACLKX, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
         /* MyGPIO0 -> GPIO0_14 -> AB28 */
        {
            PIN_MCASP0_AXR4, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },       
        {PINMUX_END}
    };
    #define BOARD_SOC_DOMAIN_MAIN    (0)
    pinmuxModuleCfg_t gGpioPinCfg[] =
    {
        {0, TRUE, gGpio0PinCfg},
        {PINMUX_END}
    };
    pinmuxBoardCfg_t gJ721S2_MainPinmuxData[] =
    {
        {0, gGpioPinCfg},
        {PINMUX_END}
    };
    Board_pinmuxUpdate(gJ721S2_MainPinmuxData, BOARD_SOC_DOMAIN_MAIN);

    appInitGpio();
 
    /* Initialize timer parameters */
    TimerP_Params_init(&timerParams);

    /* Configure periodic timer for 0.003 sec*/
    timerParams.period = 3333;  /*  0.003s */
    timerParams.periodType = TimerP_PeriodType_MICROSECS;
    timerParams.startMode = TimerP_StartMode_USER;
    timerParams.runMode = TimerP_RunMode_CONTINUOUS;  

    timerHandle = TimerP_create(TimerP_ANY, (TimerP_Fxn)&timerFxn, &timerParams);
#if 0
    if (timerHandle == NULL) {
       appLogPrintf("ERR: TimerP_create failed\n");
    }
    else
        (void)TimerP_start(timerHandle); /* start the timer */
#endif
    GPIO_write(4, 1);

    appLogPrintf(
            " appGpioInit   Done!!!\n");
    return 0;
}

  • Hi,

    Thanks for this information, I will look into this and get back to you tomorrow.

    Regards,

    Neehar

  • Hi TI,

         Please help me check, thank you very much.

  • Hi Daohong,

    Did you complete the pinmux configuration for GPIO0_32? You can refer to the TI SysConfig tool to help with this.

    Regards,

    Neehar

  • Hi,  Neehar,

          I do complete the pinmux configuration for GPIO0_32:

        

        pinmuxPerCfg_t gGpio0PinCfg[] =
        { 
             /* MyGPIO0 -> GPIO0_14 -> AB28 */
            {
                PIN_MCASP0_AXR4, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },       
            {PINMUX_END}
        };
        #define BOARD_SOC_DOMAIN_MAIN    (0)
        pinmuxModuleCfg_t gGpioPinCfg[] =
        {
            {0, TRUE, gGpio0PinCfg},
            {PINMUX_END}
        };
        pinmuxBoardCfg_t gJ721S2_MainPinmuxData[] =
        {
            {0, gGpioPinCfg},
            {PINMUX_END}
        };
        Board_pinmuxUpdate(gJ721S2_MainPinmuxData, BOARD_SOC_DOMAIN_MAIN);
    
        appInitGpio();
        
        

  • Dear Neehar ,   

         Please help me check, thank you very much.

  • Hi Daohong,

    This pinmux configuration looks correct.

    What do you define PIN_MCASP0_AXR4 as?

    Do you have any problems with any of the other GPIOs?

    Regards,

    Neehar

  • Dear   
    What do you define PIN_MCASP0_AXR4 as?
     ----> 
    pdk_j721s2/packages/ti/board/src/j721s2_evm/J721S2_pinmux.h
    enum pinMainOffsets
    {
     ... ...
     PIN_MCASP0_AXR4         = 0x080,
    Do you have any problems with any of the other GPIOs?
    ---> No
  • Dear   

         Please help me check, thank you very much.

  • Hi Daohong,

    Is there a reason you use port 1 for the get and set GPIO config?

    Additionally, refer to this for any clarifications: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1126741/faq-tda4vm-using-pdk-gpio-driver.

    Regards,

    Neehar

  • Hi Daohong,

    Following up, are there any updates on the issue?

    Regards,
    Neehar

  • Hi Neehar,

    Is there a reason you use port 1 for the get and set GPIO config?

    ->

    the index here is 1, so the GPIO is wkup_GPIO0

    the code path:vision_apps/utils/sensors/src/app_sensors.c

    Please help me check,thank you very much.

    Regards,

    Daohong

  • Hi Neehar,

    GPIO_PinConfig gpioPinConfigs[] =
    {
        GPIO_DEVICE_CONFIG(0, 12)  | GPIO_CFG_INPUT,  //FRONT_CAMERA_LINK_LOCK_GPIO
        GPIO_DEVICE_CONFIG(0, 29)  | GPIO_CFG_INPUT,  //FRONT_CAMERA_MAX_PMIC_INT_PIN
        GPIO_DEVICE_CONFIG(0, 39)  | GPIO_CFG_INPUT,  //SURROND_CAMERA_LINK_LOCK_GPIO
        GPIO_DEVICE_CONFIG(0, 14)  | GPIO_CFG_INPUT,  //SURROND_CAMERA_MAX_PMIC_INT_PIN
        GPIO_DEVICE_CONFIG(0, 32)  | GPIO_CFG_OUTPUT,  
        GPIO_DEVICE_CONFIG(0, 58)  | GPIO_CFG_OUTPUT,  
        GPIO_DEVICE_CONFIG(1, 6)   | GPIO_CFG_OUT_HIGH ,  //FCAM_96716_PWDN
        GPIO_DEVICE_CONFIG(1, 20)  | GPIO_CFG_OUT_HIGH ,  //SCAM_96717A_PWDNB
        GPIO_DEVICE_CONFIG(1, 26)  | GPIO_CFG_OUT_HIGH ,  //MAX20087_EN
        GPIO_DEVICE_CONFIG(1, 32)  | GPIO_CFG_OUT_HIGH ,  //FCAM_96717_PWDNB
        GPIO_DEVICE_CONFIG(1, 30)  | GPIO_CFG_OUT_HIGH ,  //ADAS_VDD_1V2_EN
        GPIO_DEVICE_CONFIG(1, 33)  | GPIO_CFG_OUT_HIGH ,  //MAX20089_EN
        GPIO_DEVICE_CONFIG(1, 35)  | GPIO_CFG_OUT_HIGH ,  //SCAM_96712_PWDN
        GPIO_DEVICE_CONFIG(1, 53)  | GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_OUT_HIGH ,
        GPIO_DEVICE_CONFIG(1, 57)  | GPIO_CFG_IN_INT_BOTH_EDGES| GPIO_CFG_OUT_HIGH ,
    };
    
    /* GPIO Driver call back functions */
    GPIO_CallbackFxn gpioCallbackFunctions[] =
    {
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
    };
    GPIO_v0_Config GPIO_v0_config =
    {
        gpioPinConfigs,
        gpioCallbackFunctions,
        sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
        sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
        0x8U
    };
    
    
    /* ========================================================================== */
    /*                         Structure Declarations                             */
    /* ========================================================================== */
    
    static int32_t appSetupI2CInst(uint8_t i2cInst);
    static int32_t appCloseI2CInst(void);
    static int32_t appOv2775Config(AppSensorCmdParams *prms);
    static int32_t appImx390Config(AppSensorCmdParams *prms);
    
    int32_t appRemoteServiceSensorHandler(char *service_name, uint32_t cmd,
        void *prm, uint32_t prm_size, uint32_t flags);
    
    /* ========================================================================== */
    /*                          Function Declarations                             */
    /* ========================================================================== */
    
    static void appInitGpio(void);
    
    /* ========================================================================== */
    /*                            Global Variables                                */
    /* ========================================================================== */
    
    static I2C_Handle gI2cHandle = NULL;
    
    
    /* ========================================================================== */
    /*                  Internal/Private Function Declarations                    */
    /* ========================================================================== */
    
    void appInitGpio(void)
    {
        GPIO_v0_HwAttrs gpio_cfg;
        GPIO_socGetInitCfg(1, &gpio_cfg);
        gpio_cfg.baseAddr = CSL_WKUP_GPIO0_BASE;
    
        gpio_cfg.intCfg[53].eventId = 0;
        gpio_cfg.intCfg[53].intcMuxNum = INVALID_INTC_MUX_NUM;
        gpio_cfg.intCfg[53].intcMuxInEvent = 0;
        gpio_cfg.intCfg[53].intcMuxOutEvent = 0;
    
        gpio_cfg.intCfg[57].eventId = 0;
        gpio_cfg.intCfg[57].intcMuxNum = INVALID_INTC_MUX_NUM;
        gpio_cfg.intCfg[57].intcMuxInEvent = 0;
        gpio_cfg.intCfg[57].intcMuxOutEvent = 0;
        
        GPIO_socSetInitCfg(1, &gpio_cfg);
    
        GPIO_init();
        GPIO_disableInt(13);
        GPIO_disableInt(14);
    }
    
    /* ========================================================================== */
    /*                          Function Definitions                              */
    /* ========================================================================== */
    static TimerP_Params   timerParams;
    static TimerP_Handle  timerHandle = NULL;
    static uint8_t timer_count = 0;
    static void timerFxn(uintptr_t arg)
    {
        if(timer_count == 0){
            GPIO_write(4, 0);
            GPIO_write(5, 0);
            timer_count++;
        }
        else if(timer_count == 9)
        {
              GPIO_write(4, 1);
              GPIO_write(5, 1);
              timer_count = 0;
        }else
           timer_count++;
    }
    
    int32_t appGpioInit(void)
    {
        pinmuxPerCfg_t gGpio0PinCfg[] =
        { 
            /* MyGPIO0 -> GPIO0_12 -> T26 */
            {
                PIN_MCAN12_RX, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },
    
            /* MyGPIO0 -> GPIO0_29 -> R28 */        
            {
                PIN_MCAN2_TX, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },  
    
            /* MyGPIO0 -> GPIO0_39 -> T24 */
            {
                PIN_MCASP0_AXR11, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },
    
             /* MyGPIO0 -> GPIO0_14 -> AB28 */
            {
                PIN_MCASP0_ACLKX, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },
            
            {
                PIN_MCASP0_AXR4, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },
    
            /* MyMMCSD1 -> MMC1_SDCD -> AE25 */
            {
                PIN_TIMER_IO0, PIN_MODE(7) | \
                ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
            },
            {PINMUX_END}
        };
        #define BOARD_SOC_DOMAIN_MAIN    (0)
        pinmuxModuleCfg_t gGpioPinCfg[] =
        {
            {0, TRUE, gGpio0PinCfg},
            {PINMUX_END}
        };
        pinmuxBoardCfg_t gJ721S2_MainPinmuxData[] =
        {
            {0, gGpioPinCfg},
            {PINMUX_END}
        };
        Board_pinmuxUpdate(gJ721S2_MainPinmuxData, BOARD_SOC_DOMAIN_MAIN);
    
        appInitGpio();
    
       /* Initialize timer parameters */
        TimerP_Params_init(&timerParams);
    
        /* Configure periodic timer for 0.00333 sec*/
        timerParams.period = 3333;  /*  0.00333 */
        timerParams.periodType = TimerP_PeriodType_MICROSECS;
        timerParams.startMode = TimerP_StartMode_USER;
        timerParams.runMode = TimerP_RunMode_CONTINUOUS;  
    
        timerHandle = TimerP_create(TimerP_ANY, (TimerP_Fxn)&timerFxn, &timerParams);
    
        if (timerHandle == NULL) {
           appLogPrintf("ERR: TimerP_create failed\n");
        }
        else
            (void)TimerP_start(timerHandle); /* start the timer */
    
        GPIO_write(4, 1);    
        GPIO_write(5, 1); 
    
        //GPIO_write(0, GPIO_PIN_HIGH);
        appLogPrintf(
                " appGpioInit   Done!!!\n");
        return 0;
    }
    
    GPIO0_32 can't output high level

  • Hi Neehar,

    k3conf read 0x11c080, value is 0x50000.

    Please help me check,thank you very much.

  • Hi Daohong,

    I will get back to you tomorrow. Thank you for your patience.

    Regards,

    Neehar

  • Hi Daohong,

    Was this resolved?

    Regards,

    Neehar