2024-08-05 02:42 AM
I'm trying to use STM32CubeMX to generate a USBX Device CDC ACM in standalone mode (without using ThreadX).
I'm using a Nucleo-H563ZI to test with.
I can do this with ThreadX and get it working, but when I try the standalone configuration it doesn't work.
Is there any documentation, howto or guide on how to configure and setup USBX standalone on the H5 series?
2024-08-05 04:18 AM
https://community.st.com/t5/stm32-mcus/how-to-implement-usbx-in-standalone-mode/ta-p/614435
(standalone, but HID not CDC)
(CDC with RTOS)
2024-08-05 04:34 AM
I'd seen and tried to follow this one:
https://community.st.com/t5/stm32-mcus/how-to-implement-usbx-in-standalone-mode/ta-p/614435
But it's specifically related to the H7. Some of the function calls in the section '3. code editing' don't seem right for the H5. e.g. HAL_PCDEx_SetRxFifo and HAL_PCDEx_SetTxFifo block of calls. Wouldn't this need to be replaced with HAL_PCDEx_PMAConfig(...) calls for the H5?
2024-08-05 04:45 AM - edited 2024-08-05 04:46 AM
As far as official docs are concerned, I think that's about it on standalone USBX.
It's quite possible you have to adapt the example to other families. It's also true that this "supported" use case involves significantly more manual editing than is the norm with Cube.
2024-09-12 11:39 PM
Thank you so much for the link.
2024-10-25 07:22 AM - edited 2024-11-12 12:19 AM
I have managed to get the USBX CDC working on the STM32U083 device. Let me know and I will attach a copy of the project and IOC sample file. Some tips:-
I am using the STM32Cube_FW_U0_V1.1.0 example projects for STM32U083C-DK as a baseline for code examples. Using the example with ThreadX I added all the necessary routines to the a project I generated on CubeMX for the required device with USB enabled in standalone mode. I also referenced the standalaone HID example for how to treat standalone.
Set UX_STANDALONE in your project properties or #define it in your code.
Make sure the memeory allocation is done as per the suggestions and CubeMx indicates how much memeory to assign.
The link previously referenced (See Below) is usefull to make sure the projects setup is followed. Just set for CDC and not HID and the correct files will be added.
https://community.st.com/t5/stm32-mcus/how-to-implement-usbx-in-standalone-mode/ta-p/614435
Do let me know if you succeed.
---------------------------------------------------------------------------------------------------------------
Edit:
NOTE: The link above has some errors, so my apologies. I am adding a link to what I finally used to fix the above. Hope it helps as my solution is now working.