cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding / making work USB | Host Only | Communication Host Class (VCP)

fabocode
Associate II

Hello,

Description

I started to interface with USB peripheral in my nucleo F411RE and wanted to set it as host to work as VCP but I have some problems understanding or even to make it work properly.

Hardware

Nucleo-F446RE

KNACRO FT312D USB Android Host UART USB Serial RS485 RS232

Arduino Leonardo

TTL-232R-RPi Debug Cable for Raspberry Pi 

Problem

I followed a youtube video about how to work with the USB VCP Host, and when I tested the USB communication I realized that my code is not even starting the communication, specifically at this line of code in usb_host.c :

void userFunction(void)
{
	static uint32_t i = 0;
 
        // the code do not change the Appli_state to APPLICATION_READY
	if (Appli_state == APPLICATION_READY) {
		if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) == GPIO_PIN_SET && i>0xFFFF) {
			USBH_CDC_Transmit(&hUsbHostFS, tx_buffer, 9);
			i = 0;
		}
		i++;
	}
}

So I am not understanding what exactly is going on... I will attach my .ioc file or even the whole project to help solving this issue. My best guess is that my STM32 is not detecting a USB connection to start the communication process... But I am not sure how to trigger this event... How should be my wiring connection to test this peripheral? I have this bunch of hardware that I am not really sure if this is the proper way to test it.

My workflow is the following:

---- >

STM32 DP/DM - TX/RX KNACRO FT312 - USB Connection to Arduino Leonardo - TX/RX TTL-232R-RPi Debug Cable for Raspberry Pi - PC

1 REPLY 1
fabocode
Associate II

What I try to do is to send a "Hello\n" over USB to the Arduino Leonardo and send/read that response in the terminal window over the Debug cable for Raspberry Pi. Arduino Leonardo is reading everything what comes into the USB Connection that is sent to the TX/RX pins selected for the Debug cable, but none of this process is processed because during the debugging sessions I realized that I am not sending any stream of data to the other devices.