Other Parts Discussed in Thread: SYSBIOS, TM4C1294NCPDT
Tool/software: Code Composer Studio
I started bringing up my board using the simple task project, which runs fine. I'm now trying to start blinking an LED by cutting and pasting code from the usbserialdevice_DK_TM4C129X_TI example. When linked the GPIO_init symbol is undefined. I've looked through the USB code but cannot find the #include needed. Code and linker data:
//---------------------------------------------------------------------------------------------------------------- // main.cc // // MAIN MAN ! Where all the Magic Starts. // // Copyright (c) 2019 D.B. Associates. //---------------------------------------------------------------------------------------------------------------- #include <stdint.h> #include <stdbool.h> #include "tm4c1290ncpdt.h" #include <xdc/std.h> #include <xdc/runtime/Error.h> #include <xdc/runtime/System.h> #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> #include <ti/drivers/GPIO.h> #include <ti/drivers/gpio/GPIOTiva.h> #include <driverlib/sysctl.h> #include <driverlib/gpio.h> /* * ======== taskFxn ======== */ Void taskFxn(UArg a0, UArg a1) { System_printf("enter taskFxn()\n"); Task_sleep(10); System_printf("exit taskFxn()\n"); System_flush(); /* force SysMin output to console */ } //--------------------- // GENERAL CPU INIT | //---------------------------------------------------------------------------------------------------------------- void InitGeneral(void) { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ); } //---------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------- /* * Array of Pin configurations * NOTE: The order of the pin configurations must coincide with what was * defined in DK_TM4C129X.h * NOTE: Pins not used for interrupts should be placed at the end of the * array. Callback entries can be omitted from callbacks array to * reduce memory usage. */ GPIO_PinConfig gpioPinConfigs[] = { /* Input pins */ /* DK_TM4C129X_BUTTON_SELECT */ // GPIOTiva_PP_1 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING, /* DK_TM4C129X_BUTTON_UP */ // GPIOTiva_PN_3 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING, /* DK_TM4C129X_BUTTON_DOWN */ // GPIOTiva_PE_5 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING, // Output pins // LED D8 GPIOTiva_PA_4 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW, // LED D9 GPIOTiva_PA_5 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW, }; /* * Array of callback function pointers * NOTE: The order of the pin configurations must coincide with what was * defined in DK_TM4C129X.h * NOTE: Pins not used for interrupts can be omitted from callbacks array to * reduce memory usage (if placed at end of gpioPinConfigs array). */ GPIO_CallbackFxn gpioCallbackFunctions[] = { NULL, /* DK_TM4C129X_BUTTON_SELECT */ NULL, /* DK_TM4C129X_BUTTON_UP */ NULL /* DK_TM4C129X_BUTTON_DOWN */ }; /* The device-specific GPIO_config structure */ const GPIOTiva_Config GPIOTiva_config = { .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs, .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions, .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig), .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn), .intPriority = (~0) }; //---------------------------------------------------------------------------------------------------------------- //--------- // MAIN | //---------------------------------------------------------------------------------------------------------------- Int main() { Task_Handle task; Error_Block eb; InitGeneral(); GPIO_init(); // InitGPIO(); System_printf("enter main()\n"); Error_init(&eb); task = Task_create(taskFxn, NULL, &eb); if (task == NULL) { System_printf("Task_create() failed!\n"); BIOS_exit(0); } BIOS_start(); /* does not return */ return(0); } //----------------------------------------------------------------------------------------------------------------
Thanks.