cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting USB to Cortex-M4 on STM32mp157 possible?

Led
Senior

I'd like to connect one USB port to the RTOS, running on the Cortex-M4. According CubeMX this is not possible (no square availble to tick). Is this really not possible?

According the datasheet (DS12505 Rev3, page 19, 'Block Diagram'):

  • USBH is connected to AXIM bus, but the corresponding arrow is blue (= AHB ).
  • The USB OTG I can not find there.

According same datasheet (page 36, 'Bus Matirx'):

  • USBH is connected to AXIM
  • USBO is connected to MLAHB

This is not clear to me.

Denise

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Altough using OTG from Cortex-M4 is somewhat possible from pure HW point of view, the SW does not allow this use case due to the fact that USBPHY and all clocks are handled by Linux (including the PLL USB used by both USBH and OTG).

In order 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.

View solution in original post

4 REPLIES 4
PatrickF
ST Employee

Altough using OTG from Cortex-M4 is somewhat possible from pure HW point of view, the SW does not allow this use case due to the fact that USBPHY and all clocks are handled by Linux (including the PLL USB used by both USBH and OTG).

In order 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.
Led
Senior

Thanks for this clarification. That's a pitty to me, but ok.

Denise

You may have to rethink your use case, by e.g. 'subcontracting' the USB data transfer to Linux (e.g. using rpmsg/OpenAMP). For sure system latency and power will not be equivalent than a direct management for M4 (the SRAM size not used by the USB stack could be used to buffer more data locally before requesting Linux<->USB wake up)

In order 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.

As 'real-time conditions' are the reason why I want to connect USB to the M4, subcontracting does not really bring a benefit, I think. In my case I assume that using the A7 directly is much simpler. Other solution would be to replace USB by UART to be able to execute everything on the M4.

But thanks for the hint. I will surely investigate to check the rpmsg/OpenAMP feature (it's new to me..)