cancel
Showing results for 
Search instead for 
Did you mean: 

USB Issue on H743II

JKhal
Associate III

Hi,

I have two STM32H743II MCUs, one of them is USB device and the other one is the USB host, did it sing the cube.

then added to the host code the USBH_CDC_ReceiveCallback function.

and added the  HAL_PWREx_EnableUSBVoltageDetector(); function after the USBH_Start function.

I am running the two boards, pluges the USB in between and tries to send data from one to another but it's not working.

best regards

JK

6 REPLIES 6
berendi
Principal

If the two boards are only connected to each other through USB, then save yourself a lot of headache, and configure the USB data pins as UART ports. Swap TX/RX in the UART for one of the controllers (see USART_CR2_SWAP).

Not working is overly broad, you'll likely need to debug this by adding instrumentation, trying independently against a PC.

Check the signals electrically, use a USB analyzer.​

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

Hi,

Thanks for your reply.

when I plug in the USB device to the USB host, the host detect it and the enters the case HOST_DEV_ATTACHED, after that the host tries to perform the function USBH_GetDescriptor again and again but the  condition if(phost->RequestState == CMD_SEND) is never true.

I am not a USB stack expert :(.

Please help me to figure it out.

BR

JK

JKhal
Associate III

Hi,

Thanks for your replyies.

when I plug in the USB device to the USB host, the host detect it and the enters the case HOST_DEV_ATTACHED, after that the host tries to perform the function USBH_GetDescriptor again and again but the condition if(phost->RequestState == CMD_SEND) is never true.

I am not a USB stack expert :(.

Please help me to figure it out.

BR

JK

JKhal
Associate III

Hi,

I managed to send messages from the USB host to the USB device.

But yet can't send anything from the USB device to the USB host.

when I need to do so I use the function uint8_t CDC_Transmit_HS(uint8_t* Buf, uint16_t Len).

is that correct ?

Please help me solve this issue.

Best Regards

JK

HRivo.1
Associate

Hi JKhal,

I'm facing the same problem, did you succeed solving it?

Regards.

Hubert