cherry-embedded / CherryUSB

CherryUSB is a tiny and portable USB Stack (device & host) for embedded system with USB IP
https://cherryusb.readthedocs.io/
Apache License 2.0
1.17k stars 249 forks source link

Wrong max packet size for Mentor USB RXMAP and TXMAP registers #155

Closed tiancj closed 8 months ago

tiancj commented 8 months ago

In function usbd_ep_open, MUSB_IND_RXMAP_OFFSET and/or MUSB_IND_TXMAP_OFFSET is set to ep_cfg->ep_mps, but according to Mentor USB SW guide, the value of these registers is in unit of 8 Bytes, so the correct value of these registers may be ep_cfg->ep_mps >> 3.

sakumisu commented 8 months ago

No i think your datasheet is incorrect and not official, please see image

sakumisu commented 8 months ago

You can find this config in TI/ES32 or other chips with offical.

tiancj commented 8 months ago

Thanks, I recheck these two registers, FS and HS have different definitions. FS in 8 bytes, HS in bytes. :-)