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.
I have been working on this for quite a while. It seems that the driverlib for the TM4C is incompatable with the GNU compiler. There are no examples of how to do this and no documentation on using GCC in a from-scratch project.
I copied the code from blinky.c to start my own project and added the TivaWare library to the include path but I am getting the following compile errors:
Description Resource Path Location Type
gmake: *** [JConsole9.out] Error 1 JConsole9 C/C++ Problem
gmake: Target 'all' not remade because of errors. JConsole9 C/C++ Problem
recipe for target 'JConsole9.out' failed makefile /JConsole9/Debug line 145 C/C++ Problem
undefined reference to `GPIOPinTypeGPIOOutput' main.c /JConsole9 line 37 C/C++ Problem
undefined reference to `GPIOPinWrite' main.c /JConsole9 line 47 C/C++ Problem
undefined reference to `GPIOPinWrite' main.c /JConsole9 line 59 C/C++ Problem
undefined reference to `SysCtlPeripheralEnable' main.c /JConsole9 line 24 C/C++ Problem
undefined reference to `SysCtlPeripheralReady' main.c /JConsole9 line 29 C/C++ Problem
Here is my code:
/* * main.c */ #include <stdint.h> #include <stdbool.h> #include "inc/hw_memmap.h" #include "driverlib/gpio.h" #include "driverlib/sysctl.h" //***************************************************************************** // // Blink the on-board LED. // //***************************************************************************** int main(void) { volatile uint32_t ui32Loop; // // Enable the GPIO port that is used for the on-board LED. // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // // Check if the peripheral access is enabled. // while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF)) { } // // Enable the GPIO pin for the LED (PF3). Set the direction as output, and // enable the GPIO pin for digital function. // GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3); // // Loop forever. // while(1) { // // Turn on the LED. // GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, GPIO_PIN_3); // // Delay for a bit. // for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++) { } // // Turn off the LED. // GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0x0); // // Delay for a bit. // for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++) { } } }
I really need to use the FULL code space for this development kit for my project to work out. 32Kb just won't cut it and I am not in a position to spend $2000 for full CCS just for a personal project/exploration.
In Build -> GNU Compiler -> Directories I added Tivaware to the search path. The compiler seems to have found the TivaWare libraries but it can't seem to resolve the functions. Why isn't this integrated into the IDE? It seems like such a hack to have to download TivaWare library for your particular MCU.
Using CCS Version: 6.1.3.00033 and GNU Version 4.9.3 as my compiler.
Any help would be great
Thanks,
Jonathan L Clark
Yeah, I used the file chooser to browse to the file. Unless there is a serious bug with the Windows file browser dialog I did select an actual file on my hard drive.
With the GCC linker the -l option doesn't accept the absolute pathname of a library file, but the name of library without the "lib" prefix or the ".a" file extension. What this means is that the Library search path (-L) must be set to the directory which contains the GCC driverlib, and the libraries (-l) set to "driver".Jonathan Clark said:cannot find -lC:/ti/TivaWare_C_Series-2.1.3.156/driverlib/gcc/libdriver.a
See https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/534098/1944850#1944844 for an example of how to set the CCS Project Properties to allow the GCC linker to use the driverlib from TivaWare.