Pages: [1] 2 3   Go Down
Author Topic: Mega - serial1, 2 und 3 - initialization fails  (Read 7477 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I just got the Arduino Mega - works perfectly, but not the serial communication.
As long as i reference the serial communication package, the sketch does not run after uploading.
Note that the Mega has 4 serial interfaces and ATmega1280.
I downloaded the latest software 0017, but the same result.
Luckily after commenting out the initialization of serial1, 2 and 3 in hardware/core/arduino/HardwareSerial.cpp lines 216 to 218 (version 0017), it worked at least with first Serial port.
Seems the initialization of serial1,2 and 3 crashes.

Till now i would use only one serial, but it would be good to have the rest also working.

And some info:
running openSUSE 11.1 (i586)

SUN jre:
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)

AVR:
avr-libc-1.6.7-4.1
cross-avr-gcc44-4.4.1_20090722-19.1
cross-avr-binutils-2.19.51-15.2
avrdude-5.5-137.6

Regards,
Kompi
« Last Edit: August 12, 2009, 11:53:12 am by kompi » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Anyone having the arduino mega with successfully initialized serial interface?
Or should i better return it as deffect?
I still hope it is software issue.

Regards,
Kompi
Logged

Toronto, ON
Offline Offline
Full Member
***
Karma: 10
Posts: 233
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Working great here.

You should post your code and we can have a look at what is going on.

b
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Which OS are you running? I can try with the same version as yours.
I will also try the windowz version tomorrow.

Actually there is no real code, even this hangs:
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  Serial.println("Hello world!");
  delay(1000);
}
Logged

Toronto, ON
Offline Offline
Full Member
***
Karma: 10
Posts: 233
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I know this may sound silly (like "make sure it's plugged in" kinda silly), but are you sure you've selected the right board in the IDE?

Tools->Board->Arduino Mega

Don't shoot me for asking.  I've made the mistake myself a few times.

b
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sure, i have selected the right board,
when commenting out the serial1,2,3 object initialization (HardwareSerial.cpp), the first serial works fine alone

are you running your IDE on Windows?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Running version 17 and windows xp sp3. I tested my mega with a simple sketch that outputs on serial port and one other of the three remaining mega serial ports (serial2,3,4, there is no serial1 port, it's just called serial in software).

I was able to get a simple sketch to stream data out two serial ports at a time and tested that all three of the extra serial ports worked. I used the IDE serial monitor to watch the serial port and used a TTL/RS232 convertor module to monitor the additional active serial(x) port using a PC terminal program on a comm port. Everything seems to work fine.

Lefty
« Last Edit: August 25, 2009, 02:19:55 am by retrolefty » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 113
Arduino paper
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Running XPSP3 and also Vista 64 and Win7 (7100) and haven't tried more than three Serial's in 0017(Serial, Serial2-3) yet, but under 0016 I had all 4 running (Serial, Serial1-3)

No problems here.
Logged

Checkout my projects development blog @ SLiDA

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I just tried it under windows and it runs fine.
So it seems it is a linux problem - i have the latest versions of avr* .
I will invest some time looking for differences and comparing versions.

Just noticed:
The windows version has: gcc version 4.3.2 (WinAVR 20081205)
and i have the 4.4.1 under linux.

Is it worthy to check the latest avr-gcc under windows?

What OS are using the Arduino team for development and testing?
Think it is better to use the same or?

Cheers
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just downgraded to gcc 4.1.3 and the serial seems to work now.
Versions:
cross-avr-gcc-4.1.3_20080612-26.5
cross-avr-binutils-2.19-9.1
avr-libc-1.6.1-1.15
avrdude-5.5-111.33
Logged

Toronto, ON
Offline Offline
Full Member
***
Karma: 10
Posts: 233
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Strange.

I got your PM, and I've uploaded a compiled version of the ASCIITable example:

http://www.mediafire.com/Arduino
under Compiled Examples


Can you provide a listing for the .elf file from the 4.4.1 avr-gcc compile?  Or just send the .elf file.  Either way.

To create a listing file: avr-objdump.exe -h -S filename.elf

b
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

major difference:
working version: the constructor is a function
non-woking: the constructor is expanded 4 times - inlined
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@bhagman: you have the dump as PM
Logged

Bavaria Germany
Offline Offline
Full Member
***
Karma: 0
Posts: 121
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has somebody a solution in the meanwhile?

I have same issue in Linux on a seeeduino mega.

Thanks for any hints,
mmi
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The solution for the moment is actually 2 or 3 responses up - I had same issue under 64bit linux.  It turns out to be a problem if you take too new a version of the avr compiler software from your distro - downgrade to the version mentioned a couple posts up and it will magically start working for you smiley
Logged

Pages: [1] 2 3   Go Up
Jump to: