No need, since there is already error reporting facilities within the code.
These even work from within the ISRs, and heap is ISR safe-- meaning you can abuse this fact and use printf
First, many thanks for the reply and for your efforts in creating this library.
What I was finding was that the code thought things were okay, but something outside of its awareness wasn't working for the peripheral. At this point I think really attacking that problem would either require finding a hardware USB analyzer, making an instrumented peripheral that reports what it is seeing, or going through the code over and over until I understand it all in comparison with the programming manual.
I've actually now tried an entirely different, non-teensyduino codebase on the teensy hardware, based on a port of the mbed libraries, and that worked partially in getting a reply from the peripheral to its first operation, and continuing to get unsolicited responses thereafter, but subsequent commands were ignored. Interestingly the same application code worked for me both with KL25Z and STM32F4 backends in successfully operating the peripheral. I ultimately removed the PTC fuse from the teensy and replaced it with a 0 ohm shunt, so I'm satisfied it is not a power problem, especially as the result was substantially cleaner power routing than in my successful experiments on other boards.
I spent yesterday learning about oddities of the K20 family (splitting your ram
evenly about 0x20000000 is, shall we say,
novel) and trying to get something to function as enough of a CMSIS-DAP interface to bring up an MK20DX64 on my own board. It's definitely being a learning curve, but having USB host capability in a low end micro (ultimately right down to their 32-QFN M0's which would be the next project) is worth some adjustment.
So, while I'm no longer pursuing trying to do USB host stuff on the Teensy at this precise instant in time, I'd remain interested in the progress of it - always good to know of the options.
UPDATE: overcame some configuration and broken-trace issues and got home-made MK20DX64 board running, but unsurprisingly the mbed-derived USB host code does the exact same "almost but not quite" as it does running on the Teensy. Didn't try to port xxxajk's code to try. Sometime hopefully I'll figure out what is really going on with the K20 USB peripheral, but for now I" think I'm going to switch to making a smaller board for the MKL25Z's, since the build for the KL25Z freedom worked fine.