cancel
Showing results for 
Search instead for 
Did you mean: 

USB doesn't work on windows 10

JKhal
Associate III

Hello

In the PC app, I work with the STM32F722RETx LQFP64 micro-controller

In WIN7 it always works. At WIN10 does not work.

After I turn off and turn on the card, the board data that the system sees (both win7 and win10) is:

Status for device COM2              :

     -----------------------

   Baud:           1899758337

   Parity:         None

   Data Bits:      242

   Stop Bits:      1

   Timeout:        OFF

   XON/XOFF:       OFF

   CTS handshaking: OFF

   DSR handshaking: OFF

   DSR sensitivity: OFF

   DTR circuit:    OFF

   RTS circuit:    ON

At win10 it doesn't work

On win7 the board works after my app on win7, where I set the COM parameters

the system starts to work (on both win7 and win10):

Status for device COM2    :

     -----------------------

   Baud:           9600

   Parity:         None

   Data Bits:      8

   Stop Bits:      1

   Timeout:        ON

   XON/XOFF:       OFF

   CTS handshaking: OFF

   DSR handshaking: OFF

   DSR sensitivity: OFF

   DTR circuit:    OFF

   RTS circuit:    ON

I move the board (which is still ON) to win10 and it works

After the shutdown, it stops working at win10 again

It seems that the data is stored on the board only until the board is ON

This is the USB configuration on STM32CubeMX0690X00000ARF4nQAH.png

0690X00000ARF5HQAX.png0690X00000ARF5CQAX.png0690X00000ARF57QAH.png0690X00000ARF4xQAH.png

Please help us to solve the problem

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
JKhal
Associate III

answer for every one having the same problem:

in file usb_cdc_if.c add the following USBD_CDC_LineCodingTypeDef

USBD_CDC_LineCodingTypeDef LineCoding =
 
{
 
		115200, /* baud rate*/
 
		0x00,  /* stop bits-1*/
 
		0x00,  /* parity - none*/
 
		0x08  /* nb. of bits 8*/
 
};

In function CDC_Control_FS/ CDC_Control_HS

add to these two cases the code bellow:

case CDC_SET_LINE_CODING:
 
    	LineCoding.bitrate    = (uint32_t)(pbuf[0] | (pbuf[1] << 8) | \
  	                          (pbuf[2] << 16) | (pbuf[3] << 24));
    	LineCoding.format     = pbuf[4];
    	LineCoding.paritytype = pbuf[5];
    	LineCoding.datatype   = pbuf[6];
 
    break;
 
    case CDC_GET_LINE_CODING:
 
    	pbuf[0] = (uint8_t)(LineCoding.bitrate);
    	pbuf[1] = (uint8_t)(LineCoding.bitrate >> 8);
    	pbuf[2] = (uint8_t)(LineCoding.bitrate >> 16);
    	pbuf[3] = (uint8_t)(LineCoding.bitrate >> 24);
    	pbuf[4] = LineCoding.format;
    	pbuf[5] = LineCoding.paritytype;
    	pbuf[6] = LineCoding.datatype;
 
    break;

View solution in original post

1 REPLY 1
JKhal
Associate III

answer for every one having the same problem:

in file usb_cdc_if.c add the following USBD_CDC_LineCodingTypeDef

USBD_CDC_LineCodingTypeDef LineCoding =
 
{
 
		115200, /* baud rate*/
 
		0x00,  /* stop bits-1*/
 
		0x00,  /* parity - none*/
 
		0x08  /* nb. of bits 8*/
 
};

In function CDC_Control_FS/ CDC_Control_HS

add to these two cases the code bellow:

case CDC_SET_LINE_CODING:
 
    	LineCoding.bitrate    = (uint32_t)(pbuf[0] | (pbuf[1] << 8) | \
  	                          (pbuf[2] << 16) | (pbuf[3] << 24));
    	LineCoding.format     = pbuf[4];
    	LineCoding.paritytype = pbuf[5];
    	LineCoding.datatype   = pbuf[6];
 
    break;
 
    case CDC_GET_LINE_CODING:
 
    	pbuf[0] = (uint8_t)(LineCoding.bitrate);
    	pbuf[1] = (uint8_t)(LineCoding.bitrate >> 8);
    	pbuf[2] = (uint8_t)(LineCoding.bitrate >> 16);
    	pbuf[3] = (uint8_t)(LineCoding.bitrate >> 24);
    	pbuf[4] = LineCoding.format;
    	pbuf[5] = LineCoding.paritytype;
    	pbuf[6] = LineCoding.datatype;
 
    break;