Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Dual SerialUSB and MIDI config possible?

  1. #1
    Junior Member
    Join Date
    Feb 2021
    Posts
    3

    Dual SerialUSB and MIDI config possible?

    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.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,810
    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.

  3. #3
    Junior Member
    Join Date
    Feb 2021
    Posts
    3
    Thanks! I'll try and post results here.

  4. #4
    Junior Member
    Join Date
    Feb 2021
    Posts
    3
    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=U SB_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\us b_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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •