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.

CCS/PROCESSOR-SDK-AM335X: GPIO interrupt issue

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Code Composer Studio

Hi.,

I am doing gpio interrupt. it is not entering to ISR function 

i configured switch(external(in board)) as a gpio input, when i pressed switch interrupt register are updating but is not entering to ISR.

i did as below code flow ...please any one help me

int main(void)
{
Board_initCfg boardCfg;


boardCfg = BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;

// Initialize Board
status = Board_init(boardCfg);

// interrupt Initialize
INTCInit(0);
INTCEnableCpuIntr(INTC_ARM_IRQ_MASK);
INTCEnableIntr(interrupt_num);
INTCConfigIntr(interrupt_num, (IntrFuncPtr) gpioIsr, 0);


// GPIO Initialize
GPIO0ModuleClkConfig();
GPIO0Pin30PinMuxSetup();
GPIOModuleEnable(SOC_GPIO_0_REGS);
GPIOModuleReset(SOC_GPIO_0_REGS);
GPIODirModeSet(SOC_GPIO_0_REGS, GPIO_SW_PIN_NUMBER, 1);

// gpio interrupt Initialize
GPIOPinIntWakeUpEnable(SOC_GPIO_0_REGS, GPIO_INT_LINE_1, GPIO_SW_PIN_NUMBER);
GPIOIntTypeSet(SOC_GPIO_0_REGS,GPIO_SW_PIN_NUMBER, GPIO_INT_TYPE_RISE_EDGE);
GPIOPinIntEnable(SOC_GPIO_0_REGS, GPIO_INT_LINE_1, GPIO_SW_PIN_NUMBER);

void gpioIsr()
{

volatile uint32_t gpio_pin_value = 0;
appPrint("\n Interrupt occered\n\r");

/* Read pin*/
gpio_pin_value = GPIOPinRead(SOC_GPIO_0_REGS, GPIO_SW_PIN_NUMBER);

GPIOPinIntClear(SOC_GPIO_0_REGS, GPIO_INT_LINE_1, GPIO_SW_PIN_NUMBER);
appPrint("\n Interrupt is generated \n\r");

}

thanks in advance 

Regards 

chandana

  • Hi Chandana,

    From what I understand, you are using AM335x custom board.

    Do you use AM335x TI PSDK RTOS? If yes, which version?

    Regards,
    Pavel

  • Hi pavel.,

    I am using AM335x starter kit(TMDXEVM3358-SK-LCD CARRIER BOARD)  .

    processor_sdk_rtos_am335x_6_00_00_07 in this baremetal.

    Regards 

    Chandana

  • Chandana,

    Do you use AM335x StarterKit keypad switch? Which exactly - SW1, SW2, SW3 or SW4?

    For using processor_sdk_rtos_am335x_6_00_00_07, you need to be aligned with the GPIO driver user guide:

    You need to use:

    GPIO_CFG_INPUT to set GPIO pin as input

    GPIO_CFG_IN_INT_xxx to setup interrupt for that gpio pin

    GPIO_enableInt() to enable interrupt for that GPIO pin

    GPIO_setCallback() - to setup ISR for that GPIO interrupt event

    For example, you can refer to below files:

    pdk_am335x_1_0_15/packages/ti/drv/gpio/test/led_blink/src/am335x/GPIO_skAM335x_board.c
    pdk_am335x_1_0_15/packages/ti/drv/gpio/test/led_blink/src/main_led_blink.c

    Regards,
    Pavel

  • Hi pavel

    i took code from  starterware folder(ti\pdk_am335x_1_0_15\packages\ti\starterware) in that GPIO_setCallback() function is not there... but i did code to setup ISR for GPIO interrupt event using below functions but its not working 

    INTCInit(0);
    INTCEnableCpuIntr(INTC_ARM_IRQ_MASK);
    INTCEnableIntr(interrupt_num);
    INTCConfigIntr(interrupt_num, (IntrFuncPtr) gpioIsr, 0);

    can you please explain the flow of system interrupt configuration .

    thank you in advance

    Regards 

    chandana 

  • Chandana,

    The support for starterware package that is include in Processor SDK RTOS is limited to bootloaders and board package. We no longer recommend use of this software for new development and have removed any CCS Projects in that package as they are no longer being maintained and migrated to latest CCS versions. Starterware package is obsolete and not meant to be used for new development as it is not under active development outside of boot and board support for the am335x/am437x devices.

    Instead of starterware, I would recommend you to use:

    pdk_am335x_1_0_15/packages/ti/drv/gpio/

    GPIO_setCallback() is located at:

    pdk_am335x_1_0_15/packages/ti/drv/gpio/src/GPIO_drv.c
    pdk_am335x_1_0_15/packages/ti/drv/gpio/GPIO.h

    pdk_am335x_1_0_15/packages/ti/drv/gpio/src/v1/GPIO_v1.c

    Regards,
    Pavel

  • Hi Pavel

    thank you for your replay .

    I will check 

    Regards 

    chandana