Skip to content
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

Can provide an example of a STM32U5 USBX composite device? #1

Open
Barfell opened this issue Feb 22, 2024 · 10 comments
Open

Can provide an example of a STM32U5 USBX composite device? #1

Barfell opened this issue Feb 22, 2024 · 10 comments

Comments

@Barfell
Copy link

Barfell commented Feb 22, 2024

I have a STM32U5x9J-DK board, high speed usb composite device, the MSC + CDC +HID can not read and write at the same time.

@Barfell
Copy link
Author

Barfell commented Feb 23, 2024

and add a WINUSB?

@ayedm1
Copy link

ayedm1 commented Feb 26, 2024

Hi @Barfell,
Can you give more details about your request ??
HID (mouse or keyboard)
MSC (SD or RamDisk)
CDC (with UART ??)

which IDE ?

How WINUSB will be supported in your application ??

@Barfell
Copy link
Author

Barfell commented Feb 26, 2024

Hi @Barfell, Can you give more details about your request ?? HID (mouse or keyboard) MSC (SD or RamDisk) CDC (with UART ??)

which IDE ?

How WINUSB will be supported in your application ??

custom hid, can send data and receive data. sd card. cdc without uart, it can send and receive.
IDE:MDK

When the MSC reads and writes, don't operate on CDC and HID, and when the MSC reads and writes is completed, CDC sends and receives normally, but HID does not.

If the MSC is read-only, CDC and HID are not affected.

HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x100);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x40);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x100);//81

HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 2, 0x40);//82
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 3, 0x10);//83

HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 4, 0x40);//84

//81 MSC IN 81
//01 MSC OUT 01
//82 CDC IN 82
//02 CDC OUT 02
//83 CDC CMD 83
//84 HID 84

@Barfell
Copy link
Author

Barfell commented Mar 14, 2024

When write the MSC, the HID devicce can not response USBD_Custom_HID_SetReport function, can not receive the data from the host.

@Barfell
Copy link
Author

Barfell commented Mar 30, 2024

Hi @Barfell, Can you give more details about your request ?? HID (mouse or keyboard) MSC (SD or RamDisk) CDC (with UART ??)

which IDE ?

How WINUSB will be supported in your application ??

WinUSB used for data DAQ

@Barfell
Copy link
Author

Barfell commented Mar 31, 2024

U5A9J_MSC.zip
Here the project,it not work normally.MSC+CDC+HID

@Barfell
Copy link
Author

Barfell commented Apr 1, 2024

The cause has been located, but I don't know how to solve it. USBD_STORAGE_Write function call the fx_media_write function, It's taking too long, Comment out the function fx_media_write,hid and cdc worked perfectly.

@ayedm1
Copy link

ayedm1 commented Apr 1, 2024

Hi @Barfell, yes it can be the cause. It's recommande to avoid using file system fx with storage class. I suggest to use direct sd hal.

@Barfell
Copy link
Author

Barfell commented Apr 1, 2024

Hi @ayedm1 ,I'm use HAL_SD_WriteBlocks instead fx_media_write, HAL_SD_ReadBlocksinstead fx_media_read, the HID and CDC can work at the same time.

@Barfell
Copy link
Author

Barfell commented Apr 2, 2024

STM32U5x9J-DK board, use file x, can work perfectly, because use high speed USB? maybe。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants