arduino 0017 will not run mstimer2

Hello,

I have been using Arduino 0016 & the MsTimer2 library without any problem for the duemilanove w atmega328. so far so good.

after upgrading to 0017 i receive compiler errors, which indicate that the atmega328p is not defined, as a result the mcu is undefined & the library will not work.

any idea how to resolve this ?

s

What operating system are you on? Do you have the same problem if you remove the MsTimer2 library (or compile a sketch that doesn't use it)?

sorry for the delay

working on ubuntu linux 8.04

adnd yes indeed, it is not only mstimer2 but also the regular compile, where the atmega328p is not defined.

had no problems with mac os x 10.4.11 and arduino 0017

s

Hi,
the atmega328 on your ubuntu-version uses an older avr-gcc compiler-version which does not support the chip.

There are two ways to resolve this:
Upgrade to a more recent version of Ubuntu (8.10 at least).
(This should be easier than the second option...)

Check out the hints given towards the end of this thread
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238853601
the link to some external tutorials on this

Eberhard

thx,

will look into this - but then, why did I not have any problems using arduino 0016 on the same linux machine ?

s

why did I not have any problems using arduino 0016 on the same linux machine ?

Wasn't clear to me from what I've read.
You can compile for the atmega328 when using arduino-0016, but it fails when using arduino-0017?

Could you post a small example sketch and the error messages?
Eberhard

hi,

was busy the last weeks.

so I checked and indeed the same error messages occur if I compile any other program. for simplicity I took 'blink' from the sample libraries.

error messages abound:

unknown MCU 'atmega328p' specified

Known MCU names:

   avr2

   at90s2313

   at90s2323

   at90s2333

   at90s2343

   attiny22

   attiny26

   at90s4414

   at90s4433

   at90s4434

   at90s8515

   at90c8534

   at90s8535

   avr25

   attiny13

   attiny2313

   attiny24

   attiny44

   attiny84

   attiny25

   attiny45

   attiny85

   attiny261

   attiny461

   attiny861

   at86rf401

   avr3

   atmega103

   atmega603

   at43usb320

   at43usb355

   at76c711

   avr4

   atmega8

   atmega48

   atmega88

   atmega8515

   atmega8535

   atmega8hva

   at90pwm1

   at90pwm2

   at90pwm3

   avr5

   atmega16

   atmega161

   atmega162

   atmega163

   atmega164p

   atmega165

   atmega165p

   atmega168

   atmega169

   atmega169p

   atmega32

   atmega323

   atmega324p

   atmega325

   atmega325p

   atmega3250

   atmega3250p

   atmega329

   atmega329p

   atmega3290

   atmega3290p

   atmega406

   atmega64

   atmega640

   atmega644

   atmega644p

   atmega645

   atmega6450

   atmega649

   atmega6490

   atmega128

   atmega1280

   atmega1281

   atmega16hva

   at90can32

   at90can64

   at90can128

   at90usb82

   at90usb162

   at90usb646

   at90usb647

   at90usb1286

   at90usb1287

   at94k

   avr1

   at90s1200

   attiny11

   attiny12

   attiny15

   attiny28

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:1: error: MCU [ch8216]atmega328p[ch8217] supported for assembler only

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c: In function [ch8216]micros[ch8217]:

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:82: error: [ch8216]TCNT0[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:82: error: (Each undeclared identifier is reported only once

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:82: error: for each function it appears in.)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:88: error: [ch8216]TIFR[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:88: error: [ch8216]TOV0[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c: In function [ch8216]init[ch8217]:

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:178: error: [ch8216]TCCR0A[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:178: error: [ch8216]WGM01[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:179: error: [ch8216]WGM00[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:186: error: [ch8216]TCCR0B[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:186: error: [ch8216]CS01[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:187: error: [ch8216]CS00[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:193: error: [ch8216]TIMSK0[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:193: error: [ch8216]TOIE0[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:202: error: [ch8216]TCCR1B[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:202: error: [ch8216]CS11[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:203: error: [ch8216]CS10[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:205: error: [ch8216]TCCR1A[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:205: error: [ch8216]WGM10[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:211: error: [ch8216]TCCR2B[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:211: error: [ch8216]CS22[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:217: error: [ch8216]TCCR2A[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:217: error: [ch8216]WGM20[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:235: error: [ch8216]ADCSRA[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:235: error: [ch8216]ADPS2[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:236: error: [ch8216]ADPS1[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:237: error: [ch8216]ADPS0[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:240: error: [ch8216]ADEN[ch8217] undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:248: error: [ch8216]UCSR0B[ch8217] undeclared (first use in this function)

I have de-installed and installed the gcc-avr libs and it still does not work in my linux. any ideas ?

s

This has cropped up quite a lot.
The info here Pololu - Developing for the ATmega328P under Linux may help.

Hi again,

so instead of compiling my gcc, i upgraded to 9.04.

now, the same blink creates the following error messages:

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring_private.h:28:20: error: avr/io.h: No such file or directory

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring_private.h:29:27: error: avr/interrupt.h: No such file or directory

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring_private.h:30:23: error: avr/delay.h: No such file or directory

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring_private.h:31:19: error: stdio.h: No such file or directory

                 from /home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:25:

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'boolean'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:102: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'byte'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:110: error: expected ')' before 'mode'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:111: error: expected ')' before 'int'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:123: error: expected ')' before 'pin'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:125: error: expected ')' before 'dataPin'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.h:127: error: expected ')' before 'void'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c: In function 'millis':

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:66: error: 'uint8_t' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:66: error: (Each undeclared identifier is reported only once

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:66: error: for each function it appears in.)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:66: error: expected ';' before 'oldSREG'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:72: error: 'SREG' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:72: error: 'oldSREG' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c: In function 'micros':

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:79: error: 'uint8_t' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:79: error: expected ';' before 'oldSREG'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:82: error: 'TCNT0' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:88: error: 'TIFR' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:88: error: 'TOV0' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:93: error: 'SREG' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:93: error: 'oldSREG' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c: In function 'delayMicroseconds':

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:111: error: 'uint8_t' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:111: error: expected ';' before 'oldSREG'

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:155: error: 'oldSREG' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:155: error: 'SREG' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c: In function 'init':

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:178: error: 'TCCR0A' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:178: error: 'WGM01' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:178: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:179: error: 'WGM00' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:179: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:186: error: 'TCCR0B' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:186: error: 'CS01' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:186: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:187: error: 'CS00' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:187: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:193: error: 'TIMSK0' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:193: error: 'TOIE0' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:193: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:202: error: 'TCCR1B' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:202: error: 'CS11' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:202: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:203: error: 'CS10' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:203: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:205: error: 'TCCR1A' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:205: error: 'WGM10' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:205: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:211: error: 'TCCR2B' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:211: error: 'CS22' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:211: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:217: error: 'TCCR2A' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:217: error: 'WGM20' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:217: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:235: error: 'ADCSRA' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:235: error: 'ADPS2' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:235: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:236: error: 'ADPS1' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:236: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:237: error: 'ADPS0' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:237: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:240: error: 'ADEN' undeclared (first use in this function)

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:240: error: lvalue required as left operand of assignment

/home/reinhard/Desktop/arduino-0017/hardware/cores/arduino/wiring.c:248: error: 'UCSR0B' undeclared (first use in this function)

so is now the problem in wiring ?

thanks for your help

s

Hi,
looks like package avr-libc is not installed (or wasn't upgraded?)

Install the package "avr-libc" with adept or apt-get because the install process creates some links to the library so the compiler can find them.
Eberhard