USB Device: Serial + MTP possible?

Status
Not open for further replies.

Ralf K.

Member
In the menu to select the function of the USB device there are many options that include an additional serial function. Would this be possible with a MTP device, too?

Bonus question: Can the function of the USB device changed at runtime or are they fixed based on what is selected in the menu?
 
Bonus question - Probably anything is possible, but without a whole lot of work... It is pretty well fixed to the menu. But you can go in and make a custom version, by editing the core code to define all of the descriptors and the like.

MTP Plus Serial - Right now the builds are setup that they support the Serial Emulation code base. That is if you connect up to the Arduino Monitor (Teensy version), you can connect up and do Serial inputs and outputs. Also I have put code into USBHost_t36 library (merged within the last few days) that has SEREMU support and likewise TyCommander has it as well.

But @WMXZ has some setup for MTP plus Serial which is not integrated into the builds. It uses one of the other Predefined Product IDS for Teensy. But in the MTPD directory there are directories, with files that you can use to update the boards.txt to add that option, plus files for T3.x and T4.x that update the usb descriptor header file for these options.
 
Thank you very much both of you. At the moment I am fine with knowing that it is possible as I need to implement*another part of the project first.
 
A year or so back a user asked about starting as one of two USB interfaces - IIRC.
>> Thanks to SublimeTest - search of my sketches shows the EEPROM read testing done here 8/29/2018 - and putting forum thread link in that sketch :: Configure-USB-after-sketch-has-already-loaded

Offered some help where early in startup - before USB_init a reference point was checked ( EEPROM setting ) - then USBinit used one list or the other to present the desired interface when repowered.

That required a restart and some edits in the CORES code. It was not tried/tested here and feedback was limited ( no complete code) but said it worked. Though that is in a deleted post:
Yup, that is based on an EEPROM read. I ensured that the EEPROM was only ready once. In the few tests that I did, it was reliable. If I notice an oddities, I'll let you know.

IIRC :: Have seen in the MTP code that a call to USBinit during runtime refreshed the view of MTP information to the HOST? Not sure if that would work to allow "function of the USB device changed at runtime"?
 
Thanks, defragster, for the hint. Changing the USB device at runtime is more of a long term idea but it is good to know that there might be a way to do it.
 
Status
Not open for further replies.
Back
Top