Skip to main content
Led
Associate III
March 6, 2020
Solved

Connecting USB to Cortex-M4 on STM32mp157 possible?

  • March 6, 2020
  • 2 replies
  • 1191 views

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

This topic has been closed for replies.
Best answer by PatrickF

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).

2 replies

PatrickF
PatrickFBest answer
Technical Moderator
March 6, 2020

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 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent
Led
LedAuthor
Associate III
March 6, 2020

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

Denise

PatrickF
Technical Moderator
March 6, 2020

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 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent
Led
LedAuthor
Associate III
March 6, 2020

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..)