USB as standard debug interface

If you include a unique serial number for the USB device, and the FT232R has this provision, this problem does not exist. Once assigned, the COM port number is linked to that device, no matter which USB port you plug it into.

Meindert

Reply to
Meindert Sprang
Loading thread data ...

Has anyone used the USB debug feature that is described in Appendix C of the EHCI spec? It's been in the spec for over a decade now, but I only found out about it recently.

Brief description: EHCI controllers have an optional "USB debug" mode in which the USB transceiver can be used to communicate with another similarly configured device, with an internal interface that's not much more complicated than that of a UART, the intention being to replace the function of a UART for debugging without needing a USB protocol stack. The mode is optional, but seems to be supported on USB port 0 of all Intel devices with USB.

EHCI spec:

formatting link

Example gizmo (to connect two USB debug ports):

formatting link

There's info here showing that this mode is supported on devices from a number of manufacturers:

formatting link

Regards, Allan

Reply to
Allan Herriman

You missed out LED (+ current limiting resistor) connected to a GPIO pin. :-)

Great for debugging interrupt routines.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
Reply to
Simon Clubley

Thank you, I am aware of that. Can do it on my own devices (not always,) but not with other products like the COTS USB to RS-232 dongle I used recently.

Searched for a while for a way to change the COM numbers programmatically, but did not get far. Found a bunch of registry entries that I could not delete. (on Windows XP)

-- Roberto Waltman

[ Please reply to the group. Return address is invalid ]
Reply to
Roberto Waltman

I had trouble with an XP-Embeded project where the PC will attempt to boot from the mouse, keyboard, etc. ignoring the only USB mass storage device connected. (Also ignoring any BIOS settings controlling enabled boot devices, their order, etc.) The workaround was also to add harware to disable some of the USB ports and re-enable them under application control, well after the XP boot process.

-- Roberto Waltman

[ Please reply to the group. Return address is invalid ]
Reply to
Roberto Waltman

true

But not as good as an ICE or LA

The problem is you never really know what caused the LED to light.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
 Click to see the full signature
Reply to
Chris H

That's a Logic Analyzer :)

Mel.

Reply to
Mel

Luxury! We had to debug in a darkened room with the off the MCU watching the gates glow as they switched working with a print out of the assembled (wot's a compiler?) binary......

You tell that to the kids these days and they don't believe you.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
 Click to see the full signature
Reply to
Chris H

Interesting. Thanks!

Any reason that you're aware of (or bad things that may happen) if the serial enumerator is de-selected for all virtual COM ports?

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

On many platforms, ICE is useless for things like timeing measurement. An LED (or better yet a few of them) works brilliantly for timing measurements.

While I suppose that's true in a theoretical sense, it's not true in a practical sense. In the real world (at least the one I work in), you do know what cause the LED to light.

--
Grant Edwards               grant.b.edwards        Yow! I'm EMOTIONAL
                                  at               now because I have
 Click to see the full signature
Reply to
Grant Edwards

I remember debugging code on the ZX Spectrum by the buzzing sound of its power supply...

Reply to
David Brown

And don't forget the burnt finger technique for hardware debugging.

Reply to
David Brown

Saddly gone, in this world of ball-grid-arrays and surface-mounted devices.

We do it when forced to. But still the simplicity of uart + RS-232 is hard to beat. My 2nd choice would be CAN, but it is not available everywhere and in most cases cannot justify adding an externacl CAN controller to a design.

-- Roberto Waltman

[ Please reply to the group. Return address is invalid ]
Reply to
Roberto Waltman

Assuming they are available for the part AFAIK the ONLY thing that is any good for timing measurements are ICE or LA.

No you don't you only think you do.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
 Click to see the full signature
Reply to
Chris H

Happy days.......

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
 Click to see the full signature
Reply to
Chris H

Yep. We make products with COM ports on USB. My dev computer is up to COM63. It is just a matter of time when you hit some upper limit of who knows what.

JJS

Reply to
John Speth

That goes back, though I can't recall doing that with my ZX81 (which I still have around, by the way.) And not as far as

1975 when I would debug my Altair 8800 programs using a nearby AM radio and using the tuning to select different parts of the program during debugging. (True, by the way.)

Jon

Reply to
Jon Kirwan

Used that. Sadly, the damned 1488 was always VERY HOT. Hard to know, with that infernal thing. At least the 1489 wasn't so bad.

Jon

Reply to
Jon Kirwan

Ok, it's time for me to learn something new because I don't know what you are getting at.

Example setup: GPIO pin, with LED + resistor attached, is configured for output and is set low by writing a zero to the appropriate bit in the appropriate GPIO register at program startup.

The interrupt handler sets the appropriate bit in the GPIO register when it's called, causing the LED to light and hence signalling that the interrupt handler has been triggered.

Question: Why can't I assume that the interrupt handler has been successfully triggered ?

If you are arguing that the code could scribble over the register causing the LED to light at random, then I accept it's possible in theory, but in practice, I have never seen a bug like that in my code.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
Reply to
Simon Clubley

Me neither.

I've been using that assumption for 30 years. It's never been wrong yet.

Same here.

--
Grant Edwards               grant.b.edwards        Yow! over in west
                                  at               Philadelphia a puppy is
 Click to see the full signature
Reply to
Grant Edwards

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.