Leonardo: What's the TX/RX details of a PC warm boot?

I've noticed that the TX and RX lights do "stuff" when the Windows PC is warm booted.
(This would be great to wire up to an alert buzzer!)

I wanted to see what was being sent and received, but so far had no success.

I tried several things, like maybe the PC sends a break command so the USB device doesn't activate just yet?

So I tried SerialUSB.readBreak() , and I've tried writing to the Serial port and checking the buffer length returned by Serial.availableForWrite() it doesn't change even while rebooting the PC which was surprising, and another couple of unsuccessful attempts with Serial.

Something's being transmitted, and received - but I'm wondering now if there's anything I can detect via the Leonardo's software, maybe it's just too low level?

I'm looking into the HID library now, but it's all just a guess without knowing the data being sent/received between the Leo and PC. Is it a Pause? Is it an enumeration? Is it a reset? I've got no idea!

I'd love to learn what's going on, if anyone's got any ideas?

What follows is pure conjecture based upon a few minutes of looking at the Arduino core code.

It looks like the LEDs are being controlled from USBCore.cpp (the macros TXLED1 and RXLED1 turn the LEDs on and they are turned off in an interrupt service routine, or so it seems). I'm not sure this is done in software for all boards and I'm not even sure this is the case for the Leonardo.

You could try to disable the macros, if this has any effect, then you should be able to intercept the traffic, I don't think this is serial data by the way, but some low level initialisation stuff.

Again, these are only guesses.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.