Trouble with "simple-test" build for SV-328

I am very new with these controllers and I am having some trouble getting things to function.

Specifically, I am having trouble with building “simple-test” for my SV-328

I am very unsure of where the problem lies, so I am going to go through what I have done so far.

I have installed the pololu AVR library V100607. The installation.bat did not work properly, so I followed the “manual install” instructions for windows XP.

When I open the simple-test.aps file with AVR studio, I get this message.

Loaded plugin AVR LCD Visualizer
Loaded plugin STK500
Loaded plugin AVR GCC
Loaded partfile: C:\Program Files\Atmel\AVR Tools\PartDescriptionFiles
Error Code: -2147467259:

I had read in the forums that this was not a show stopper, so I proceed.

When I attempt to build the program I get the following output.

Build started 4.11.2010 at 23:41:13
avr-gcc -mmcu=atmega32p -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT test.o -MF dep/test.o.d -c …/test.c
unknown MCU ‘atmega32p’ specified
Known MCU names:
avr2
at90s2313
at90s2323
at90s2333
at90s2343
attiny22
attiny26
at90s4414
at90s4433
at90s4434
at90s8515
at90c8534
at90s8535
avr25
ata6289
attiny13
attiny13a
attiny2313
attiny2313a
attiny24
attiny24a
attiny4313
attiny44
attiny44a
attiny84
attiny84a
attiny25
attiny45
attiny85
attiny261
attiny261a
attiny461
attiny461a
attiny861
attiny861a
attiny43u
attiny87
attiny48
attiny88
at86rf401
avr3
at43usb355
at76c711
avr31
atmega103
at43usb320
avr35
at90usb82
at90usb162
atmega8u2
atmega16u2
atmega32u2
attiny167
avr4
atmega8
atmega48
atmega48a
atmega48p
atmega88
atmega88a
atmega88p
atmega88pa
atmega8515
atmega8535
atmega8hva
at90pwm1
at90pwm2
at90pwm2b
at90pwm3
at90pwm3b
at90pwm81
avr5
atmega16
atmega16a
atmega161
atmega162
atmega163
atmega164a
atmega164p
atmega165
atmega165a
atmega165p
atmega168
atmega168a
atmega168p
atmega169
atmega169a
atmega169p
atmega169pa
atmega16hva
atmega16hva2
atmega16hvb
atmega16m1
atmega16u4
atmega32
atmega323
atmega324a
atmega324p
atmega324pa
atmega325
atmega325a
atmega325p
atmega3250
atmega3250a
atmega3250p
atmega328
atmega328p
atmega329
atmega329a
atmega329p
atmega329pa
atmega3290
atmega3290a
atmega3290p
atmega32c1
atmega32m1
atmega32u4
atmega32u6
atmega406
atmega64
atmega640
atmega644
atmega644a
atmega644p
atmega644pa
atmega645a
atmega645p
atmega645
atmega6450
atmega6450a
atmega6450p
atmega649
atmega649a
atmega649p
atmega6490
atmega6490a
atmega6490p
atmega64c1
atmega64m1
atmega64hve
atmega32hvb
at90can32
at90can64
at90pwm216
at90pwm316
atmega16c1
atmega32c1
atmega64c1
atmega16m1
atmega32m1
atmega64m1
atmega16u4
atmega32u4
atmega32u6
at90scr100
at90usb646
at90usb647
at94k
m3000
avr51
atmega128
atmega1280
atmega1281
atmega1284p
atmega128rfa1
at90can128
at90usb1286
at90usb1287
avr6
atmega2560
atmega2561
avrxmega2
atxmega16a4
atxmega16d4
atxmega32a4
atxmega32d4
avrxmega4
atxmega64a3
atxmega64d3
avrxmega5
atxmega64a1
atxmega64a1u
avrxmega6
atxmega128a3
atxmega128d3
atxmega192a3
atxmega192d3
atxmega256a3
atxmega256a3b
atxmega256d3
avrxmega7
atxmega128a1
atxmega128a1u
avrtiny10
attiny4
attiny5
attiny9
attiny10
attiny20
attiny40
avr1
at90s1200
attiny11
attiny12
attiny15
attiny28
…/test.c:1: error: MCU ‘atmega32p’ supported for assembler only
…/test.c:1:30: error: pololu/orangutan.h: No such file or directory
…/test.c: In function ‘main’:
…/test.c:5: warning: implicit declaration of function ‘print’
…/test.c:7: warning: implicit declaration of function ‘play’
…/test.c:11: warning: implicit declaration of function ‘red_led’
…/test.c:12: warning: implicit declaration of function ‘green_led’
…/test.c:14: warning: implicit declaration of function 'delay_ms’
make: *** [test.o] Error 1
Build failed with 2 errors and 5 warnings…

One thing that leaped out at me was that the MCU was specified as atmega32p. I am not sure why the “8” is not there, or how to fix this. Also the “pololu/orangutan.h” file does exist at c:\pololu, I am confused as to why it does not find it. Do I need to redefine where it looks for this file, or is it sufficient to have copied it to c:\pololu?

I know there is most likely something very simple I am missing here. Let me apologize now if I am asking a stupid question.

I went in with a text editor and changed the “32p” to “328p” inside the simple-test.aps file.
Now the output is this

Build started 5.11.2010 at 00:04:56
avr-gcc -mmcu=atmega328p -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT test.o -MF dep/test.o.d -c …/test.c
…/test.c:1:30: error: pololu/orangutan.h: No such file or directory
…/test.c: In function ‘main’:
…/test.c:5: warning: implicit declaration of function ‘print’
…/test.c:7: warning: implicit declaration of function ‘play’
…/test.c:11: warning: implicit declaration of function ‘red_led’
…/test.c:12: warning: implicit declaration of function ‘green_led’
…/test.c:14: warning: implicit declaration of function 'delay_ms’
make: *** [test.o] Error 1
Build failed with 1 errors and 5 warnings…

I have been playing with the orangutan.h file and its location. Just stabbing in the dark really. Any pointers?

Hello.

It looks like we made a typo (32p instead of 328p) in the most recent release of the Pololu AVR library. Thanks for catching that and letting us know! We’ll be releasing a fixed version very shortly, but you can download and install the previous revision, libpololu-avr-1000607, if you want an immediate fix (the only difference between the 100607 revision and the latest release is support for Orangutan X2s with ATmega1284P processors).

- Ben

Hello,

As for your problems after fixing the “atmega32p”, it sounds like you did not install the library in the correct place. Can you please verify that you have followed the instructions here?

-Paul

Thanks for the quick response!

I can confirm that I did copy the files [libpololu_atmega48.a, libpololu_atmega168.a, libpololu_atmega328p.a, libpololu_atmega324p.a, libpololu_atmega644p.a, libpololu_atmega1284p.a, and libpololu_atmega1284p_x2.a] into the [C:\WinAVR-20100110\avr\lib] directory. And I have copied the pololu directory into the location [C:\WinAVR-20100110\avr\include]

I am going to give it a try with the prior AVR library release and see if that makes a difference =]

We have released a fixed version of the library, libpololu-avr-101104.

- Ben

Was there some reason you could not use the automatic installation?

-Paul

I am still getting this error

Build started 5.11.2010 at 01:52:01
avr-gcc -mmcu=atmega328p -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT test.o -MF dep/test.o.d -c …/test.c
…/test.c:1:30: error: pololu/orangutan.h: No such file or directory

I am pretty confident I installed the library according to the directions.

I tried changing the #include line to

#include <c:/pololu/libpololu-avr/pololu/orangutan.h>

to direct it to the proper location of that file and am now getting this output.

Build started 5.11.2010 at 02:02:19
avr-gcc -mmcu=atmega328p -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT test.o -MF dep/test.o.d -c …/test.c
In file included from …/test.c:1:
c:/pololu/libpololu-avr/pololu/orangutan.h:1:27: error: pololu/analog.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:2:27: error: pololu/buzzer.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:3:25: error: pololu/time.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:4:27: error: pololu/motors.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:5:24: error: pololu/lcd.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:6:25: error: pololu/leds.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:7:32: error: pololu/pushbuttons.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:8:24: error: pololu/qtr.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:9:29: error: pololu/encoders.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:10:30: error: pololu/resources.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:11:28: error: pololu/digital.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:12:27: error: pololu/servos.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:13:28: error: pololu/pulsein.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:14:27: error: pololu/serial.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:15:58: error: pololu/OrangutanSPIMaster/OrangutanSPIMaster.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:16:46: error: pololu/OrangutanSVP/OrangutanSVP.h: No such file or directory
c:/pololu/libpololu-avr/pololu/orangutan.h:17:44: error: pololu/OrangutanX2/OrangutanX2.h: No such file or directory
…/test.c: In function ‘main’:
…/test.c:5: warning: implicit declaration of function ‘print’
…/test.c:7: warning: implicit declaration of function ‘play’
…/test.c:11: warning: implicit declaration of function ‘red_led’
…/test.c:12: warning: implicit declaration of function ‘green_led’
…/test.c:14: warning: implicit declaration of function 'delay_ms’
make: *** [test.o] Error 1
Build failed with 17 errors and 5 warnings…

All the files it is looking for are at that location.

I assume something is wrong with the way I have installed the library, though I cannot determine what I did incorrectly looking at the directions.

Thanks for your patience on this.

Are you using one of the included AVR Studio example projects, or did you create your own and copy in the code?

- Ben

When I ran that install.bat it seems to accomplish quite a bit.

It ends as such

install: ‘tools/avr’ is a directory
make: *** [install] Error1
press any key …

Thanks again

am using the included example “simple-test” by running the aps file


#include <c:/pololu/libpololu-avr/pololu/orangutan.h> 
// I changed this from #include <pololu/orangutan.h>

int main()
{
	print("Hello!");

	play("L16 ceg>c");

	while(1)
	{
		red_led(0);
		green_led(1);

		delay_ms(100);

		red_led(1);
		green_led(0);
		
		delay_ms(100);
	}

	return 0;
}

// Local Variables: **
// mode: C **
// c-basic-offset: 4 **
// tab-width: 4 **
// indent-tabs-mode: t **
// end: **

Hello,

Can you post the entire output from install.bat? I do not know why “tools/avr” would be causing you problems.

Also, didn’t you say that you had installed the .h files in C:\WinAVR-20100110\avr\include\pololu ? Why are you changing the #include to some other path?

-Paul

I just changed the path to see if it might have been looking in the incorrect place. I thought it might be worth a try.

This is the result from install.bat below

The Pololu AVR Library object files (.a) will be installed in c:/program files/a
tmel/avr tools/avr toolchain/bin/…/lib/gcc/avr/4.4.3/…/…/…/…/avr/lib/
The header files (.h) will be installed in c:/program files/atmel/avr tools/avr
toolchain/bin/…/lib/gcc/avr/4.4.3/…/…/…/…/avr/lib//…/include/pololu
(For Windows Vista: make sure to right-click and select “Run as administrator”)
Press any key to continue . . .
install -d c:/program files/atmel/avr tools/avr toolchain/bin/…/lib/gcc/avr/4.4
.3/…/…/…/…/avr/lib/
install -d c:/program files/atmel/avr tools/avr toolchain/bin/…/lib/gcc/avr/4.4
.3/…/…/…/…/avr/lib//…/include/pololu
install libpololu_atmega48.a libpololu_atmega168.a libpololu_atmega328p.a libpol
olu_atmega324p.a libpololu_atmega644p.a libpololu_atmega1284p.a c:/program files
/atmel/avr tools/avr toolchain/bin/…/lib/gcc/avr/4.4.3/…/…/…/…/avr/lib/
install: c:/program' is a directory install:files/atmel/avr’ is a directory
install: `tools/avr’ is a directory
make: *** [install] Error 1
Press any key to continue . . .

Hello,

It appears that your WinAVR files are installed in “c:/program files/atmel/avr tools/avr toolchain/”, not in “C:\WinAVR-20100110”. Did you move some files to that location? Do you also have something in “C:\WinAVR-20100110”?

Anyway, it appears that our automatic installation is getting tripped up by the spaces in that folder name. Can you try copying the pololu folder to “c:/program files/atmel/avr tools/avr toolchain/avr/include/pololu” and the .a files into “c:/program files/atmel/avr tools/avr toolchain/avr/lib” according to the instructions? The folders should look almost exactly like those in the screenshot below, including the “avr”, “compat”, and other subfolders.

-Paul

That was the fix!

I was copying the .a files into C:\WinAVR-20080610\avr\lib and the “pololu” directory into C:\WinAVR-20080610\avr\include

Putting everything under c:\program files\atmel… as you said, got it working. Sorry I didnt quite pick that up from the installation instruction in the user guide.

Youre a legend
Thanks

Recently i bought a Pololu to do a maze solving project. I started to programme by installing the pWINAVR and AVR Studio4. I faced the same problem as stated above.

0 [main] sh 2664 sync_with_child: child 4804(0x184) died before initialization with status code 0x0
87332 [main] sh 2664 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
avr-gcc -mmcu=atmega328p -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT test.o -MF dep/test.o.d -c …/test.c
…/test.c:1:30: fatal error: pololu/orangutan.h: No such file or directory
compilation terminated.
make: *** [test.o] ´íÎó 1
Build failed with 1 errors and 0 warnings…

i saved the file to the correct directory but still cant solve.

I’m using Window Vista 64bits, WinAVR-20100110, AVR Studio 4 and libpololu-avr-090605.

Please advice me on this.

Hello, Ben.

Is there any particular reason you want to use WinAVR and AVR Studio 4, and a version of our library from 2009? We recently switched our documentation over to use AVR Studio 5, which is newer and better. You can see the instructions in the Pololu AVR Programming Quick Start Guide.

Unfortunately, WinAVR doesn’t quite work with Windows Vista 64-bit and you have to modify it to make it work. If you want to pursue that instead of AVR Studio 5, this site will help you:

madwizard.org/electronics/ar … inavrvista

–David

Thank you for your prompt reply. i will try to fix it. hope it can works…