[SOLVED] Atmel Studio not compiling properly

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello once more guys,

 

After some time struggling and realising I can't debug with WinAVR (avarice code not compiled sucks so bad for jtag3 or atmel-ice) neither get a reliable executable via IAR, I tried Atmel Studio 7.

My original code have been developed (originally the code is not mine) by a way gcc compiles it pretty good, although WinAVR debug issues. After trying to migrate to AS7, the code is compiling / linking, without any error and debug is a reality.

 

The problem is: when I program ATmega128RFA1 flash and run without debug, my device seems crazy and nothing works. In my particular case a led blinks pretty fast, while it was supposed to do it at about 1 Hz. After compiling again with gcc and reprogram the chip, everything run well again.

It is not clear for me how to migrate, so far I just tried to make it compile, what was supposed to be enough.

 

Is it possible use gcc compiler under Atmel Studio?

I tried to copy all libraries from WinAvr to AS project, could it cause critical problems? Maybe I missed supress any library reference.

 

That's my last try to develop in Windows environment. sad Unfortunatelly my time is time is getting short to finish my job.

This topic has a solution.

Last Edited: Fri. Jan 8, 2016 - 02:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just to straighten out what seems to be some confusion on your part:

 

- The C compiler that is at the heart of WinAVR is avr-gcc.

- The C comipler that comes with Atmel Studio is avr-gcc.

 

Different versions for sure (since the latest (actually, "last") release of WinAVR was in the year 2010, but it is the same compiler - the version coming with Atmel Studio being some 5 years more recent. In general, using a more recent version of the compiler is the best choice. Most things that compiled with WinAVR should compile in Atmel Studio also. There might be the odd deprecated feature, but be specific about it in a post here andd we can help with that.

 

I you program the flash with a piece of code, and then redo that without changing anything else then the results should be the same. The results could vary because of other external circumstances, but given the same code and the same settings the compiler will produce the same code over and over again. Things you possibly might have changed are e.g. fuses. External circumstances that might result in different behavior is faulty electronics (bad connections or solder joints, interference from other electronics nearby, unstable power supplies etc).

 

If you have problems with build errors, then a first measure would be to post the complete build output here at AVRfreaks. After the build, switch to the Output tab in Studio, mark everything (ctrl-A) copy it and post it here. Just looking t that will often give us a fairly good idea about what the problem might be. Based on that we might ask follow-up questions to help you resolve the problem.

 

If you have probmems with the running code then for a start we need to know a bit about the system as a whole, what it is supposed to do, what it actually does, what hardware is used (AVR model, and if possible a schematic), if possible the source code and perhaps other things. A few rounds of Q&A is to be expected before we can start homing in on the problem. Sometimes a problem can be discussed here for many days before a solution starts to surface. Sometimes we solve the problem within minutes. It happens that a problem stays unsolved.

 

But as your question stands, there is very little to go on.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, Johan, thanks for answering

 

Regarding the compiler,the things look strange for me. If the compiler is the same, it should compile the same way, even if the version is much newer (it must make sense, no?).

Maybe I am confused because I tried to use WinAVR includes inside the Studio (here it doesn't seem a clever solution).

I believe I could be missed any setting, once I am new on Studio.

 

The specific hardware I am working on (called master) communicates with another ATmega128RFA1 core using the radio transceiver. Once it is standalone, not seeing the slave, it continously beeps and blinks a led. The function responsible to switch on/off the led and buzzer should be called periodically by a task machine. I have to filter only this part of code.

 

Lets try a logic sequence:

- the hardware is valid, assuming it works well with the old version of gcc. My Studio project is based on a manufacturer hardware, not any development board.

- with the makefile I attached, runnng under eclipse environment, I get a valid behaviour when recording it on flash.

- it should run only with Studio reources, what drives me to believe there is a setting mistake anywhere.

- toolchain for avr8 is being used, even for ATmega128RFA1 core. Is this correct? In Debug -> Options, then Debugger -> GDB Settings   I selected AVR32 as the architecture. With AVR8 option, same thing.

- right below is one of my functions, which initiates timer1. What seems to be wrong here is that when I hover the mouse over their names (TCCR1B, OCR1A and so on) during debug time, I receive a message "Unknown identifier".

 

void tc1_init(void)
{
  TCCR1B  = 0x01;                /*divide clock by 1 (F_CPU / 1)    */
  OCR1A   =((F_CPU / 1) / 1000); /*set compare match value          */
  TCNT1   =  0;                  /*reset counter value              */
  TIMSK1  =  0
      /* |  (1 << TOIE1 ) */     /*enable TC1 overflow interrupt    */
         |  (1 << OCIE1A)        /*enable cmp. match IRQ            */
         ;
}

 

 

 

 

 

Last, what exactly is ASF for???? I haven't created one.

 

 

 

 

 

------ Rebuild All started: Project: GccApplication1, Configuration: Debug AVR ------
Build started.
Project "GccApplication1.cproj" (Clean target(s)):
Target "Clean" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Trabalho\Guindaste\Firmware\AStudioProjects\FDCSingle_Master\GccApplication1\GccApplication1.cproj" (entry point):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe clean
        rm -rf  adccore.o appcore.o batterycore.o buzzercore.o inputcore.o lampcore.o main.o mapevents.o outputcore.o platform.o radiocore.o slave0core.o swcore.o synchcore.o syscalls.o taskscore.o tc1core.o tc2core.o uartcore.o   
        rm -rf  adccore.d appcore.d batterycore.d buzzercore.d inputcore.d lampcore.d main.d mapevents.d outputcore.d platform.d radiocore.d slave0core.d swcore.d synchcore.d syscalls.d taskscore.d tc1core.d tc2core.d uartcore.d   
        rm -rf "limitm_master_build_12a.elf" "limitm_master_build_12a.a" "limitm_master_build_12a.hex" "limitm_master_build_12a.lss" "limitm_master_build_12a.eep" "limitm_master_build_12a.map" "limitm_master_build_12a.srec" "limitm_master_build_12a.usersignatures"
    Done executing task "RunCompilerTask".
Done building target "Clean" in project "GccApplication1.cproj".
Done building project "GccApplication1.cproj".

Build succeeded.
------ Rebuild All started: Project: GccApplication1, Configuration: Debug AVR ------
Build started.
Project "GccApplication1.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Trabalho\Guindaste\Firmware\AStudioProjects\FDCSingle_Master\GccApplication1\GccApplication1.cproj" (target "Build" depends on it):
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all
        Building file: .././adccore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "adccore.d" -MT"adccore.d" -MT"adccore.o"   -o "adccore.o" ".././adccore.c"
        In file included from .././platform.h:12:0,
                         from .././adccore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././adccore.c
        Building file: .././appcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "appcore.d" -MT"appcore.d" -MT"appcore.o"   -o "appcore.o" ".././appcore.c"
        In file included from .././platform.h:12:0,
                         from .././appcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././appcore.c
        Building file: .././batterycore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "batterycore.d" -MT"batterycore.d" -MT"batterycore.o"   -o "batterycore.o" ".././batterycore.c"
        In file included from .././platform.h:12:0,
                         from .././batterycore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././batterycore.c
        Building file: .././buzzercore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "buzzercore.d" -MT"buzzercore.d" -MT"buzzercore.o"   -o "buzzercore.o" ".././buzzercore.c"
        In file included from .././platform.h:12:0,
                         from .././buzzercore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././buzzercore.c
        Building file: .././inputcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "inputcore.d" -MT"inputcore.d" -MT"inputcore.o"   -o "inputcore.o" ".././inputcore.c"
        In file included from .././platform.h:12:0,
                         from .././inputcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././inputcore.c
        Building file: .././lampcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "lampcore.d" -MT"lampcore.d" -MT"lampcore.o"   -o "lampcore.o" ".././lampcore.c"
        In file included from .././platform.h:12:0,
                         from .././lampcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././lampcore.c
        Building file: .././main.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c"
        In file included from .././platform.h:12:0,
                         from .././main.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././main.c
        Building file: .././mapevents.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "mapevents.d" -MT"mapevents.d" -MT"mapevents.o"   -o "mapevents.o" ".././mapevents.c"
        In file included from .././platform.h:12:0,
                         from .././mapevents.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././mapevents.c
        Building file: .././outputcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "outputcore.d" -MT"outputcore.d" -MT"outputcore.o"   -o "outputcore.o" ".././outputcore.c"
        In file included from .././platform.h:12:0,
                         from .././outputcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././outputcore.c
        Building file: .././platform.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "platform.d" -MT"platform.d" -MT"platform.o"   -o "platform.o" ".././platform.c"
        In file included from .././platform.h:12:0,
                         from .././platform.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././platform.c
        Building file: .././radiocore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "radiocore.d" -MT"radiocore.d" -MT"radiocore.o"   -o "radiocore.o" ".././radiocore.c"
        In file included from .././platform.h:12:0,
                         from .././radiocore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././radiocore.c
        Building file: .././slave0core.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "slave0core.d" -MT"slave0core.d" -MT"slave0core.o"   -o "slave0core.o" ".././slave0core.c"
        In file included from .././platform.h:12:0,
                         from .././slave0core.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././slave0core.c
        Building file: .././swcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "swcore.d" -MT"swcore.d" -MT"swcore.o"   -o "swcore.o" ".././swcore.c"
        In file included from .././platform.h:12:0,
                         from .././swcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././swcore.c
        Building file: .././synchcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "synchcore.d" -MT"synchcore.d" -MT"synchcore.o"   -o "synchcore.o" ".././synchcore.c"
        In file included from .././platform.h:12:0,
                         from .././synchcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././synchcore.c
        Building file: .././syscalls.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "syscalls.d" -MT"syscalls.d" -MT"syscalls.o"   -o "syscalls.o" ".././syscalls.c"
        .././syscalls.c: In function 'get_stack_top':
C:\Trabalho\Guindaste\Firmware\AStudioProjects\FDCSingle_Master\GccApplication1\syscalls.c(51,2): warning: implicit declaration of function '__get_MSP' [-Wimplicit-function-declaration]
          return (char*) __get_MSP();
          ^
        Finished building: .././syscalls.c
        Building file: .././taskscore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "taskscore.d" -MT"taskscore.d" -MT"taskscore.o"   -o "taskscore.o" ".././taskscore.c"
        In file included from .././platform.h:12:0,
                         from .././taskscore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././taskscore.c
        Building file: .././tc1core.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "tc1core.d" -MT"tc1core.d" -MT"tc1core.o"   -o "tc1core.o" ".././tc1core.c"
        In file included from .././platform.h:12:0,
                         from .././tc1core.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././tc1core.c
        Building file: .././tc2core.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "tc2core.d" -MT"tc2core.d" -MT"tc2core.o"   -o "tc2core.o" ".././tc2core.c"
        In file included from .././platform.h:12:0,
                         from .././tc2core.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././tc2core.c
        Building file: .././uartcore.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"../../../include" -I"../../../sys-include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1" -c -std=gnu99 -MD -MP -MF "uartcore.d" -MT"uartcore.d" -MT"uartcore.o"   -o "uartcore.o" ".././uartcore.c"
        In file included from .././platform.h:12:0,
                         from .././uartcore.c:1:
c:\program files (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(90,3): warning: #warning "F_CPU not defined for <util/delay.h>" [-Wcpp]
         # warning "F_CPU not defined for <util/delay.h>"
           ^
        Finished building: .././uartcore.c
        Building target: limitm_master_build_12a.elf
        Invoking: AVR/GNU Linker : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o limitm_master_build_12a.elf  adccore.o appcore.o batterycore.o buzzercore.o inputcore.o lampcore.o main.o mapevents.o outputcore.o platform.o radiocore.o slave0core.o swcore.o synchcore.o syscalls.o taskscore.o tc1core.o tc2core.o uartcore.o   -Wl,-Map="limitm_master_build_12a.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega128rfa1 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.90\gcc\dev\atmega128rfa1"  
        Finished building target: limitm_master_build_12a.elf
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures  "limitm_master_build_12a.elf" "limitm_master_build_12a.hex"
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom  --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --no-change-warnings -O ihex "limitm_master_build_12a.elf" "limitm_master_build_12a.eep" || exit 0
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "limitm_master_build_12a.elf" > "limitm_master_build_12a.lss"
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "limitm_master_build_12a.elf" "limitm_master_build_12a.srec"
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "limitm_master_build_12a.elf"
           text       data        bss        dec        hex    filename
          10156        540        332      11028       2b14    limitm_master_build_12a.elf
    Done executing task "RunCompilerTask".
    Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunOutputFileVerifyTask"
                Program Memory Usage     :    10696 bytes   8,2 % Full
                Data Memory Usage         :    872 bytes   5,3 % Full
    Done executing task "RunOutputFileVerifyTask".
Done building target "CoreBuild" in project "GccApplication1.cproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "Build" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "C:\Trabalho\Guindaste\Firmware\AStudioProjects\FDCSingle_Master\GccApplication1\GccApplication1.cproj" (entry point):
Done building target "Build" in project "GccApplication1.cproj".
Done building project "GccApplication1.cproj".

Build succeeded.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

 

Attachment(s): 

Last Edited: Wed. Jan 6, 2016 - 07:55 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is the same warning all the way through: "F_CPU not defined for <util/delay.h>"

 

This might very well be a new warning that wasn't in WinAVR but definitively is in the current avr-gcc that comes with Studio. Regardless of if it was emitted from the WinAVR version or not, this needed fixing even then. And it certainly needs fixing now.

 

It is not unlikely that this define was done in some way external from the source code itself in your old WinAVR builds - e.g. through a parameter passsed to the compiler from a makefile or similar.

 

To fix this in Studio you could add a #define just before any

#include <util/delay.h>

 

in your sources. A better idea might be to add it to the project properties. Exactly what value to define depends on your hardware, specifically you must define it to the frequency your AVR runs at. So for an AVR running at 8 MHz you'd

 

#define F_CPU 8000000UL

 

in your source code, or in the project properties you'd do

 

 

EDIT: Forgot this:

Last, what exactly is ASF for???? I haven't created one.

"Application Software Framework". A library of highly adaptable support functions, mainly for dealing with the complexity of the 32-bit microcontrollers like Atmels ARM variants. For an 8-bit AVR you don't need it. Rinse "ASF" out of your conscience and make room for something useful.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Wed. Jan 6, 2016 - 09:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, Johan

 

I was so focused on project settings overall that didn't realised that warning. It seems solved, confirmed by my mate hours ago.

 

About ASF, I just compiled without it, makes sense.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Eletricman wrote:
Thanks, Johan

You're most welcome!

 

Please mark my  previous post as a solution. This will help future readers, and it will "tag" the complete thread as solved in the forum lists.

 

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]