Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USBH_MIDI : Failing to get device descriptor with some devices. #17

Open
soulwyx opened this issue Apr 8, 2021 · 1 comment
Open

USBH_MIDI : Failing to get device descriptor with some devices. #17

soulwyx opened this issue Apr 8, 2021 · 1 comment

Comments

@soulwyx
Copy link

soulwyx commented Apr 8, 2021

USBH_MIDI : Failing to get device descriptor with some devices.
The problem is at line 163 from USBH_MIDI.cpp: (Init)
rcode = pUsb->getDevDescr( 0, 0, sizeof(USB_DEVICE_DESCRIPTOR), (uint8_t*)buf );

With some devices work fine, and with others doesn't.
(return 0 when successful ; 8 when error )

Looking deep, the problem come from:
Line 206 from USB.cpp
rcode = dispatchPkt(tokSETUP, ep, nak_limit); // Dispatch packet

Any tips?

I can get device descriptor of any devices without using USBH_MIDI (without creating USBH_MIDI class)
I can get device descriptor from my PenDrive, and return that isn't a MIDI Device.
I can't get device descriptor from my Mouse by example, returning the RCODE equal 8.
My Zoom G3 works fine. My Nux MG300 doesn't.

@soulwyx
Copy link
Author

soulwyx commented Apr 9, 2021

I got it:

I got it!
I need to do many things:
Let's explain:
Need to remove Release from USBH_MIDI.h
//virtual uint32_t Release();
and

/*
uint32_t USBH_MIDI::Release()
{
        pUsb->GetAddressPool().FreeAddress(bAddress);
        bNumEP       = 1;               //must have to be reset to 1
        bAddress     = 0;
        bPollEnable  = false;
        readPtr      = 0;
        return 0;
}*/

Plus:

#define DESC_BUFF_SIZE        512
#define MIDI_EVENT_PACKET_SIZE 128

Without Release();
I have some fails when pluggin a device. And I always must restart my board to connect another device.

Do you have any suspicions to explain this? I want to understand.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant