0
votes

looking for some help with a USB device I have which has 2 interfaces. The first interface is HID and the second is MSC. I'm developing with an STM32F415VG and am trying to set it up as a USB host. Basically, I can communicate with the USB device without any problems. I can mount FAT and can read from the device fine, but I don't seem to be able to write to it. A little bit of further digging in the descriptors has helped me find that the interface I need(MSC) uses the same endpoint address for in(0x81) and out(0x01). All other devices I've tried with my USB host seem to use different addresses (usually 0x81, 0x02). I'm starting to think this might be the issue. Has anyone else encountered anything similar or able to confirm my hypothesis? Here's a copy of my endpoint descriptors in case it helps:

Ep_Desc[0]  0x2000c230  
    Ep_Desc[0][0]   {...}   
        bLength             0x7 
        bDescriptorType     0x5 
        bEndpointAddress    0x82    
        bmAttributes        0x3 
        wMaxPacketSize      0x8 
        bInterval           0x5 
    Ep_Desc[0][1]   {...}   
        bLength             0x7 
        bDescriptorType     0x5 
        bEndpointAddress    0x2 
        bmAttributes        0x3 
        wMaxPacketSize      0x8 
        bInterval           0x5 

Ep_Desc[1]  0x2000c240  
    Ep_Desc[1][0]   {...}   
        bLength             0x7 
        bDescriptorType     0x5 
        bEndpointAddress    0x81    
        bmAttributes        0x2 
        wMaxPacketSize      0x40    
        bInterval           0x0 
    Ep_Desc[1][1]   {...}   
        bLength             0x7 
        bDescriptorType     0x5 
        bEndpointAddress    0x1 
        bmAttributes        0x2 
        wMaxPacketSize      0x40    
        bInterval           0x0 
1
That's not your issue. The endpoint direction bit forms part of the address so 0x01 and 0x81 are different addresses. If your firmware thinks otherwise then it's buggy.Andy Brown
Ah okay, guess I had misunderstood that. Back to square one then! Cheers!chadianscot

1 Answers

0
votes

I can mount FAT and can read from the device fine

Both In and Out EPs must work for you to be able to read from a MSC device. Otherwise the PC would not even detect it correctly.

I have a µC based MSC devic here, and it uses the same EP for MSC In and Out, too.

I don't seem to be able to write to it

Check the code where stuff is actually written to.