Pages: [1]   Go Down
Author Topic: Leonardo doesn't talk to serial monitor in windows 7  (Read 2677 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The folllowing code talks to the serial monitor when I use an XP machine, but not when I run windows 7. I am using a leonardo rev 3
Code:
//Leonardo test 1 -- check serial i/o

void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  digitalWrite(13,HIGH);
  while(!Serial){}
  digitalWrite(13,LOW);
}

void loop(){
  int i;
  Serial.println("Ready:");
  for(i=1;i<11;i++) {
    digitalWrite(13,HIGH);
    delay(500);
    Serial.println(i);
    digitalWrite(13,LOW);
    delay(200);
  }
}

Any suggestions?
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

did you load the USB <> serial port driver on the windows 7 machine?
Logged


Offline Offline
Full Member
***
Karma: 9
Posts: 109
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Believe it or not: I observe exactly the opposite: your sketch runs fine on my windows 7 sp1  but it does not work on win xp pro sp 2!

 I am also investigating problems related to the leonardo's virtual comm port in combination with windows (on linux, the leonardo works great). See here http://arduino.cc/forum/index.php/topic,118090.15.html. This is really driving me crazy.
Logged

Offline Offline
Full Member
***
Karma: 9
Posts: 109
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@wmassano: on your win 7 it does not talk to the serial monitor, but does it blink?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here are my replies to the three responders:
1.The serial port via usb works since I can program the leonardo. I just can't make it see the serial port when I use the monitor.
2. It's been driving me nuts for a couple of weeks. I hit it when I was building the 4 wheel robot I got from Makershed. I though it was a bad board and replaed it with an Uno which works fine. It's just leonardos (I have tried more than one). I'm going to try it on another win7 machine and see if it is my netbook that's the problem.
3. I'm not sure what you mean by blink. When the monitor starts, the yellow led blinks as it reestablished the comm port, then the RX light blinks once or twice, then nothing. It is hanging at the while(!Serial). It never gets confirmation that Serial is true. (when I take that out the sketch runs but still no serial monitor).

Any other ideas????
Logged

Australia
Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have also had a bad response from the Leonardo but only when using an external programmer.

See my post Arduino V 1.0 and later

Uploading with the bootloader gives a good O/P and no issues, but a programmer seems a bad idea with the Leonardo.

My Freetronics Elevens, ether2560's,even a 2560 mega breakout ex Sparkfun are all fine, all but the Leonardos (I have 3 - they all misbehave when programmed with a programmer).

The Leonardo behaves the same way with XP and Win7 when using a programmer, so it surely can't be that all the OS's and drivers are corrupt, but moreso an issue in the Leonardo architecture.

I'm harping on progammers but I need ISP uploads not usb.

But we try different MCU's, then find one that works for what we want it to do. It's the same with PC's, you buy one that can do the job and not all PC's will work the same, as we all know.

So we need to work out which MCU will do a particular job - so you might end up with a few different types.
Logged

0
Offline Offline
God Member
*****
Karma: 26
Posts: 606
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Believe it or not: I observe exactly the opposite: your sketch runs fine on my windows 7 sp1  but it does not work on win xp pro sp 2!

Yes, that I do believe.

Microsoft added support for the special interface association descriptor Leonard uses, in XP SP3 and Vista SP1.  The Leonardo bootloader does not use IAD, so XP SP2 can probably recognize Leonardo and upload code, but only when it's running the bootloader.

Windows XP SP2 (and Vista before SP1) can not recognize a USB composite device with Serial (CDC-ACM protocol) and Keyboard (or any other HID).  Neither can Mac Leopard or Snow Leopard.

Actually, there are ugly hacks that allow these combinations to work on either system.  In the early days of developing Teensy (before Apple released Snow Leopard, not to mention Lion, and XP SP3 was still pretty new) I put a lot of work into trying to find any combination that would work on both.  I never found it, and all ways that worked on either violated the USB standards.  Teensyduino implements an emulated serial channel when using Keyboard.  Shortly after Apple released Lion, I added an option for Keyboard plus real Serial, which of course doesn't work on the older systems.

Leonardo was announced several months after Mac Lion was released, and XP SP3 was of course very well established.  It's never really needed to support these older operating systems.



Logged

Offline Offline
Full Member
***
Karma: 9
Posts: 109
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That is great information, Paul. In my opinion, it should be added to the documentation (the minimum SP for windows, the minimum os version for mac). A classic arduino probably works on almost every windows version, for the leonardo, this appears not to be the case.

So the right thing to do for me would be to get SP3. But I should have done that a couple of years ago, now it may not be worth the effort and the risk that this old pc does not survive the upgrade. On the other hand that pc still works well and hapilly deals with my duemilanove, pic18F4550 (also cdc/acm) and the leo's bootloader.

So I thought my Leonardo sketches should work as well if I ran them as "serial only" usb devices (non composite, so no iad needed).

The code allows to do this with only a few ifdefs:
in USBDesc.h:
#define CDC_ENABLED
//#define HID_ENABLED
...
#if defined HID_ENABLED && defined CDC_ENABLED
#define COMPOSITE_DEVICE
#endif


in USBCore.h:

#ifdef COMPOSITE_DEVICE
        IADDescriptor                           iad;    // Only needed on compound device
#endif

in CDC.cpp:

const CDCDescriptor _cdcInterface =
{
#ifdef COMPOSITE_DEVICE
        D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,1),
#endif
...

I compiled the sketch again and made a .inf file by copying the UNO's in file and adjusting the PID. This made the sketch run on the old xp sp2 box. I also managed to burn hex files via ArduinoISP into an attiny on the same pc.

I hope this does not sound like cursing to the developers who have put lots of effort to make composite devices work. But I believe this idea makes sense:
  • it is simpler.
  • because of this, it does work on all these old os'es without ugly hacks or spec violations.
  • in many occasions you only need either one of the interfaces, not both.
  • you win about 1K code size (dropping hid support).

Thanks a lot for sharing this. I started to investigate the problem but could not make sense of it. Windows installed the driver without error but the resulting behavior was really weird.



Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just downloaded 1.0.3 and the leonardo talks to the serial monitor!!! Now I can get back to work. Thanks to all who made suggestions
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see this is a pretty old post but figured I start here as I have the same problem with xp.

Was hoping somebody had a definitive solution other than trying a different PC or operating system. I tried the 1.0.3 with similar results but I have to believe it has something to do with the set up of the USB device by windows.

Thanks in advance for an help!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Upload the latest update 1.0.5. It fixed my problems
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I started with the 1.0.5 with no success


Update-7/8/2013

So I have tried to update my system as well but looks like its all set and even tried the 1.5.2

After some more searching I came across this bit and I am not smart enough to work it out.

https://github.com/arduino/Arduino/issues/1289

Looks like it was done 4 months ago and ffissore says he will add it into the next 1.5.X does this mean 1.5.3 or is it in the 1.5.2?

Any other suggestions? Would really like to get this running on my machine as I am not really in a position to go buy another PC. Although maybe going to an UNO would just be better at this point.
« Last Edit: July 08, 2013, 01:20:39 pm by J10 » Logged

Pages: [1]   Go Up
Jump to: