Skip to main content
Visitor II
June 8, 2022
Question

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

  • June 8, 2022
  • 1 reply
  • 837 views

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

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    June 17, 2022

    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