# STM32MP157 small hiccups

**URL:** <https://forum.digikey.com/t/stm32mp157-small-hiccups/14840>\
**Category:** Linux Discussions\
**Created:** [June 21, 2021, 11:10am UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840 "2021-06-21T11:10:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mubes](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mubes](https://forum.digikey.com/u/mubes)\
**Post date:** [June 21, 2021, 11:10am UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/1 "2021-06-21T11:10:31Z")

</div>

Having a few small issues getting started with the DK2 board following the rather excellent instructions (thanks Robert!) at [Debian: Getting Started with the STM32MP157](https://forum.digikey.com/t/debian-getting-started-with-the-stm32mp157/12459) , specifically the biggest issue is that my USB powers down after boot. Extracts from from syslog;

```auto
[14.896426] dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
[14.896835] dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
[14.985167] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[14.985239] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[15.028098] dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM
[15.036614] dwc2 49000000.usb-otg: DWC OTG Controller
[15.036694] dwc2 49000000.usb-otg: new USB bus registered, assigned bus number 2
[15.037272] dwc2 49000000.usb-otg: irq 53, io mem 0x49000000
[15.041225] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[15.041251] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[15.041263] usb usb2: Product: DWC OTG Controller
[15.041274] usb usb2: Manufacturer: Linux 5.10.41-armv7-lpae-x41 dwc2_hsotg
[15.041285] usb usb2: SerialNumber: 49000000.usb-otg
[15.043447] hub 2-0:1.0: USB hub found
[15.045352] hub 2-0:1.0: 1 port detected

```

…and if I have a usb memory stick plugged in at this point it will init it, but later;

```auto
[33.763695] vref: supplied by vdd
[33.763930] reg11: supplied by vdd
[33.764060] usb33: supplied by vdd_usb
[33.764222] vref: disabling
[33.764241] reg11: disabling
[33.764268] vdda: disabling

```

…and my memory stick is still there as /dev/sda1, but gives me access errors. Really a bit stuck on this one!

The second issue is that I cannot bring up WiFi, but I’ll keep fighting on that one because I suspect the problem is between the screen and the keyboard rather than anywhere inside the SoC.

Regards  
DAVE

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 21, 2021, 8:28pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/2 "2021-06-21T20:28:01Z")

</div>

Hi @mubes , which USB port are you using? I wonder if we configure the regulators for USB to be:

```auto
regulator-always-on;
regulator-boot-on;

```

as usb33 is used on: usbotg\_hs

[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp151.dtsi?h=v5.13-rc7#n1142](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp151.dtsi?h=v5.13-rc7#n1142)

usbphyc regulator are also the same:

[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp151.dtsi?h=v5.13-rc7#n1495](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp151.dtsi?h=v5.13-rc7#n1495)

Regards,

---

<div class="post-metadata">

**Author:** ![mubes](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mubes](https://forum.digikey.com/u/mubes)\
**Post date:** [June 21, 2021, 11:53pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/3 "2021-06-21T23:53:51Z")

</div>

Hi Robert,

Not sure I quite understand what you’re saying. I’m using the 4-port USB-A on the board which, I think, is behind a hub. I don’t see those two phrases (regulator-always-on, regulator-boot-on) in the file `armv7-lpae-multiplatform/KERNEL/arch/arm/boot/dts/stm32mp151.dtsi` anywhere…are you suggesting I should add them under the usbotg\_hs and usbphyc configurations?

Regards

DAVE

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 22, 2021, 2:47am UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/4 "2021-06-22T02:47:30Z")

</div>

> [@mubes](#):
>
> I’m using the 4-port USB-A on the board which, I think, is behind a hub.

Ah perfect, so looking at the schematic:

 ![Regulators](https://global.discourse-cdn.com/digikey/original/3X/5/4/5480eecbd5d3dc97ca25c3b08a43dcff3d400962.png)

VDD33 controls the USB2514B, and it looks like 5V just comes from Vin…

So the first thing i’d test is:

[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp151.dtsi?h=v5.13-rc7#n1142](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp151.dtsi?h=v5.13-rc7#n1142)

```auto
			usb33: usb33 {
				regulator-name = "usb33";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

```

to:

```auto
			usb33: usb33 {
				regulator-name = "usb33";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
				regulator-boot-on;
			};

```

and let’s see if that does anything…

The other thing, the main 3v3 rail is defined here:

[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi?h=v5.13-rc7#n326](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi?h=v5.13-rc7#n326)

```auto
			v3v3: buck4 {
				regulator-name = "v3v3";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
				regulator-over-current-protection;
				regulator-initial-mode = <0>;
			};

```

 ![mainrail](https://global.discourse-cdn.com/digikey/original/3X/5/2/52eb09eb57921e86be835ff42a2a98ad9bf71172.png)

More digging…

![USBRESET](https://global.discourse-cdn.com/digikey/original/3X/c/1/c198f08660c06eaf3897f2d203985f7c7443f877.png)

So as soon as the 3v3 rail is turns ‘off’ then ‘on’ the usb phy reset’s… I suppose that would work, i’d rather that was a gpio we could toggle… But i have a feeling, the usb hub is reseting when jumping from u-boot → linux…

Regards,

---

<div class="post-metadata">

**Author:** ![mubes](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mubes](https://forum.digikey.com/u/mubes)\
**Post date:** [June 22, 2021, 10:31pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/5 "2021-06-22T22:31:52Z")

</div>

Robert,  
I tried the device tree change, with no effect. The v3v3 matches to what you have above and doesn’t seem to an issue.

The usb is powering up correctly and the hub is being initialised by Linux. I think the power supplies might be a red herring since the usb doesn’t seem to be dependent on any of the supplies that are being disabled. From what I can see even VDDA33 on U7 is powered from the 3v3 rail, and the SDA/SDL are DNF so I don’t see that having any impact either. I’d be very surprised if the 3v3 were being toggled as it is needed all over the place.

If I have a keyboard plugged in at boot it comes up like this;

```auto
001/input/input2
Jun 22 21:26:00 arm kernel: [19.591324] hid-generic 0003:0472:0065.0001: input,hidraw0: USB HID v1.00 Keyboard [Chicony PFU-65 USB Keyboard] on usb-5800d000.usb-1.2
.1/input0

```

…

The usb interface that is in use appears to be defined by this;

```auto
		usbh_ohci: usb@5800c000 {
			compatible = "generic-ohci";
			reg = <0x5800c000 0x1000>;
			clocks = <&rcc USBH>;
			resets = <&rcc USBH_R>;
			interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
			status = "disabled";
		};

		usbh_ehci: usb@5800d000 {
			compatible = "generic-ehci";
			reg = <0x5800d000 0x1000>;
			clocks = <&rcc USBH>;
			resets = <&rcc USBH_R>;
			interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
			companion = <&usbh_ohci>;
			status = "disabled";
		};

```

I’m not overly familiar with this stuff, so any pointers gratefully accepted! One more datapoint, it does seem like something is active;

```auto
# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

```

…but devices plugged in elicit no responses at all.  
DAVE

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 23, 2021, 10:53pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/6 "2021-06-23T22:53:49Z")

</div>

Hi @mubes  
Okay, sorry for the delay, i can confirm the issue with v5.10.x… But please give v5.13.x a quick try, as it’s working for me. 😉

```auto
git clone https://github.com/RobertCNelson/armv7-lpae-multiplatform
cd armv7-lpae-multiplatform/
git checkout origin/v5.13.x -b tmp

```

Regards,

---

<div class="post-metadata">

**Author:** ![mubes](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mubes](https://forum.digikey.com/u/mubes)\
**Post date:** [June 23, 2021, 10:54pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/7 "2021-06-23T22:54:20Z")

</div>

So, just to run this one to ground. The problem is `reg11` in `stm32mp151.dsti`. If you modify that to always be on, then the USB behaves itself. @RobertCNelson Is this a patch that I need to submit somewhere, or can you handle it from this PR?

Updated code (Starting at line 1125) reads;

```auto
			reg11: reg11 {
				regulator-name = "reg11";
				regulator-min-microvolt = <1100000>;
				regulator-max-microvolt = <1100000>;
				regulator-always-on;
				regulator-boot-on; };

```

---

<div class="post-metadata">

**Author:** ![mubes](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mubes](https://forum.digikey.com/u/mubes)\
**Post date:** [June 23, 2021, 10:56pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/8 "2021-06-23T22:56:11Z")

</div>

Looks like our posts crossed…see above!

DAVE

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 23, 2021, 10:57pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/9 "2021-06-23T22:57:03Z")

</div>

Ah, cool, let’s try that with v5.10.x, as i have everything setup…

Regards,

---

<div class="post-metadata">

**Author:** ![mubes](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mubes](https://forum.digikey.com/u/mubes)\
**Post date:** [June 23, 2021, 11:02pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/10 "2021-06-23T23:02:16Z")

</div>

Great! I’m off to bed but will pick this up again tomorrow. The WiFi looks like it might have gotten tangled in the brcm\* → cy\* renaming process, but I’ve not looked into that one yet. Once again, thanks for the great work on this. It’s appreciated.

DAVE

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [June 23, 2021, 11:04pm UTC](https://forum.digikey.com/t/stm32mp157-small-hiccups/14840/11 "2021-06-23T23:04:07Z")

</div>

That also works, (survives reboots) and merged!

> **[RobertCNelson/stm32-DeviceTrees](https://github.com/RobertCNelson/stm32-DeviceTrees/commits/v5.10.x)**
>
> Contribute to RobertCNelson/stm32-DeviceTrees development by creating an account on GitHub.

Yeah, the brcm\* → cypress\* is a mess, I hope they don’t rename it again to _Infineon_…

Regards,
