USB PMA addresses

Post here first, or if you can't find a relevant section!
arpruss
Posts: 156
Joined: Sat Sep 30, 2017 3:34 am

Re: USB PMA addresses

Post by arpruss » Mon Jan 29, 2018 5:04 am

Looking at the code in the core, the management endpoint is configured for device-to-host communication, but there is no code to actually send anything through this endpoint. That's why we haven't run into any problems with this bug. In particular, it should be safe to reduce the size to 0x10, since we don't use it at all. :-)

victor_pv
Posts: 1871
Joined: Mon Apr 27, 2015 12:12 pm

Re: USB PMA addresses

Post by victor_pv » Mon Jan 29, 2018 10:56 pm

arpruss wrote:
Mon Jan 29, 2018 5:04 am
Looking at the code in the core, the management endpoint is configured for device-to-host communication, but there is no code to actually send anything through this endpoint. That's why we haven't run into any problems with this bug. In particular, it should be safe to reduce the size to 0x10, since we don't use it at all. :-)
Didn't check today, but when I checked the other day I thought only the TX endpoint is configured. Since USB names TX and RX from the host perspective, a TX endpoint means data from host to device.
I didn't check what it is used for, I thought it would be for things such as communicating when DTR is active/inactive, etc, but that was a guess without looking at the code, so if you are right that's why we didn't run into problems.

arpruss
Posts: 156
Joined: Sat Sep 30, 2017 3:34 am

Re: USB PMA addresses

Post by arpruss » Tue Jan 30, 2018 12:57 am

It's true that USB names things from the host's point of view, but the Maple cdcacm code uses "tx/rx" from the device point of view, but "IN/OUT" from the host's point of view. Yes, that's confusing!

Here's the endpoint config in the USB descriptor in the code.

Code: Select all

.ManagementEndpoint = {
        .bLength          = sizeof(usb_descriptor_endpoint),
        .bDescriptorType  = USB_DESCRIPTOR_TYPE_ENDPOINT,
        .bEndpointAddress = (USB_DESCRIPTOR_ENDPOINT_IN |
                             USB_CDCACM_MANAGEMENT_ENDP),
        .bmAttributes     = USB_EP_TYPE_INTERRUPT,
        .wMaxPacketSize   = USB_CDCACM_MANAGEMENT_EPSIZE,
        .bInterval        = 0xFF,
    },
USB_DESCRIPTOR_ENDPOINT_IN means this is configured for device-to-host.

Post Reply