Other Parts Discussed in Thread: SYSBIOS
I'm working with a custom am335x board and am trying to add a hardware interrupt for an external gpio discrete. I followed the example of the LED blink code and add the following to my GPIO_bbbAM335x_board.c bsp file:
#define GPIO_LAUNCHZ_PORT 2 #define GPIO_LAUNCHZ_PIN 5 GPIO_PinConfig gpioPinConfigs[] = { GPIO_DEVICE_CONFIG((GPIO_LAUNCHZ_PORT + 1), GPIO_LAUNCHZ_PIN) | GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT, }; GPIO_CallbackFxn gpioCallbackFunctions[] = { NULL }; GPIO_v1_Config GPIO_v1_config = { gpioPinConfigs, gpioCallbackFunctions, sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig), sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn), 0x1U, };
In my project source code I later call the following with trigger_signal_stat_change_ISR as my ISR callback function:
GPIO_setCallback(GPIO_LAUNCHZ, trigger_signal_state_change_ISR); /* Enable GPIO interrupt on the specific gpio pin */ GPIO_enableInt(GPIO_LAUNCHZ);
My project builds, but upon execution of GPIO_init() execution crashes and I get the following:
[CortxA8] ti.sysbios.family.arm.a8.intcps.Hwi: line 148: E_alreadyDefined: Hwi already defined, intnum: 32
ti.sysbios.family.arm.a8.intcps.Hwi: line 238: E_handleNotFound: Hwi handle not found: 0x8006b184
xdc.runtime.Error.raise: terminating execution
I am using the #include <ti/drv/gpio/GPIO.h> library for all GPIO related software. My software was running fine if I set the discrete before operation and before I added GPIO_CFG_IN_INT_RISING to the device config. I was, of course, unable to toggle the discrete and enter the ISR callback routine as a result.