nxp-mcuxpresso / mcux-sdk-middleware-usb

MCUXpresso SDK USB stack Middleware
Other
10 stars 12 forks source link

EHCI device driver - Incorrect QH buffer size #8

Open remdzi opened 7 months ago

remdzi commented 7 months ago

Hello,

For EHCI device driver, the QH buffer is declared as: https://github.com/nxp-mcuxpresso/mcux-sdk-middleware-usb/blob/main/device/usb_device_ehci.c#L77C1-L80C121 /* Apply for QH buffer, 2048-byte alignment */ USB_RAM_ADDRESS_ALIGNMENT(2048) USB_CONTROLLER_DATA static uint8_t qh_buffer[(USB_DEVICE_CONFIG_EHCI - 1) * 2048 + 2 * USB_DEVICE_CONFIG_ENDPOINTS * 2 * sizeof(usb_device_ehci_qh_struct_t)];

Why QH buffer size is derived from 2 2 number of endpoints ? I think there is an extra '* 2' that is not required. Isn't it?

Rémy

MarkWangChinese commented 7 months ago

Thanks @remdzi I agree with you. Did you do some function test after removing the extra * 2?

remdzi commented 7 months ago

Hi @MarkWangChinese

Thanks for your reply

I will try to do the test this week and I will post the result in this thread