-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need host cdc example #3
Comments
Which CDC-device exactly do you mean? I have Holtek HT42B534 usb-uart bridge. |
i want communicate to stm32f1. i config stm32 as cdc devive. and on the f1c100s i can receive data with this function : static void mydev_rcv (void) // this fucntion i borrow from void net_rcv (void) : usbh_net.c but i cannot send data to stm32f1 with :
that code i borrow from err_t net_snd (struct netif *netif, struct pbuf *p) : usbh_net.c ======================================================================================= #include <stdio.h> uint32_t dev_tim, dev_con = 0; #define BIT(nr) (1UL << (nr)) #if 0 u8 dev_usb; /******************************************************************************* void usbh_init (void) void usb_reset (void) int usbh_myevice_init (DSC_DEV *dev_dsc) if(dev_dsc->idVendor != 0x0483 || dev_dsc->idProduct != 0x5740) return KO; USB->EP_IDX = 1; static void mydev_rcv (void) static void ep0_send_buf (void *buf, u16 len) void usbh_mydev_handler (u32 isr) LCD_printf(".");
} |
I apologize for my long response. If the stm32 device has a full speed USB interface, then the RXTYPE and TXTYPE registers are incorrectly initialized in the usbh_myevice_init function. They must contain (2 << 6), which determine the speed of the interface. Look at the description of this registers in the file: musb |
iam use this setup but still fail to send data : int usbh_myevice_init (DSC_DEV *dev_dsc) if(dev_dsc->idVendor != 0x0483 || dev_dsc->idProduct != 0x5740) return KO; USB->EP_IDX = 1; static void mydev_rcv (void) void send_char (char data) //fail send data void usbh_mydev_handler (u32 isr) |
You have incorrect values for the USB->RXFIFOSZ and USB->TXFIFOSZ registers: 2^(6+3) = 2^9 = 512. |
I have tried it but still fails. Is the function below correct ? |
can you make usb host cdc example....
The text was updated successfully, but these errors were encountered: