This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Implementing a class-compliant USB MIDI device

Hi everyone,

I'm trying to developp a MIDI USB class compliant device with the nrf52840 DK.

I'm beginner about USB developpement and I have only basics about MIDI class definition.

I'm trying to modify the usbd_audio example of the SDK 15.1 to describe my MIDI class. Unfortunately, I'm not sure that I understand how the Audio class module works, especially the macro APP_USBD_AUDIO_MIDI_STREAMING_DSC and APP_USBD_AUDIO_GLOBAL_DEF and how to manage them to fully describe my MIDI class.

Do you have an example ? If not, what is the best way to implement this feature ? For the moment, I just need that my computer detect my device as MIDI device and send a MIDI control change to my PC from my developpement board.

Thank you in advance,

Mathieu

Parents
  • Hello,

    I am also working on a MIDI over USB version for the nRF52840.
    I have adapted the declarations and the USB enumeration works correctly. The host software recognizes my card as a MIDI device.

    However, I have a problem with sending and receiving data....
    Obviously the endpoints I use are not enabled for the NRF!

    For example, when I try to send via the app_usbd_ep_handled_transfer function, it returns NRF_ERROR_INVALID_STATE to me because of the nrf_drv_usbd_ep_enable_check(ep) test (line 1835 of app_usbd.c)

    I think there is a concern about the init of part of the USB communication...
    I noticed that I only have one call to the setup_event_handler() function with setup.bmRequestType = 128, whereas if I understand the principle correctly there should be several calls to initialize the endponits.

    If needed I can send an example of my code.

    Regards,

    Gaétan

Reply
  • Hello,

    I am also working on a MIDI over USB version for the nRF52840.
    I have adapted the declarations and the USB enumeration works correctly. The host software recognizes my card as a MIDI device.

    However, I have a problem with sending and receiving data....
    Obviously the endpoints I use are not enabled for the NRF!

    For example, when I try to send via the app_usbd_ep_handled_transfer function, it returns NRF_ERROR_INVALID_STATE to me because of the nrf_drv_usbd_ep_enable_check(ep) test (line 1835 of app_usbd.c)

    I think there is a concern about the init of part of the USB communication...
    I noticed that I only have one call to the setup_event_handler() function with setup.bmRequestType = 128, whereas if I understand the principle correctly there should be several calls to initialize the endponits.

    If needed I can send an example of my code.

    Regards,

    Gaétan

Children
  • Hello Gaétan,

    Please check why nrf_drv_usbd_ep-enable_check(ep) returns what it does. It should be in nrf_usbd.h (you may need to copy it out to the app_usbd.c file in order to debug it).

    Please create a new ticket where you describe your progress and your issue. I'll be out of office for a couple of weeks, so this ticket is not looked after.

Related