Other Parts Discussed in Thread: SYSCONFIG,
Hello,
I am trying to configure the M4FSS0 MCU on the SK-AM64B board to be a rise and fall interrupt for a switch. I get a build issue saying that the interrupt router number is unidentified. I have attached the build error, the code, and the GPIO configurations for guidance on the issue. I am unsure how to fix this issue as I figured that sysconfig would automatically create the value stored in CSLR_MCU_M4FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_4.
Build error:
**** Build of configuration Debug for project gpio_led_blink_am64x-sk_m4fss0-0_nortos_ti-arm-clang ****
"C:\\ti\\ccs1260\\ccs\\utils\\bin\\gmake" -k -j 24 all -O
Building file: "../main.c"
Invoking: Arm Compiler
"C:/ti/ti_cgt_tiarmclang_3.2.0.LTS/bin/tiarmclang.exe" -c -mcpu=cortex-m4 -mfloat-abi=hard -mlittle-endian -mthumb -I"C:/ti/ti_cgt_tiarmclang_3.2.0.LTS/include/c" -I"C:/ti/mcu_plus_sdk_am64x_09_01_00_41/source" -DSOC_AM64X -D_DEBUG_=1 -g -Wall -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function -MMD -MP -MF"main.d_raw" -MT"main.o" -I"C:/Users/BrycenHillukka/workspace_v12/gpio_led_blink_am64x-sk_m4fss0-0_nortos_ti-arm-clang/Debug/syscfg" -o"main.o" "../main.c"
subdir_rules.mk:46: recipe for target 'main.o' failed
../main.c:77:22: error: use of undeclared identifier 'CSLR_MCU_M4FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_4'
hwiPrms.intNum = USER_SWITCH_INTR_NUM;
^
C:/Users/BrycenHillukka/workspace_v12/gpio_led_blink_am64x-sk_m4fss0-0_nortos_ti-arm-clang/Debug/syscfg/ti_drivers_config.h:69:35: note: expanded from macro 'USER_SWITCH_INTR_NUM'
#define USER_SWITCH_INTR_NUM (CSLR_MCU_M4FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_4)
^
1 error generated.
gmake: *** [main.o] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
Program:
#include <drivers/gpio.h>
#include <stdlib.h>
#include "ti_drivers_config.h"
#include "ti_board_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
uint32_t IN_pinValue;
HwiP_Object gGpioHwiObject;
static void GPIO_pinIsrFxn(void *args)
{
/*
* Handle pin interrupt - This is pulse interrupt. No need to clear status
*/
DebugP_log("Interrupt triggered.\r\n");
}
void gpio_pin_interrupt_init(void)
{
uint32_t gpioIN_BaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(USER_SWITCH_BASE_ADDR);
uint32_t gpioIN_PinNum = USER_SWITCH_PIN;
int32_t retVal;
HwiP_Params hwiPrms;
uint32_t bankNum;
bankNum = GPIO_GET_BANK_INDEX(gpioIN_PinNum);
/* Interrupt setup */
GPIO_setDirMode(gpioIN_BaseAddr, gpioIN_PinNum, GPIO_DIRECTION_INPUT);
GPIO_setTrigType(gpioIN_BaseAddr, gpioIN_PinNum, USER_SWITCH_TRIG_TYPE);
GPIO_bankIntrEnable(gpioIN_BaseAddr, bankNum);
/* Register pin interrupt */
HwiP_Params_init(&hwiPrms);
hwiPrms.intNum = USER_SWITCH_INTR_NUM;
hwiPrms.callback = &GPIO_pinIsrFxn;
hwiPrms.args = (void *) gpioIN_PinNum;
retVal = HwiP_construct(&gGpioHwiObject, &hwiPrms);
DebugP_log("Here");
if(SystemP_SUCCESS != retVal)
{
DebugP_assert(FALSE);
}
DebugP_log("Interrupt initialized.\r\n");
}
void gpio_pin_interrupt_deinit(void)
{
uint32_t gpioIN_BaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(USER_SWITCH_BASE_ADDR);
uint32_t gpioIN_PinNum = USER_SWITCH_PIN;
uint32_t bankNum;
bankNum = GPIO_GET_BANK_INDEX(gpioIN_PinNum);
/* Interrupt disable and clear any pending interrupts */
GPIO_bankIntrDisable(gpioIN_BaseAddr, bankNum);
GPIO_setTrigType(gpioIN_BaseAddr, gpioIN_PinNum, GPIO_TRIG_TYPE_NONE);
GPIO_clearIntrStatus(gpioIN_BaseAddr, gpioIN_PinNum);
/* Unregister interrupt */
HwiP_destruct(&gGpioHwiObject);
DebugP_log("Interrupt deinitialized.\r\n");
}
int main(void)
{
System_init();
Board_init();
Drivers_open();
Board_driversOpen();
gpio_pin_interrupt_init();
while(1) {}
gpio_pin_interrupt_deinit();
Board_driversClose();
Drivers_close();
Board_deinit();
System_deinit();
return 0;
}
Thanks,
Brycen