Error after removing all lines of the project C file

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

Hello,

 

I just started working with Atmel Studio 7.0.

 

First, I got the errors related to <util/delay.h> then, after I solved it I got the new error even if I remove all lines from the project, the errors are not solved.

 

Even if I compile with this default Atmel Studio C file sketch, the error is not going and I have to open a new project!

 

This is my work picture:

Last Edited: Mon. Dec 26, 2016 - 04:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. show the compiler output

2. rebuild all

Keith Vasilakes

Firmware engineer

Minnesota

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

Also, those errors are for project 1, while you showed project 2...

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

wolfrose wrote:

..after I solved it I got the new error even if I remove all lines from the project, the errors are not solved.

 

The errors show 'no such file or directory'.

Do any of the directory folders or the user-name folder have any unusual characters in the name?

 

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

1. OK in the following screen copy.

2. There are 3 options, build, rebuild and clean. I didn't see build all. But I think clean is similar to build all but I'm not sure.

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

Even if I closed Atmel Studio and open it again for specific project, it would still the same error.

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

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

... and copy the contents of the output window and paste it here (output in the bottom left in your screenshot)

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

How? I can't because of these errors, I can't get the output results which shows the details of the build. Unless I open a new project and build it.

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

Open the output tab (visible in the bottom left, or by going to View-Output) to show the full error message.

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

------ Rebuild All started: Project: GccApplication1, Configuration: Debug AVR ------

Build started.

Project "GccApplication1.cproj" (Clean target(s)):

Target "Clean" in file "E:\Program Files Directory\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\wolfrose\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\GccApplication1.cproj" (entry point):

Task "RunCompilerTask"

Shell Utils Path E:\Program Files Directory\Atmel\Studio\7.0\shellUtils

E:\Program Files Directory\Atmel\Studio\7.0\shellUtils\make.exe clean

rm -rf main.o

rm -rf main.d

rm -rf "GccApplication1.elf" "GccApplication1.a" "GccApplication1.hex" "GccApplication1.lss" "GccApplication1.eep" "GccApplication1.map" "GccApplication1.srec" "GccApplication1.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 "E:\Program Files Directory\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\wolfrose\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\GccApplication1.cproj" (target "Build" depends on it):

Task "RunCompilerTask"

Shell Utils Path E:\Program Files Directory\Atmel\Studio\7.0\shellUtils

E:\Program Files Directory\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync

Building file: .././main.c

Invoking: AVR/GNU C Compiler : 4.9.2

avr-gcc.exe(0,0): error: =: No such file or directory

avr-gcc.exe(0,0): error: 10000000: No such file or directory

make: *** [main.o] Error 1

"E:\Program Files Directory\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -x c -funsigned-char -funsigned-bitfields -DDEBUG -DF_CPU = 10000000 -I"E:\Program Files Directory\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.106\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega32u4 -B "E:\Program Files Directory\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.106\gcc\dev\atmega32u4" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o" -o "main.o" ".././main.c"

C:\Users\wolfrose\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\Debug\Makefile(79,1): error: recipe for target 'main.o' failed

The command exited with code 2.

Done executing task "RunCompilerTask" -- FAILED.

Done building target "CoreBuild" in project "GccApplication1.cproj" -- FAILED.

Done building project "GccApplication1.cproj" -- FAILED.

Build FAILED.

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

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

I also got this error when I removed F_CPU value from project's --> properties/symbols. And added it again before includes of the code.

 

------ Build 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 "E:\Program Files Directory\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\wolfrose\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\GccApplication1.cproj" (target "Build" depends on it):

Task "RunCompilerTask"

Shell Utils Path E:\Program Files Directory\Atmel\Studio\7.0\shellUtils

E:\Program Files Directory\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync

Building file: .././main.c

Invoking: AVR/GNU C Compiler : 4.9.2

In file included from .././main.c:11:0:

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h: In function 'forward':

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

"E:\Program Files Directory\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"E:\Program Files Directory\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.106\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega32u4 -B "E:\Program Files Directory\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.106\gcc\dev\atmega32u4" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o" -o "main.o" ".././main.c"

C:\Users\wolfrose\Documents\Atmel Studio\7.0\GccApplication1\GccApplication1\Debug\Makefile(79,1): error: recipe for target 'main.o' failed

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h: In function 'reverse':

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

e:\program files directory\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h(187,2): error: __builtin_avr_delay_cycles expects a compile time integer constant

__builtin_avr_delay_cycles(__ticks_dc);

^

make: *** [main.o] Error 1

Done executing task "RunCompilerTask" -- FAILED.

Done building target "CoreBuild" in project "GccApplication1.cproj" -- FAILED.

Done building project "GccApplication1.cproj" -- FAILED.

Build FAILED.

========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

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

error: 10 000 000:

At least a large number of errors are allowed for, one would not want to run out of error numbers. devil

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

avr-gcc.exe(0,0): error: =: No such file or directory

avr-gcc.exe(0,0): error: 10000000: No such file or directory

 

This is just a guess, your AS7 install is on DRIVE e: and your user name is on DRIVE c: maybe it's looking for something on DRIVE c: ??

Your Windows install is on c: right ??

Maybe something to look into.

 

 

 

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

I've looked in the project's properties, but I don't think there's a problem in the path because the AS7 should look for the adjusted settings.

 

Because when you first develop the project it compiles OK but when I start to add includes and definitions then I start to errors and I can't compile it again, even if I remove everything!

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

I tried this morning and it builds OK!!? I don't know why AS7 changed its behavior.

 

But now I get this error with this command.

 

_delay_ms(_speed);

 

I think I shouldn't put this variable inside delay functions, because they won't get it. Maybe it's expecting double values.

 

OK I removed the variables as though I wish to substitute with variables for more versatility in my functions prototypes.

 

Now it compiles OK angel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
_delay_ms doesn't take variables.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Tue. Dec 27, 2016 - 05:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there a way to modify it? Because I want to provide the time value as a function argument, so you just modify the function argument and that changes all the delays in forward or reverse functions.

 

For example:

 

/*
 * GccApplication1.c
 *
 * Created: 12/25/2016 8:31:54 PM
 * Author : wolfrose
 */ 

#define F_CPU 10000000UL

#include <avr/io.h>
#include <util/delay.h>

#define pin1_ON (PORTD = 0x80)
#define pin2_ON (PORTE = 0x40)
#define pin3_ON (PORTB = 0x10)
#define pin4_ON (PORTB = 0x20)

#define pin1_OFF (PORTD = 0x00)
#define pin2_OFF (PORTE = 0x00)
#define pin3_OFF (PORTB = 0x00)
#define pin4_OFF (PORTB = 0x00)

void forward(uint8_t _steps, uint8_t _speed);
void reverse(uint8_t _steps,uint8_t _speed);

int main(void)
{

DDRD = 0x80;
DDRE = 0x40;
DDRB = 0x30;

    while (1) 
    {
  forward(20,10);
  _delay_ms(1000);
  reverse(20,10);
  _delay_ms(1000);
    }
 
}

void forward (uint8_t _steps, uint8_t _speed)
{
 uint8_t n;
 for (n=0;n<_steps;n++){
  pin1_ON;pin4_OFF;
  _delay_ms(_speed);
  pin1_ON;pin2_ON;
  _delay_ms(_speed);
  pin1_OFF;pin2_ON;
  _delay_ms(_speed);
  pin2_ON;pin3_ON;
  _delay_ms(_speed);
  pin2_OFF;pin3_ON;
  _delay_ms(_speed);
  pin3_ON;pin4_ON;
  _delay_ms(_speed);
  pin3_OFF;pin4_ON;
  _delay_ms(_speed);
  pin4_ON;pin1_ON;
 _delay_ms(_speed);}
}
void reverse (uint8_t _steps,uint8_t _speed)
{
 uint8_t n;
 for (n=0;n<_steps;n++){
  pin4_ON;pin1_OFF;
  _delay_ms(_speed);
  pin4_ON;pin3_ON;
  _delay_ms(_speed);
  pin4_OFF;pin3_ON;
  _delay_ms(_speed);
  pin3_ON;pin2_ON;
  _delay_ms(_speed);
  pin3_OFF;pin2_ON;
  _delay_ms(_speed);
  pin2_ON;pin1_ON;
  _delay_ms(_speed);
  pin2_OFF;pin1_ON;
  _delay_ms(_speed);
  pin1_ON;pin4_ON;
 _delay_ms(_speed);}
}

 

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

-DF_CPU = 10000000

You've got spaces in your definition of "F_CPU", do not do that!

 

The compiler thinks "=" and "10000000" are files to compile, which causes the error messages.

Bob. Engineer and trainee Rocket Scientist.

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

Where do I have "="?

 

I think my definition is OK here:

 

#define F_CPU 10000000UL

Anyway now it compiles OK :)

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

wolfrose wrote:
Where do I have "="?

 

"E:\Program Files Directory\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -x c -funsigned-char -funsigned-bitfields -DDEBUG -DF_CPU = 10000000 -I"E:\Program Files Directory\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.106\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega32u4 -B "E:\Program Files Directory\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.0.106\gcc\dev\atmega32u4" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o" -o "main.o" ".././main.c"

In your compiler settings, where you defined "F_CPU". Correct spacing is very important on the command line, but generally speaking not in C source code.

Bob. Engineer and trainee Rocket Scientist.

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

OK so you mean I have to add spaces? Yes you're right it's very important.

 

Now I have another issue.

 

_delay_ms (uint32_t);

 

Should only have constant values, I want to substitute it with Variable names for simplicity in my functions.

 

Where I can't do that, so what's the solution? Can I modify <util/delay.h>? Or develop a new delay library in the same WinAVR folder?

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

The idea of the _delay functions is that if you want to invoke with a variable amount you wrap a call to a fixed delay such as _delay_ms(1) or _delay_ms(0.1) or whatever in a for() loop then vary the iteration count of that loop.

 

Of course no serious MCU application is going to waste time just delaying.  Once your app has a timer enabled use it to coordinate things temporally.