gonium / mikrowerk

Automatically exported from code.google.com/p/mikrowerk
6 stars 5 forks source link

Building in WinAvr on WindowsXP #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I have used your make file and it worked fine.  Now I am trying to add 
additonal code to your project.  I have the lastest version of WinAvr 
4.16.638 installed on a Windows XP system  I'm using a Atmega168p.

I have added all the required files.  I also created a f_osc.h to add the 
f_osc 16000000 to the project to prevent the f_osc errors when building 

I would like to add more features to your base program to monitor a home 
test project. (humidity and pwm fan control) I am a newbie to AVRs and 
programming.  So I was trying to get the your base program to work as is 
before proceeding.  

When I try to rebuild all I get the following warnings and errors. 

Build started 29.7.2009 at 07:14:57
avr-gcc -I"C:\WinAVR\usbtemp" -I"C:\WinAVR\usbtemp\usbdrv" -
I"C:\WinAVR\avr\include" -I"C:\WinAVR\avr\include\avr" -
I"C:\WinAVR\avr\include\compat" -I"C:\WinAVR\avr\include\util"  -
mmcu=atmega168p -gdwarf-2 -std=gnu99 -Wall        -DF_CPU=16000000UL -Os -f
signed-char -MD -MP -MT usbtemp.o -MF dep/usbtemp.o.d  -
c  ../usbtemp/usbtemp.c

../usbtemp/usbtemp.c: In function 'print_temp':
../usbtemp/usbtemp.c:191: warning: pointer targets in passing argument 2 
of 'itoa' differ in signedness
../usbtemp/usbtemp.c:194: warning: pointer targets in passing argument 1 
of 'strlen' differ in signedness
../usbtemp/usbtemp.c:195: warning: pointer targets in passing argument 1 
of 'uart_puts' differ in signedness
../usbtemp/usbtemp.c: In function 'enable_status_led':
../usbtemp/usbtemp.c:240: error: 'PB2' undeclared (first use in this 
function)
../usbtemp/usbtemp.c:240: error: (Each undeclared identifier is reported 
only once
../usbtemp/usbtemp.c:240: error: for each function it appears in.)
../usbtemp/usbtemp.c: In function 'disable_status_led':
../usbtemp/usbtemp.c:245: error: 'PB2' undeclared (first use in this 
function)
make: *** [usbtemp.o] Error 1
Build failed with 4 errors and 3 warnings...

What steps will reproduce the problem?
1. Configure program in WinAVR and try to build or rebuild.

Thanks
Bowen Pratt
bowen@bowenpratt.com

Original issue reported on code.google.com by bo...@bowenpratt.com on 29 Jul 2009 at 1:02

GoogleCodeExporter commented 9 years ago
Hi Bowen,

sorry to hear this. I don't have a Windows machine, so I can't reproduce your
problem. The warnings are well-known (to me) and can be safely ignored, 
although this
is not good programming style. The errors regarding PB2 are serious, though. 
This
looks to me as if the avr-gcc definitions of the ATMega168p are not loaded.

Lacking any experience with WinAVR, I don't really know how to solve this. I 
noticed,
however, that the register constants defined in "iom168p.h" contains

#define PORTB2 2

so probably the names have changed from the ATMega168 to the ATMega168p. Again, 
I
can't reproduce this, but could you try changing PB2 to PORTB2? So, either you 
need
to patch the source or you change to the ATMega168.

HTH,
-Mathias

Original comment by dalhei...@gmail.com on 31 Jul 2009 at 5:44