No Hex file created by avr-gcc

MiniPOV, MiniPOV2 and MiniPOV3

Moderators: adafruit_support_bill, adafruit

No Hex file created by avr-gcc

Postby tgmcnaughton » Sun Mar 11, 2012 4:28 am

make.zip
zip contains make.c and Makefile
(3.47 KiB) Downloaded 85 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
tgmcnaughton
 
Posts: 2
Joined: Sat Mar 10, 2012 9:13 pm

Re: No Hex file created by avr-gcc

Postby mtbf0 » Mon Mar 12, 2012 8:54 pm

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.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1642
Joined: Fri Nov 09, 2007 11:59 pm
Location: oakland ca


Return to MiniPOV

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [105]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]