cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to connect two stm32 board through usb ?

MBOUH
Associate

Hello,

this is the first time I apply in this forum and I hope that I find the right answer to my question.

So, my goal is to connect two stm32 cards (for example: STM32F4) via USB.

Is it possible to do that? If yes ? how can I configure both cards with STM32cubeMx?

That is to say what are the necessary configurations for each card (Mode: device or host, class for FS IP: CDC, HID, MTP ...).

3 REPLIES 3
Pavel A.
Evangelist III

Yes, possible. One of them will be host and other - device. If both have OTG capable USB controller, they can switch roles.

(The new MCUs with type C controller may switch roles in type C way, I haven't tested).

-- pa

MBOUH
Associate

thank you fairly well for your response Pavel A.

I try to configure the two card One of them as a host and other -device but

the problem is in the communication type configuration for both cards (CDC , HID , MTP..)

Is there an example for communication between two stm32 cards?

There are examples of HOST and DEVICE instances, pick a pairing that suits goals/transfer paradigm.

Seems like a lot of work as there are more efficient ways to transfer data between two devices. ie people would normally wire a USART than do a CDC-to-CDC interface via USB. Consider purpose and practicality.

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