Home arrow Support arrow Forums

Luminary Micro Forums

<< Start < Prev 1 2 3 4 Next > End >>

LMI Brian

Admin

2008/09/12 04:27

Re:Problem with GPIO and SYSCTL lib files

Just a wild guess based on your error message...in your source file, do you have:

#include "../DriverLib/src/gpio.c"
#include "../DriverLib/src/sysctl.c"

instead of:

#include "../DriverLib/src/gpio.h"
#include "../DriverLib/src/sysctl.h"

In other words, are you including the driver source file instead of the header file?

login or register to reply

print

Gold Boarder

2008/09/12 05:50

Re:Problem with GPIO and SYSCTL lib files

no no I was only using header files not *.c files.

login or register to reply

LMI Brian

Admin

2008/09/12 06:28

Re:Problem with GPIO and SYSCTL lib files

Would it be possible for you to post the source and makefile for your project? I'm afraid that at this point all anyone could do without the source is take wild stabs in the dark, which won't be terribly useful to you.

login or register to reply

cb1

Platinum Boarder

2008/09/12 08:12

Re:Problem with GPIO and SYSCTL lib files

print-

Brian knows best and his advice is solid.

In case you don't want to lose this weekend - I suggest that you create the smallest, simplest "blinky" project and use gpio.c to drive your Led. See if this compiles and loads error free. Again - create the simplest program possible - using your new library and settings.

Your `SysCtlFlashSizeGet' error seems to indicate multiple definitions of this function. You should be able to search your various source files and determine where your "excess" definitions are - and eliminate the incorrect (or duplicate) ones.

login or register to reply

print

Gold Boarder

2008/09/13 00:37

Re:Problem with GPIO and SYSCTL lib files

Hi cb1,

Actually whenever I used gpio or sysctl in other programms it works fine with no error but this time it gives me problem to build the project. I have checked several small programms and these files worked fine.

Now I am trying to find the excess definition, point out by the sysctl functions, but not yet able to rectify it.

login or register to reply

print

Gold Boarder

2008/09/13 01:05

Re:Problem with GPIO and SYSCTL lib files

Hi Brian,

Make file of my code

Code:

 ################################################################################ # Automatically-generated file. Do not edit! ################################################################################ -include ../makefile.init RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk -include src/subdir.mk -include Driverlib/utils/subdir.mk -include Driverlib/src/subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) -include $(C_DEPS) endif endif -include ../makefile.defs # Add inputs and outputs from these tool invocations to the build variables  # All Target allMakeTime.axf # Tool invocations MakeTime.axf: $(OBJS) $(USER_OBJS)     @echo 'Building target: $@'     @echo 'Invoking: MCU Linker'     arm-none-eabi-gcc -nostdlib -Xlinker --gc-sections -mcpu=cortex-m3 -mthumb -../LM3S6911.ld -o"MakeTime.axf" $(OBJS) $(USER_OBJS) $(LIBS)     @echo 'Finished building target: $@'     @echo ' '     $(MAKE) --no-print-directory post-build # Other Targets clean:     -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLESMakeTime.axf     -@echo ' ' post-build:     -@echo 'Performing post-build steps'     -arm-none-eabi-size MakeTime.axf# arm-none-eabi-objdump -h -S MakeTime.axf >MakeTime.lss     -@echo ' ' .PHONYall clean dependents .SECONDARYpost-build -include ../makefile.targets



source file:

Code:

 #include "hw_ints.h" #include "hw_memmap.h" #include "hw_types.h" #include "hw_gpio.h" #include "hw_sysctl.h" #include "i2c.h" #include "debug.h" #include "sysctl.h" #include "systick.h" #include "flash.h" #include "gpio.h" #include "interrupt.h" #include "../Driverlib/src/LCD_LM.h" //#include "../Driverlib/src/LCD_LM.c" //#include "../Driverlib/src/RTC_LM.h" //#include "../Driverlib/src/RTC_LM.c" //#include "../Driverlib/src/RF_LM.h" //#include "../Driverlib/src/RF_LM.c" //#include "../Driverlib/src/AT24c1024B_LM.h" //#include "../Driverlib/src/AT24c1024B_LM.c" #include "timer.h" //#include "diag.h" //#include "ustdlib.h" #include "uart.h" #include "time_LM.h" #include "limits.h" #include "loc_time.h" /* #define year     2008 #define      #define year 2008 */ /* The code assumes that unsigned long can be converted to time_t.  * A time_t should not be wider than unsigned long, since this would mean  * that the check for overflow at the end could fail.  */ time_t mktime(register struct tm *timep) {     register long dayyear;     register int tm_year;     int ydaymonth;     register unsigned long seconds;     int overflow; //    unsigned dst;     timep->tm_min += timep->tm_sec 60;     timep->tm_sec %= 60;     if (timep->tm_sec 0)      {         timep->tm_sec += 60;         timep->tm_min--;     }     timep->tm_hour += timep->tm_min 60;     timep->tm_min timep->tm_min 60;     if (timep->tm_min 0)      {         timep->tm_min += 60;         timep->tm_hour--;     }     day timep->tm_hour 24;     timep->tm_hourtimep->tm_hour 24;     if (timep->tm_hour 0)      {         timep->tm_hour += 24;         day--;     }     timep->tm_year += timep->tm_mon 12;     timep->tm_mon %= 12;     if (timep->tm_mon 0)      {         timep->tm_mon += 12;         timep->tm_year--;     }     day += (timep->tm_mday 1);     while (day 0)      {         if(--timep->tm_mon 0)          {             timep->tm_year--;             timep->tm_mon 11;         }         day += _ytab[LEAPYEAR(YEAR0 timep->tm_year)][timep->tm_mon];     }     while (day >= _ytab[LEAPYEAR(YEAR0 timep->tm_year)][timep->tm_mon])      {         day -= _ytab[LEAPYEAR(YEAR0 timep->tm_year)][timep->tm_mon];         if (++(timep->tm_mon) == 12)          {             timep->tm_mon 0;             timep->tm_year++;         }     }     timep->tm_mday day 1; //    _tzset();            /* set timezone and dst info  */     year EPOCH_YR;     if (timep->tm_year year YEAR0)          return (time_t)-1;          seconds 0;     day 0;            /* means days since day 0 now */     overflow 0;     /* Assume that when day becomes negative, there will certainly      * be overflow on seconds.      * The check for overflow needs not to be done for leapyears      * divisible by 400.      * The code only works when year (1970) is not a leapyear.      */ #if    EPOCH_YR != 1970 #error    EPOCH_YR != 1970 #endif     tm_year timep->tm_year YEAR0;     if (LONG_MAX 365 tm_year year)          overflow++;     day = (tm_year year) * 365;     if (LONG_MAX day < (tm_year year) / 1)          overflow++;     day += (tm_year year) / 4         + ((tm_year 4) && tm_year year 4);     day -= (tm_year year) / 100         + ((tm_year 100) && tm_year 100 year 100);     day += (tm_year year) / 400         + ((tm_year 400) && tm_year 400 year 400);     yday month 0;     while (month timep->tm_mon)      {         yday += _ytab[LEAPYEAR(tm_year)][month];         month++;     }     yday += (timep->tm_mday 1);     if (day yday 0)          overflow++;     day += yday;     timep->tm_yday yday;     timep->tm_wday = (day 4) % 7;        /* day 0 was thursday (4) */     seconds = ((timep->tm_hour 60L) + timep->tm_min) * 60L timep->tm_sec;     if ((TIME_MAX seconds) / SECS_DAY day)          overflow++;     seconds += day SECS_DAY;          return (time_t)seconds; } /* We must be careful, since an int can't represent all the seconds in a day.  * Hence the adjustment of minutes when adding timezone and dst information.  * This assumes that both must be expressable in multiples of a minute.  * Furthermore, it is assumed that both fit into an integer when expressed as  * minutes (this is about 22 days, so this should not cause any problems).   */ struct tm * localtime(const time_t *timer) {     struct tm *timep; //    unsigned dst;     timep gmtime(timer);            /* tm->tm_isdst == 0 */     timep->tm_min -= _timezone 60;     timep->tm_sec -= _timezone 60;     mktime(timep);     return timep; } int main(void) {     static unsigned long ulTtim;     unsigned char ucData[] = {"Total Time"};     unsigned int pos 2i; // // Set the clocking to run directly from the crystal. //         SysCtlClockSet(SYSCTL_SYSDIV_1 SYSCTL_USE_OSC SYSCTL_OSC_MAIN |                        SYSCTL_XTAL_8MHZ);     LCD_Init(); //     // Calculate the total time in sec from the given date. //         ulTtim localtime2008); //     // Display The Message and the Total Time in sec. //         for(i=0;i>=9;i++)     {         dis2lcd(ucData[i], pos1);              send2lcd(ulTtim2pos);         pos++;     }          }

login or register to reply
<< Start < Prev 1 2 3 4 Next > End >>