cherry-embedded / CherryUSB

CherryUSB is a tiny, beautiful and portable USB host and device stack for embedded system with USB IP
https://cherryusb.readthedocs.io/
Apache License 2.0
1.21k stars 256 forks source link

Use marco usb_memcpy and usb_memset for memcpy and memset #106

Closed kendryte747 closed 1 year ago

kendryte747 commented 1 year ago
  1. For my chip, use compiler libc memcpy in interrupt will crash, so use a marco of memcpy and memset to use custom function.
  2. dwc2 default enable use dma, but seems my chip's usb controller not support it, so change this marco logic.
sakumisu commented 1 year ago

Its your libc issue not mine, so you need implment your libc

sakumisu commented 1 year ago

memcpy is a standard api, must be implmented.

sakumisu commented 1 year ago

dma is for hs port ,iif you do not support , please use fs port.

kendryte747 commented 1 year ago

memcpy is a standard api, must be implmented.

so i need custom the memcpy used by cherryusb.

kendryte747 commented 1 year ago

dma is for hs port ,iif you do not support , please use fs port.

https://github.com/sakumisu/CherryUSB/blob/0c218441661764107799b732d977384b22c8ca84/port/dwc2/usb_dc_dwc2.c#L121

I want to control dma support in usb_config.h, but here it is defined directly

sakumisu commented 1 year ago

dma is for hs port ,iif you do not support , please use fs port.

https://github.com/sakumisu/CherryUSB/blob/0c218441661764107799b732d977384b22c8ca84/port/dwc2/usb_dc_dwc2.c#L121

I want to control dma support in usb_config.h, but here it is defined directly

You can enable fs port, not hs port, it is the same.

sakumisu commented 1 year ago

CONFIG_USB_DWC2_DMA_ENABLE only uses in hs port.

sakumisu commented 1 year ago

memcpy is the common api not only in cherryusb, but also in almost other opensource projects.

kendryte747 commented 1 year ago

ok...