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.

AM4379: GPIO configuration issue

Part Number: AM4379
Other Parts Discussed in Thread: SYSBIOS

Hi,

We have tried to configure the new GPIO's by following below steps. But the configured GPIO is not controlled. 

1. configured the GPIO in "am43xx_idkevm_pinmux_data.c" file (MLO)
2.  Do the below configurations in "GPIO_evmAM572x_bord.c" & "main.c" files (Application)

File: GPIO_evmAM572x_bord.c
#define MOTOR_0_ENABLE (0x0518) //GPIO4_18

#define MOTOR_1_ENABLE (0x0519) //GPIO4_19

/* GPIO Driver board specific pin configuration structure */
GPIO_PinConfig gpioPinConfigs[] = {
/* Output pin : AM437X_IDK_LD_PIN */
MOTOR_0_ENABLE | GPIO_CFG_OUTPUT,
MOTOR_1_ENABLE | GPIO_CFG_OUTPUT,
AM437X_IDK_GPIO_LD_PIN | GPIO_CFG_OUTPUT

};

/* GPIO Driver call back functions */
GPIO_CallbackFxn gpioCallbackFunctions[] = {
NULL,
NULL,
NULL
};

/* GPIO Driver configuration structure */
GPIO_v1_Config GPIO_v1_config = {
gpioPinConfigs,
gpioCallbackFunctions,
sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
0,
};

-----------------------------------------------------------------------------------------
File:main.c


int main(){

GPIO_init();

GPIO_write(0, GPIO_PIN_VAL_HIGH);
AppDelay(500);
GPIO_write(0, GPIO_PIN_VAL_LOW);
AppDelay(500);

}

-----------------------------------------------------------------------------------------
File:am43xx_idkevm_pinmux_data.c


static pinmuxPerCfg_t gGpio4PinCfg[] =
{
{
/* Motor_0_Enable_GATE -> gpio4[18] -> AD22 */
PIN_CAM1_DATA4, 18, \
( \
PIN_MODE(7) | \
//((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
//(~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
((PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_PULL_UD_DIS & ~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{
/* Motor_1_Enable_GATE -> gpio4[19] -> AE23 */
PIN_CAM1_DATA5, 19, \
( \
PIN_MODE(7) | \
//((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
//(~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
((PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_PULL_UD_DIS & ~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
};

------------------------------------------------------------------
File: idkAM437x.c


/*GPIO*/
if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_GPIO, 0U, 0U);
}
if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_GPIO, 1U, 0U);
}
if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_GPIO, 2U, 0U);
}
if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_GPIO, 3U, 0U);
}
if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_GPIO, 4U, 0U);
}
if(S_PASS == status)
{
status = PRCMModuleEnable(CHIPDB_MOD_ID_GPIO, 5U, 0U);
}

---------------------------------------------------------------------------
File:idkAM437x_pinmux.c


/*GPIO*/
if(S_PASS == status)
{
status = PINMUXModuleConfig(CHIPDB_MOD_ID_GPIO, 0U, NULL);
}
if(S_PASS == status)
{
status = PINMUXModuleConfig(CHIPDB_MOD_ID_GPIO, 2U, NULL);
}
if(S_PASS == status)
{
status = PINMUXModuleConfig(CHIPDB_MOD_ID_GPIO, 3U, NULL);
}
if(S_PASS == status)
{
status = PINMUXModuleConfig(CHIPDB_MOD_ID_GPIO, 4U, NULL);
}
if(S_PASS == status)
{
status = PINMUXModuleConfig(CHIPDB_MOD_ID_GPIO, 5U, NULL);
}


But the configured GPIO is not set High. 


RTOS SDK: pdk_am437x_1_0_15
SYSBIOS: bios_6_75_02_00

Kindly check & feedback us.

Regards,
Suresh 

  • Hi Suresh,

    SURESH p said:
    Do the below configurations in "GPIO_evmAM572x_bord.c"

    You are using AM437x IDK board, then you need to modify AM437x IDK related files, not AM572x EVM.

    I would suggest you to dump and check GPIO4 pinmux and configuration registers, check if these have the correct value.

    PRCM_CM_PER_GPIO4_CLKCTRL

    CTRL_CONF_CAM1_DATA4

    GPIO4.GPIO_CTRL

    GPIO4.GPIO_OE

    GPIO4.GPIO_DATAOUT


    Regards,
    Pavel

  • Hi Pavel,

    Sorry for the inconvenience. It was a typo mistake. Actually we made the configuration in "SPI_idkAM437x_board.c" file.

    We found some strange behaviors, In same GPIO bank(GPIO4) one of the PIN(GPIO4_16) working as expected but another  PIN(GPIO4_18) not working. We have attached the following files & registry dump for your reference.

    Used Project: ti/pdk_am437x_1_0_15/packages/MyExampleProjects/MCSPI_BasicExample_idkAM437x_armExampleProject

    1. Source Code snippet
    File: main_mcspi_example.c

    File: SPI_idkAM437x_board.c





    2. Register Dump files
       GPIO4_16_Working.txt

    GPIO4_18_Not_Working.txt



    We have ordered the AM437x IDK to check this issue. But it takes a week to arrive. So kindly do us a favor to check our attached SD CARD boot binaries in your setup & share us the log files. Since we are in a very critical situation. Kindly support us. 

    SD CARD BOOT FIles:  SD_CARD_BOOT_BINARY_AM4379.zip


    Regards,
    Suresh
     

  • Suresh,

    I see in your log files:

    "CONTROL_MODULE_CTRL_CONF_CAM1_DATA2 0x0000000B 0x13060007"

    "CONTROL_MODULE_CTRL_CONF_CAM1_DATA4 0x0000000B 0x13070000"

    This means pin AD22 cam1_data4.gpio4_18 is NOT configured properly.

    In am43xx_idkevm_pinmux_data.c file, we have cam1_data2.gpio4_16 setup, but not cam1_data4.gpio4_18 setup. I would suggest you to update the default am43xx_idkevm_pinmux_data.c file like below, and that should be the only update regarding cam1_data4.gpio4_18 pin.

    static pinmuxPerCfg_t gGpio4PinCfg[] =
    {

    .......

    {
            /* My GPIO 4 -> gpio4[16] -> AD21 */
            PIN_CAM1_DATA2, 16, \
            ( \
                PIN_MODE(7) | \
                ((PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
                (~PIN_PULL_UD_DIS & ~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
            ) \
        },

    + {
       +     /* My GPIO 4 -> gpio4[18] -> AD22 */
       +     PIN_CAM1_DATA4, 18, \
       +    ( \
       +         PIN_MODE(7) | \
       +         ((PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
       +         (~PIN_PULL_UD_DIS & ~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
       +    ) \
      +  },

    ....

    }

    Regards,
    Pavel

  • Hi Pavel,

    We have configured the Pinmux as per your suggestions, but still, the register's configurations are not changed. Here we have attached the used source files, binary files, registry dump files & log files for your reference.


    Files: RAM_LESS_RTOS_AM4379_Tested_Files.zip

    Can you test our SD CARD boot binaries, Is there any difference between our custom AM437x SOM board log vs your AM437x EVK/IDK board log file? 


    Could you check & feedback us.



    Regards,
    Suresh

  • Suresh,

    Your am43xx_idkevm_pinmux_data.c update looks correct. Please make sure you are building new MLO file based on your update. Refer to below user guide for re-building MLO file:

    Regards,
    Pavel

  • Hi Pavel,

    I have identified the issue, while built the MLO ( bootloader)  the below pin muxing libraries are not generated.

    Linking with library ti.board:./lib/idkAM437x/a9/release/ti.board.aa9fg
    Linking with library ti.drv.uart:./lib/a9/release/ti.drv.uart.aa9fg
    Linking with library ti.drv.i2c:./lib/am437x/a9/release/ti.drv.i2c.aa9fg
    Linking with library ti.drv.gpio:./lib/a9/release/ti.drv.gpio.aa9fg
    Linking with library ti.drv.spi:./lib/am437x/a9/release/ti.drv.spi.aa9fg
    Linking with library ti.osal:./lib/tirtos/a9/release/ti.osal.aa9fg
    Linking with library ti.csl:./lib/am437x/a9/release/ti.csl.aa9fg


    So we compiled the above libraries manually. Correct me if I wrong?. 

    I have doubted the pin muxing is happened in the application, not in MLO am I right?

    MLO Board Init API:

        status = BOARDInit(NULL);

    Application Board Init API:

    boardCfg = BOARD_INIT_PINMUX_CONFIG |
    BOARD_INIT_MODULE_CLOCK |
    BOARD_INIT_UART_STDIO;

    Board_init(boardCfg);


    Regards,
    Suresh.

     

  • Hi Pavel,

    Any updates?

    Regards,
    Suresh.

  • Suresh,

    Sorry for the delay, I needed some time to check this on my side.

    SURESH p said:
    I have doubted the pin muxing is happened in the application, not in MLO am I right?

    Yes, you are correct. When updating am43xx_idkevm_pinmux_data.c file, you need to use the same MLO and new app file.

    Regards,
    Pavel