Dual SerialUSB and MIDI config possible?

Edwin_T

New member
I'd like to have 2 serialUSB and a MIDI port but in Arduino I can only select serial + MIDI or dual serial.

Can someone point me to the right direction (or confirm it's not possible at al)?

Thanks, Edwin.
 
Should be possible. You need to edit usb_desc.h inside {Arduino}/hardware/teensy/avr/cores/teensy4 (or teensy3 - there are 2 copies of this file). See the comments in the top of that file for instructions.
 
Thanks Paul,

It took some time but it seemes to work now. For others who read this, I added a 2nd Serial port to USB MIDI AUDIO SERIAL. To add this item to the menu in Teensy 4.0 ADD the next 2 lines in c:\Program Files (x86)\Arduino\hardware\teensy\avr\boards.txt

teensy40.menu.usb.serial2midiaudio.build.usbtype=USB_MIDI_AUDIO_DUAL_SERIAL
teensy40.menu.usb.serial2midiaudio=Dual Serial + MIDI + Audio

And the next lines to c:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\usb_desc.h

#elif defined(USB_MIDI_AUDIO_DUAL_SERIAL)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x048B
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'T','e','e','n','s','y',' ','D','S','e','r','i','a','l','/','M','I','D','I','/','A','u','d','i','o'}
#define PRODUCT_NAME_LEN 25
#define EP0_SIZE 64
#define NUM_ENDPOINTS 8
#define NUM_INTERFACE 8
#define CDC_IAD_DESCRIPTOR 1
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1 // Serial
#define CDC_ACM_ENDPOINT 2
#define CDC_RX_ENDPOINT 3
#define CDC_TX_ENDPOINT 3
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE_480 512
#define CDC_TX_SIZE_480 512
#define CDC_RX_SIZE_12 64
#define CDC_TX_SIZE_12 64
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1
#define CDC2_DATA_INTERFACE 3
#define CDC2_ACM_ENDPOINT 4
#define CDC2_RX_ENDPOINT 5
#define CDC2_TX_ENDPOINT 5
#define MIDI_INTERFACE 4 // MIDI
#define MIDI_NUM_CABLES 1
#define MIDI_TX_ENDPOINT 6
#define MIDI_TX_SIZE_12 64
#define MIDI_TX_SIZE_480 512
#define MIDI_RX_ENDPOINT 6
#define MIDI_RX_SIZE_12 64
#define MIDI_RX_SIZE_480 512
#define AUDIO_INTERFACE 5 // Audio (uses 3 consecutive interfaces)
#define AUDIO_TX_ENDPOINT 7
#define AUDIO_TX_SIZE 180
#define AUDIO_RX_ENDPOINT 7
#define AUDIO_RX_SIZE 180
#define AUDIO_SYNC_ENDPOINT 8
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS + ENDPOINT_TRANSMIT_ISOCHRONOUS
#define ENDPOINT8_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_ISOCHRONOUS
 
Hi guys,

I also need dual Serial + MIDI + Audio for Teensy 4.1
I've modified the files boards.txt and usb_desc.h (on my PC it's here : C:\Users\david\AppData\Local\Arduino15).
But the option never appears in IDE 2 for Teensy 4.1 but appears for the other boards.
Am I missing something ?

Thanks
Regards
 
Hi Kurt,

I've completed my post, I was presuming it was some caching issue as I see the option for the other boards if I change.
But still nothing for Teensy 4.1, let's try the workaround :)
 
The workaround fixes the problem in IDE.
Now I have to understand how to connect one device with webserial on one port, and IDE on the other port to show logs.

Well usbaudio is not working anymore.
 
Usb audio and midi with dual serial is working, the problem was in my web page code (javascript with webserial, webaudio and webmidi api).
 
Back
Top