2023-06-21 04:57 AM
Hi all,
I'm new in programming STM32U585AI.
Bought the STEVAL-WINBOX1 and as first step tried to have working USB CDC.
Since didn't find code example in STM32CubeIDE for this specific dev kit, create a new new project based on example Ux_Device_CDC_ACM for board NUCLEO-U575ZI-Q.
Code is running successful in WINBOX1 however, PC doesn't recognised CDC device.
All project is in https://github.com/adeuga/stm_USB
Thank you for any help.
Solved! Go to Solution.
2023-07-10 11:00 AM
Probably I discovered the problem.
When CAD_Check_HW_SNK is called, none of conditions to change CurrentHWcondition to HW_Attachment is fulfilled. This is happening because CC1 and CC2 in WINBOX1 is not connected to STM32.
See schematic:
The question is then how can I put this working or do I'm missing something else?
2023-06-23 01:22 AM
Hi,
I gave a look at your code, there is not a project file so it is not possible to build and run the project.
One thing that I noted is that the configuration of the USB FiFo is missing. Something like this:
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x100);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x10);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x20);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 2, 0x10);
Maybe I just missed it in your code.
To look at that code fragment in a context you can give a look at the NUCLEO-U575ZI-Q UxDeviceCDCDemo demo inside eLooM_tx-SDK
That is an application framework that we use for complex embedded applications, but the CDC demo is a simple example. Also note that, even if the demo runs on the NUCLEO-U5, the USB and USBX configuration works fine also for the STWIN.box board because the peripheral is the same and the MCU belong to the same STM32U5 family and it is compatible. The USB related configurations are:
2023-06-28 07:15 AM
Hi,
Thank you for your fast reply.
I implemented yours proposal's changes but unfortunately didn't work. Meanwhile, found another example here https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/USBX/Ux_Device_HID_CDC_ACM and adapt code for STEVAL-WINBOX1 hardware.
Code is in a zip file https://github.com/adeuga/stm32_Ux_Device and can be imported to STM32CubeIDE as new file from an Existing STM32CubeMX Configuration file (*.ioc)
I would like to know what is missing since the problem persists.
2023-06-28 08:58 AM
If you import some as new from ioc, then result is complete empty project with only hw config and libs.
Real usb or other projects need more files and advanced config in files , that isnt generated.
Use other right way to import project , i prefer unzip on some place without spaces in path and double click .project file in STM32IDE folder...
2023-06-29 03:19 AM
Following MM..1 indications, made changes in code but still unsuccessful. Just update zip file in github.
2023-06-29 03:36 AM
When you follow the you need see structure
i dont see it in your zip file
2023-07-03 01:11 AM
Opened the project from https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/USBX/Ux_Device_HID_CDC_ACM and also don't see your structure.
Compiled it successful. Made changes in GPIO for WINBOX1 and USB still failed (not recognised in PC).
2023-07-10 11:00 AM
Probably I discovered the problem.
When CAD_Check_HW_SNK is called, none of conditions to change CurrentHWcondition to HW_Attachment is fulfilled. This is happening because CC1 and CC2 in WINBOX1 is not connected to STM32.
See schematic:
The question is then how can I put this working or do I'm missing something else?