USBHOST_PRINT_DEBUG not working?

Status
Not open for further replies.
Hi, I'm trying to gather some USB host information by uncommenting this line in the Teensyduino application code: https://github.com/PaulStoffregen/U...3fe5bd8fe689b7c8f60451e9fed/USBHost_t36.h#L62

I'm just trying to run the Teensy example code "EchoBoth" to verify it works, but so far I haven't been able to get any USB host debug information. The serial monitor is completely blank when plugging in and unplugging the USB cable from either the board or the computer. Is there something else I need to do to get that information aside from just uncommenting that line in the application?

Board: Teensy 4.0
Teensyduino version: 1.54 for Mac OS
Edited the file at path .../Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h
 
Last seen that worked.

Make sure the code edited is the code being compiled :: put a syntax error there and build and confirm the build breaks as expected

Code:
// Uncomment this line to see lots of debugging info!
#define USBHOST_PRINT_DEBUG

the earth is FLAT
 
As @defragster mentioned, make sure to uncomment that line, and then make sure that the build shows it is using the copy of the library you think it is... That is if you have a local copy in <arduino sketches folder/libraries/...
That one would be used over the one that Teensyduino installs.


Note: The Teensy example EchoBoth has nothing to do with the USBHost_t36 library... It simply tries to echo stuff from Serial to Seria1 (pins 0 and 1)...

as such it does not have any USB Host stuff included in it and as such there will not be any USBHost debug information
 
Good notes @KurtE - first pass was syntax error not showing ...

In a Verbose output Build the libraries used will be shown and it seemed to be non-Windows install.

Also not sure of what USB_Host required sketch was in use.

Perhaps I wrongly inferred is was this one :: {local install}\hardware\teensy\avr\libraries\USBHost_t36\examples\Serial\Serial.ino

When enabled, as above, that one ejects extra DEBUG notes.
Code:
USB Host Testing - Serial
[B][COLOR="#FF0000"]USB2 PLL running
 reset waited 6
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20005000
periodictable = 20005000[/COLOR][/B]
 
Thanks so much for the help here! Changing to the USBHost_t36 Serial.ino example worked like a charm. Before doing that, adding in the syntax error to the USBHost_t36 file did not cause any issues, so it looks like it really wasn't compiling with that header at all before.

I think I am a little confused on when that library is actually included in the compilation. If my code doesn't directly include that header, is it safe to assume it won't be included at all? Or is that library included often in some other common libraries?

Thanks again for the help, I really appreciate it!
 
The IDE build system scans the sources to decide what libraries to pull in.

That shows in the Verbose build console output. Any outside library detected will be displayed and then built for inclusion.

Generally anything not used will be excluded.
 
Got it, thanks! So utilizing the verbose built console output in the future will save a lot of time in determining whether I'm really even using that code then. Makes sense! Thanks again.
 
Status
Not open for further replies.
Back
Top