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.

DK-TM4C129X: TI-RTOS TM4C129X GPIO Hwi triggers at start-up even when disabled

Part Number: DK-TM4C129X

Hello,

I am using the TIVA TI-RTOS and DK-TM4C129X board.

I've been having an issue with GPIO falling edge HWI at start-up. I am using GPIOG pin 1 and GPIOG pin 0. both are connected to square wave sources but different frequencies.

I have a square wave present at the pins soon as the board starts but I don't want an interrupt triggered at start up. I unchecked the box "enable at start up" in the config file. And below is my initialize code for the GPIO.

GPIOPinTypeGPIOInput(GPIO_PORTG_BASE, GPIO_PIN_0);
GPIOIntTypeSet(GPIO_PORTG_BASE, GPIO_PIN_0, GPIO_FALLING_EDGE);
GPIOPadConfigSet(GPIO_PORTG_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);

GPIOPinTypeGPIOInput(GPIO_PORTG_BASE, GPIO_PIN_1);
GPIOIntTypeSet(GPIO_PORTG_BASE, GPIO_PIN_1, GPIO_FALLING_EDGE);
GPIOPadConfigSet(GPIO_PORTG_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);

unsigned int status;
status = GPIOIntStatus(GPIO_PORTG_BASE, true);
GPIOIntClear(GPIO_PORTG_BASE, status);

GPIOIntEnable(GPIO_PORTG_BASE, GPIO_INT_PIN_0);
GPIOIntEnable(GPIO_PORTG_BASE, GPIO_PIN_1);
IntDisable(INT_GPIOG);

Checking or unchecking the box to enable at start up doesn't seem to do anything. 

I even tried initializing with

GPIOIntDisable(GPIO_PORTG_BASE, GPIO_INT_PIN_0);
GPIOIntDisable(GPIO_PORTG_BASE, GPIO_PIN_1);
IntDisable(INT_GPIOG);

but interrupt still triggers once at start up. The IntDisbale does have an effect because after the first trigger, the interrupt is disabled. I would have to call IntEnable in order for the interrupt to work again. But still, no matter what I do, the interrupt is triggered at start up. What should I do to prevent it from happening? Any thoughts is appreciated.

Here is my ISR

void app_portg_isr(void)
{
    volatile unsigned int status;

    status = GPIOIntStatus(GPIO_PORTG_BASE, true);
    GPIOIntClear(GPIO_PORTG_BASE, status);

    if(status == GPIO_PIN_0)
    {
       Semaphore_post(run_capture_frame1_task_semaphore);
   
    }//end if(status == GPIO_PIN_0)
    else if(status == GPIO_PIN_1)
    {
       Semaphore_post(run_capture_frame2_task_semaphore); 
    }//end else if(status == GPIO_PIN_1)
}//end void app_portg_isr(void)

Thanks.

AJ

  • AJ_ee said:
    I've been having an issue with GPIO falling edge HWI at start-up.

    What triggers the start-up?

    E.g. are you powering up the board without the debugger connected, starting a debug session in CCS or resetting the program in a debug session?

    On a device power-up the interrupt sources should be disabled until the program explicitly enables them.

    Whereas if the start-up is triggered by the CCS debugger after the program has already been run and enabled the interrupts, the interrupts may remain enabled when the program starts. In the CCS Debug properties there are the Program/Memory Load Options which select when the device is reset.

  • Hi Chester,

    Thank you for the response. I found out what's causing the problem. The interrupts were indeed disabled. I just realized that my semaphore count was set to 2 instead of 0. That's why in the task, it did not block on Semaphore_pend in the beginning. I thought it was the interrupt causing it with the Semaphore_post. It was just the initial count. The GPIO interrupt disable functions okay.

    Regards,

    AJ