converting from CV to winAvr

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

Hi all,

I have decided to change my compiler from CV to winavr just because of limited size of my codes,but just started to write a simple program of blinking an led it gives me this error"opening dependency file 

.dep/led.o.d  No such file or directory "

Will you please help me on this?

This is my code:



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

int main(void)
{
  DDRD=0xff;


while (1)
  {
   PORTD=0x00;
   _delay_ms(1000);
   PORTD=0xff;
   _delay_ms(1000);

  }
}

 

Last Edited: Wed. Apr 8, 2020 - 04:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see some things not being right, but none that could explain this with the very limited information you have given.

There must be more warnings/errors there as this error merely gives note that something went wrong on another place and it had not created the file mentioned.

 

1 tip: define F-CPU before all the include files to make sure the delay functions use the right CPU clock frequency to calculate their delays on.

 

 

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

THIS is the total report:

      0 [main] sh 12940 sync_with_child: child 13196(0x1C8) died before initialization with status code 0xC0000142
  20879 [main] sh 12940 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 14568 sync_with_child: child 7592(0x1C8) died before initialization with status code 0xC0000142
  29968 [main] sh 14568 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling C: led.c
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./led.lst  -std=gnu99 -MMD -MP -MF .dep/led.o.d led.c -o led.o 
led.c:2:1: warning: "F_CPU" redefined
<command-line>: warning: this is the location of the previous definition
led.c:18: fatal error: opening dependency file .dep/led.o.d: No such file or directory
compilation terminated.
make.exe: *** [led.o] Error 1

> Process Exit Code: 2
> Time Taken: 00:00
"

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

to winavr

I hope you know that is it very old and will not support newer chips. Any problems installing AS7 apart from the huge size?

 

It may be complaining about the upper case AVR?? Try lower case.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
It may be complaining about the upper case AVR?? Try lower case.
Linux would have a problem - but Windows is lenient when it comes to case.

 

But the point is that WinAVR2010 is actually a compiler from late 2009. That is 11 years ago. No one should be using WinAVR in 2020 really. The build tools have been much fixed and much extended in those intervening years. That dep/.d thing was a common fault back then (though a "make clean" should clear it).

 

If you want avr-gcc on Windows in 2020 then if there is some reason you don't want the whole of AS7 (editor, debugger, simulator, compilers, assemblers, linkers) you can get just the compiler/assembler/linker part separately as a "Toolchain" which is a kind of "modern day WinAVR". You get it here:

 

https://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers

 

specifically:  AVR 8-bit Toolchain v3.62 – Windowshttps://www.microchip.com/mymicr...

 

I would, however, suggest that life is a whole lot simpler if you just download and install:  https://www.microchip.com/mplab/avr-support/atmel-studio-7 (in which case forget "toolchain" as there's a copy in there already).

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

clawson wrote:
 life is a whole lot simpler if you just download and install: [Atmel Studio] 

Absolutely!

 

And note that there's a whole load of Getting Started videos near the bottom of that page to, well - get you started!

 

Also a link to "Hands-On" training.

 

Also on YouTube:  https://www.youtube.com/watch?v=LWUv_gbA44k

 

etc, etc, ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

 

I compiled the above mentioned code (#1) without any problem

 

My system: WIN7 32 bit, WINAVR20100110,  AVRStudio4.18 Build716, ATMega8 3686400Hz: 

avr-gcc -I"D:\cyg_test\GDI_C_CYGWIN\AUFGABEN\aufgabe_4\ampel_neu\."  -mmcu=atmega8 -Wall -gdwarf-2 -std=gnu99 -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wextra -Wswitch-default -Wmissing-braces -Wunreachable-code -Wunused -Wmissing-declarations   -DF_CPU=3686400UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT test.o -MF dep/test.o.d  -c  ../test.c

 

../test.c: In function 'main':
c:/winavr_20100110/lib/gcc/../../avr/include/util/delay.h:130: warning: will never be executed
c:/winavr_20100110/lib/gcc/../../avr/include/util/delay.h:130: warning: will never be executed
avr-gcc -mmcu=atmega8 -Wl,-Map=ampel_neu.map test.o   -L"D:\cyg_test\GDI_C_CYGWIN\AUFGABEN\aufgabe_4\ampel_neu\."  -li2clcdatm8 -latm8  -o ampel_neu.elf
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature  ampel_neu.elf ampel_neu.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex ampel_neu.elf ampel_neu.eep || exit 0
avr-objdump -h -S ampel_neu.elf > ampel_neu.lss
 

 

Build succeeded with 2 Warnings...

 

regards

 

Hero_123
 

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

Thank you all,

I think I better try the   [Atmel Studio] .

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

Hero_123 wrote:
AVRStudio4.18
Again why would you stick with AS4 when AS7 is available. Or are you restricted to using WinXP or something else that is pre-Win7 ? If you have modern Windows then get AS7 (which is based on Microcosft Visual Studio 2015)

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

Hello clawson

 

Yes, I still have an old WIN XP computer and there the AS4 is still active as it is on my WIN7 computer.

 

Now my question is - can I have AVRStudio4.18 AND AS7 on my WIN7 computer without interfering each other? And will my programmer still work when using AS7? It's a programmer with a 6-pin ISP header based on a  Atmel AT90USB162 with 8MHz (STK500V2 protocol) which I use to flash my sw.

 

And what else (apart from AS7) do I need? Any additional sw (like Microsoft Visual Studio 2015 which I do not have) or is in the AS7 setup all neccessary sw included?

 

Thanks for your help yes

 

regards

 

Hero_123

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

Yup 4 and 7 will coexist.

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

Just watch that you don't upgrade your programmer or debugger for AS7 or it will no longer work with AS4.

 

I have both on AS4 and AS7 my computer but have kept the JTAG Mk2 2 I have for AS4 and kept it away from AS7.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
Just watch that you don't upgrade your programmer or debugger for AS7 or it will no longer work with AS4.

All you do is "update firmware" depending on teh version you are using.  If you use your programmer on AS$, and then move to AS7, you update teh firmware in AS7 to make teh programmer AS7 compatible, and then when you go back to AS4 you update again to change teh firmware to AS4 compatible.

 

Annoying yes.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

...and don't forget to change the USB driver.... sad

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:

...and don't forget to change the USB driver.... sad

I think that has been resolved..... been a while though

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

jgmdesign wrote:
js wrote:

...and don't forget to change the USB driver.... sad

I think that has been resolved..... been a while though

Not unless it's been in the last couple years.

Iluvatar is the better part of Valar.