cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC ACM in Standalone mode using STM32H563ZI board

Pranathi
Associate

Hello STM Community!

I'm trying to implement USB CDC ACM in standalone mode(without using ThreadX) on STM32H563ZI board. I have tried this with ThreadX and got it working.
I have created a project, with the following configurations in the .ioc file;

Pranathi_0-1734776026759.png

Time Source : SysTick;

Pranathi_1-1734776115152.png

 

Pranathi_2-1734776176316.png

Pranathi_3-1734776244146.png

In Project Manager section, I have increased the, Minimum Heap size to 0x1000, and stack size to 0x600.

Clock configuration settings is as follows; (USB is receiving 48MHz through HSI48 clock).

Pranathi_6-1734777474020.png

 

And I have created a task, USBX_DEVICE_CDC_ACM_Task(); for data receiving and transmission

Pranathi_4-1734776417491.png

and calling the USBX_Device_Process() function in main.c file, in while loop.

--------

I hope, I have given the configurations correctly and calling all the functions in correct order...
Please let me know if I am wrong anywhere here.
When I run the code, it's getting stuck inside the task; in line 177 as shown below;

(Even without the while loop inside this task, the code didn't work)

Pranathi_5-1734776675100.png

I have tried this project, in another way before this, and I got hard fault error, I have posted issue on the forum but there's no reply. here's the link for it, (to check, that project issue)
https://community.st.com/t5/stm32-mcus-embedded-software/how-to-implement-usb-cdc-acm-in-standalone-mode-for-stm32h563zi/m-p/754106#M33055

Kindly, let me know where I am missing out, and the steps I need to follow to use USB CDC ACM in standalone mode. 
I have tried the Ux_Device_HID_Standalone example from STMCube repository, but with no output...

Your insights and guidance would be invaluable to me. Thank you in advance for any assistance you can provide!

Please find the attached, project folder for further info.

 

2 REPLIES 2
Pavel A.
Evangelist III

USB is receiving 48MHz through HSI48 clock

Seriously? You have PLL sourced from HSE.

 

 

gbm
Lead III

1. HSE oscillator mode should be set to Bypass.

2. USB FIFO configuration is incorrect - wrong last argument values in HAL_PCDEx_PMAConfig*** calls.

3. USB clocking with HSI48 is ok assuming you set CRS sync to USB SOF (which you did).

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice