cancel
Showing results for 
Search instead for 
Did you mean: 

I am not able to communicate on Virtual COM port. If I am using Both functionality(receiving and transmitting). I am using STM32F103C8 MCU.

Vivek yadav1
Associate III

It is showing me Error "USB is unrecognized". Only Transmitting Function is working Properly.

int8_t CDC_Receive_FS_User (uint8_t* Buf, uint32_t *Len)//Non-Static
{
	CDC_Receive_FS(Buf,Len);// >> static Funcation( usbd_cdc_if.c ) 
}
 
/*
* if I am NOT able to send data on COM port. 
* Problems comes When i am trying to receive data from COM port.
* USB is unrecognised. Don't know why ????
*/
 
uint32_t *Len = (uint32_t *)calloc(1,4);
Len = (uint32_t *)20;
uint8_t Buffer_CDC[20];
										
if( CDC_Receive_FS_User(Buffer_CDC, (uint32_t *)Len) == USBD_OK )
{
	uint16_t length = sizeof(Buffer_CDC);
	if(CDC_Transmit_FS( Buffer_CDC, length ) ==USBD_OK )
	{															 
             HAL_GPIO_WritePin(GPIOC,LED_Pin,GPIO_PIN_SET);															 
             HAL_Delay(2000);															 
             HAL_GPIO_WritePin(GPIOC,LED_Pin,GPIO_PIN_RESET);															 
             HAL_Delay(2000);						
	} // END					
} // END

It is also Creating same Issue if i am using USART functionality.

Regards

@Vivek yadav​ 

0 REPLIES 0