cancel
Showing results for 
Search instead for 
Did you mean: 

How can a L4 be at the same time a USB host and a USB device ?

BEnge.1
Associate III

Hello,

I have a STM32L4 and I need it:

  1. To be able to communicate with a laptop via USB (PC = Host, L4 = Device)
  2. To be able to communicate with a custom made USB device which only support being a USB Device (L4 = Host, Custom device = Device)

I managed to use both the USB Host library and USB Device library separately but I don't know how to make them coexist in order to use them a the same time. As the L4 supports USB-OTG I guess this should be possible but I don't know how to do it. Is there a library for that ?

Thanks,

Benjamin

1 REPLY 1
KDJEM.1
ST Employee

Hi @BEnge.1​ ,

A similar question is asked here.

As confirmed by @Walid ZRELLI​ , we do not provide an example that uses the USB device and host in the same code.

Otherwise, it is probably possible by using the deinit and init usb functions.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.