No Hex file created by avr-gcc

MiniPOV4 and previous versions

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tgmcnaughton
 
Posts: 12
Joined: Sat Mar 10, 2012 10:13 pm

No Hex file created by avr-gcc

Post by tgmcnaughton »

make.zip
zip contains make.c and Makefile
(3.47 KiB) Downloaded 711 times
Hi,
I have 2 Minipov3 kits, My OS is WinXP, I'm using a USB adapter
One kit worked perfectly straight away. The other just displayed 10000000 and shifted this value about 1/sec.

I installed avrdude on my winXP machine and flashed the broken miniPOV3 with the make.hex file. It seemed to work fine, and now, both my devices work - to display "Make!"

My problem is this: I'd like to recompile so as to display different words. So, I installed avr-gcc from WinAVR-20100110-install.exe at sourceforge.net.

Now, I'm recompiling make.c using:
avr-gcc -mmcu=attiny2313 -DF_CPU=8000000UL make.c
but it doesn't create a new "make.hex" file.

I'm brand new to AVR microcontrollers, although I have some experience with PICs.

Here's my whole session trying to recompile the stock make.c file:

C:\WinAVR2\POV>
C:\WinAVR2\POV>avr-gcc make.c
In file included from make.c:1:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:404:6: warning: #warning "device type not defined"
In file included from make.c:3:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
In file included from make.c:5:
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:90:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
make.c:99: warning: 'SIG_TIMER1_COMPA' appears to be a misspelled signal handler
make.c: In function 'SIG_TIMER1_COMPA':
make.c:104: error: 'PORTB' undeclared (first use in this function)
make.c:104: error: (Each undeclared identifier is reported only once
make.c:104: error: for each function it appears in.)
make.c: In function 'main':
make.c:111: error: 'DDRB' undeclared (first use in this function)
make.c:131: error: 'TCCR1B' undeclared (first use in this function)
make.c:131: error: 'WGM12' undeclared (first use in this function)
make.c:132: error: 'OCR1A' undeclared (first use in this function)
make.c:134: error: 'TIMSK' undeclared (first use in this function)
make.c:134: error: 'OCIE1A' undeclared (first use in this function)


----------------
so then I added -mmcu=attiny2313 to the command line
----------------

C:\WinAVR2\POV>
C:\WinAVR2\POV>
C:\WinAVR2\POV>avr-gcc -mmcu=attiny2313 make.c
In file included from make.c:3:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
In file included from make.c:5:
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:90:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"


----------------
so then I added -mmcu=attiny2313 and -DF_CPU=8000000UL to the command line
----------------

C:\WinAVR2\POV>
C:\WinAVR2\POV>
C:\WinAVR2\POV>
C:\WinAVR2\POV>avr-gcc -mmcu=attiny2313 -DF_CPU=8000000UL make.c
In file included from make.c:3:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
In file included from make.c:5:
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:90:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"


So, as I said above, it seems to run with warnings but no errors, but I don't get a new "make.hex" file.

here's my version info for avr-gcc:

C:\WinAVR2\POV>avr-gcc --version
avr-gcc (WinAVR 20100110) 4.3.3

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: No Hex file created by avr-gcc

Post by mtbf0 »

use the makefile. it will pass all the proper flags to the compiler and get the compiler output converted to a hex file.

try

Code: Select all

make program-make
see instructions here.

Locked
Please be positive and constructive with your questions and comments.

Return to “MiniPOV”