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.

Problem with the GPIO interrupt on TMDSICE3359

Other Parts Discussed in Thread: AM3359, SYSBIOS

I am trying to configure GPIO3-19pin as a external input interrupt on AM3359 ICE rev2.1.

I configured the pin(GPIO3-19) as input, interrupt with rise edge. I succeeded to read the input status Hi and Lo of this pin when I input the voltage ON/OFF. 

However interrupt action never occurred. I couldn't understand which is appropriate to configure interrupt by sys/bios or pin configure by standard API.

How can I configure correctly?

The excerption of my code is following.

My Condition is:

  CCS:Ver5.5

  SDK:Am335x_sysbios_ind_sdk_1.1.0.10

  SYS/BIOS 6.41.4.54

**********************************************

int main(void)
{
  GPIODirModeSet(SOC_GPIO_3_REGS, 19,GPIO_DIR_INPUT); 
  GPIOIntTypeSet(SOC_GPIO_3_REGS, 19,GPIO_INT_TYPE_RISE_EDGE);

  /*****Create a HWI **************************************/
  Hwi_Params hwiparams_ff;
  UInt intNum;
  Hwi_FuncPtr hwiFuncPointer = NULL;
  Hwi_Handle tempHwiHandler_ff;

  intNum = 62;
  hwiFuncPointer = (Hwi_FuncPtr)Hwi_FFint;
  Hwi_Params_init(&hwiparams_ff);
  hwiparams_ff.arg = 1;
  tempHwiHandler_ff = Hwi_create(intNum, hwiFuncPointer, &hwiparams_ff, NULL);

  if (tempHwiHandler_ff == NULL)
  {
    System_printf("Hwi create failed");
  }
  Hwi_enableInterrupt(intNum);
}

/*****HWI****************************************/

static void Hwi_FFint(void)
{
  LEDGPIOSetVal(0,16 ,1);   //LED1 green ON
}

  • Hi,

    Where is the pinmux for GPIO3_19?
  • Hi Biser

    I'm sorry that I can't understand what you said.

    Is the "pinmux" you said mean the configuration of the control register?

    I configured the control register as follows but it was not improved.

    HWREG(SOC_CONTROL_REGS + CONTROL_CONF_MCASP0_FSR) = (0x3f);
    // Bit6- SLEWCTRL 0(Fast)
    // Bit5- RXACTIVE Receiver Enabled 1(input)
    // Bit4- PULLTYPESEL Pullup selected 1(pullup)
    // Bit3- PULLUDEN Pullup pulldown disabled 1
    // Bit2-0-MUXMODE 111=7

  • Ina,

    Could you take a look at the Sitara IND SDK at http://downloads.ti.com/sitara_indus/esd/SYSBIOSSDK-IND-SITARA/latest/index_FDS.html? There is a GPIO blink example where apio_app.c shows how to configure the GPIO in GpioAppPinConfig(). I believe it covers the interrupt setup of the GPIO pin as well. 

    static void GpioAppPinConfig(uint32_t baseAddr,
                                 uint32_t pinNum,
                                 gpioAppPinCfg_t *pGpioPinConfig)
    {
        /* Configure Pin as an Input/Output Pin. */
        GPIODirModeSet(baseAddr, pinNum, pGpioPinConfig->dir);
    
        /* Enable Debouncing feature for the GPIO Pin. */
        GPIODebounceFuncEnable(baseAddr, pinNum, pGpioPinConfig->debounceEnable);
    
        if(TRUE == pGpioPinConfig->debounceEnable)
        {
            /*
             * Configure the Debouncing Time for all the input pins of
             * the selected GPIO instance.
             */
            GPIODebounceTimeConfig(baseAddr, pGpioPinConfig->debounceTime);
        }
    
        if(FALSE == pGpioPinConfig->intrEnable)
        {
            /* Enable interrupt for the specified GPIO Pin. */
            GPIOPinIntDisable(baseAddr, pGpioPinConfig->intrLine, pinNum);
        }
        else
        {
            /*
             * Configure interrupt generation on detection of a logic HIGH or
             * LOW levels or a rising or a falling edge.
             */
            GPIOIntTypeSet(baseAddr, pinNum, pGpioPinConfig->intrType);
    
            /* Enable interrupt for the specified GPIO Pin. */
            GPIOPinIntEnable(baseAddr, pGpioPinConfig->intrLine, pinNum);
        }
    
        if(FALSE == pGpioPinConfig->wakeEnable)
        {
            /* Enable wakeup generation for GPIO Module */
            GPIOWakeupGlobalDisable(baseAddr);
    
            /* Configure input GPIO Pin to wakeup */
            GPIOPinIntWakeUpDisable(baseAddr, pGpioPinConfig->intrLine, pinNum);
        }
        else
        {
            /* Configure input GPIO Pin to wakeup */
            GPIOPinIntWakeUpEnable(baseAddr, pGpioPinConfig->intrLine, pinNum);
        }
    }
    

    Hope this helps. Thanks.

    Lali

  • Hi Lali

    Thank you for your advice.
    I reconsidered my GPIO pin configuration as following. But the interrupt was not occurred.
    (the GPIOPinRead() in polling of other task can be done)
    I resistered the interrupt function of Hwi_FFint() by using "IntRegister(SYS_INT_GPIOINT3A, Hwi_FFint)". Is this correct?

    Should I use the Hwi function of SYS/BIOS?
    In that case, could you tell me how to configure the GPIO pin interrupt by SYS/BIOS?

    I am troubled with this matter very much. I hope you can make concrete advice to me.

    /**The excerption of my code*******/
    int main(void)
    {
    GPIODirModeSet(SOC_GPIO_3_REGS, 19, GPIO_DIR_INPUT);

    GPIOIntTypeSet(SOC_GPIO_3_REGS, 19, GPIO_INT_TYPE_RISE_EDGE);
    IntPrioritySet(SYS_INT_GPIOINT3A, 0, AINTC_HOSTINT_ROUTE_IRQ);
    GPIOPinIntEnable(SOC_GPIO_3_REGS,SYS_INT_GPIOINT3A, 19); //interrupt number 62
    GPIOPinIntWakeUpEnable(SOC_GPIO_3_REGS, GPIO_INT_SWAKEUP_LINE_1, 19);

    IntRegister(SYS_INT_GPIOINT3A, Hwi_FFint);
    // IntSystemEnable(SYS_INT_GPIOINT3A);
    IntMasterIRQEnable();

    /***********create main task for lwip**************/
    Task_Handle main_task;
    Task_Params taskParams;
    Task_Params_init(&taskParams);
    taskParams.stackSize = 0x2000;
    taskParams.priority = 2;
    main_task = Task_create (task_lwip, &taskParams, NULL);
    /*************************************************/
    BIOS_start();
    }

    Void task_lwip(UArg arg0, UArg arg1)
    {
    while(1)
    {
    /***GPIO3-19 polling****/
    temp_gpio3_19 = GPIOPinRead(SOC_GPIO_3_REGS,19);
    if(temp_gpio3_19){
    LEDGPIOSetVal(1,30 ,0); // LED red off
    }
    else{
    LEDGPIOSetVal(1,30 ,1); // LED red on
    }
    }
    }

    /*****HWI****************************************/

    static void Hwi_FFint(void)
    {
    LEDGPIOSetVal(0,16 ,1); //LED1 green ON
    }
  • Hello Lali,

    I think I have the same problem as you.

    In fact, I'm trying to enable an interruption on GPIO0_19.

    I have done exactly the same things as you:

    - PinMux Setup

    - GPIO Configuration

    - Interrupt configuration

    But, unfortunately, my interrupt is not generated !

    Did you find a solution ? if yes, can you show me how to do ?

    Thanks a lot to help me in solving this problem

    Laurence