Skip to content

Multi MIDI Device with RP2040 #1295

Closed
Closed
@DatanoiseTV

Description

@DatanoiseTV

Operating System

Linux

Board

Raspberry Pico

Firmware

examples/device/midi_test with modifications

What happened ?

When trying to add multiple MIDI ports, the device will enumerate, but aconnect won't show MIDI ports anymore.

How to reproduce ?

  1. Clone the midi-test example
  2. Change #define CFG_TUD_MIDI 4 in tusb_config.h
  3. In usb_descriptors.c add..
To enum:
  ITF_NUM_MIDI_0 = 0,
  ITF_NUM_MIDI_STREAMING_0,
  ITF_NUM_MIDI_1,
  ITF_NUM_MIDI_STREAMING_1,
  ITF_NUM_MIDI_2,
  ITF_NUM_MIDI_STREAMING_2,
  ITF_NUM_MIDI_3,
  ITF_NUM_MIDI_STREAMING_3,

#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + (TUD_MIDI_DESC_LEN * CFG_TUD_MIDI))

#define USBD_MIDI_0_EP_OUT 0x01
#define USBD_MIDI_1_EP_OUT 0x03
#define USBD_MIDI_2_EP_OUT 0x05
#define USBD_MIDI_3_EP_OUT 0x07

#define USBD_MIDI_0_EP_IN 0x81
#define USBD_MIDI_1_EP_IN 0x83
#define USBD_MIDI_2_EP_IN 0x85
#define USBD_MIDI_3_EP_IN 0x87

uint8_t const desc_fs_configuration[] =
    {
        // Config number, interface count, string index, total length, attribute, power in mA
        TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),

        // Interface number, string index, EP Out & EP In address, EP size
        TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI_0, 0, USBD_MIDI_0_EP_OUT, USBD_MIDI_0_EP_IN, 64),
        TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI_1, 1, USBD_MIDI_1_EP_OUT, USBD_MIDI_1_EP_IN, 64),
        TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI_2, 2, USBD_MIDI_2_EP_OUT, USBD_MIDI_2_EP_IN, 64),
        TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI_3, 3, USBD_MIDI_3_EP_OUT, USBD_MIDI_3_EP_IN, 64),

    };

Debug Log

No response

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions