cancel
Showing results for 
Search instead for 
Did you mean: 

Ux_Device_CDC_ACM Example to USBX Host Example

nlippitt
Associate II

I plan to adapt the USBX host example to act as a bridge the way the current device example does.  Then I can have a full link UART -> Host -> USB -> Device -> UART and vice versa.  However, the data sent to the device is not displayed over its UART as expected and the device stops obtaining additional messages from the host.  How can I fix this so I can move on the adapt the host example and use the device to debug?

Overall Goal: Implement a USB to UART bridge using USBX Host mode on the NUCLEO-U575ZI

Steps:

Run the Ux_Device_CDC_ACM example from the example selector on a NUCLEO-U5A5ZJ

Confirm device example functionality:

  1. Connect the NUCLEO-U5A5ZJ USB-C port to the PC.
  2. Open two Teraterm windows: UART serial port and VCOM (over USB) port
  3. Typing into either Teraterm window causes the text to appear on the other window.  This confirms bidirectional USB to UART bridge on the NUCLEO-U5A5ZJ in USBX Device mode.

Modify the device example due to lack of VBUS power between the two Nucleo USB-C ports:

  1. Remove the infinite loop from app_ux_device_thread_entry and run HAL_PCD_Start(&hpcd_USB_OTG_HS) once.
  2. Check that the device example functionality still works on its own.

Write the following USBX Host example and run on the NUCLEO-U575ZI: How to implement the USB host in STM32 using the A... - STMicroelectronics Community

Connect the device running on the NUCLEO-U5A5ZJ to the host running on the NUCLEO-U575ZI over USBC ports and run both programs:

  1. The host connects to the device, prints its PID and VID, and sends one byte every two seconds.  The sent byte rotates between 0 and 1.
  2. The host waits on the read thread for a response from the device.
  3. The device receives the first correct message attempts to print the message to UART and then the device read thread gets suspended on ux_transfer_request_semaphore. HAL_UART_Transmit_DMA reports success, yet nothing prints to the device TeraTerm window.
  4. Typing in the device TeraTerm window doesn’t cause any messages to the USBX host to be printed in the host TeraTerm window.
1 REPLY 1
T_Hamdi
ST Employee

Hello @nlippitt 

After reviewing your application goals, we have encountered an issue with the USB Host application USBX_Host_CDC_ACM .

We suggest following the example provided in X-CUBE-AZRTOS-H7, specifically the UX_Host_CDC_ACM  project, and adapting this application to your board NUCLEO-U575ZI. Then connect the second board running the Ux_Device_CDC_ACM  application. Normally, it should work directly.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Hamdi Teyeb