cancel
Showing results for 
Search instead for 
Did you mean: 

CubeProgrammer fails to reconnect over USB after U-Boot stage

AMurr.2282
Associate III

I've been having this problem for a while now. I open one of the trusted flashlayout (.tsv) files in STM32CubeProgrammer. I can connect to the target board over USB without issue. I click "Download" and it successfully downloads tf-a-stm32mp-serialboot and also successfully downloads u-boot-stm32mp.

However, when U-Boot is executed, the target board fails to reconnect over USB. Here is the dmesg output:

0693W000004I8aiQAC.png

Eventually, STM32CubeProgrammer times out because it is unable to connect to the target to download the kernel.

What could the cause for this be? I have looked at the USB configuration in the u-boot device tree many times and have followed the wiki, and it all looks correct.

4 REPLIES 4
Olivier GALLIEN
ST Employee

Hi @AMurr.2282​ 

Does this dedicated article may give you some clues ?

https://community.st.com/s/article/FAQ-STM32MP1-STM32CubeProgrammer-USB-reconnect-error-at-STM32MP1-boot-device-flashing

Olivier

Olivier GALLIEN
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.

Hi Olivier

I have tried everything in the article but I cannot get this to work. The article says it should reconnect as "USB download gadget" after u-boot has been downloaded. This does not happen with our board. Instead, we get error messages:

[ 3752.842604] usb 1-1.1.2: USB disconnect, device number 6

[ 3755.123295] usb 1-1.1.2: new high-speed USB device number 7 using xhci_hcd

[ 3760.411354] usb 1-1.1.2: device descriptor read/64, error -110

[ 3776.027392] usb 1-1.1.2: device descriptor read/64, error -110

[ 3776.223324] usb 1-1.1.2: new high-speed USB device number 8 using xhci_hcd

[ 3781.403408] usb 1-1.1.2: device descriptor read/64, error -110

[ 3797.019881] usb 1-1.1.2: device descriptor read/64, error -110

[ 3797.128891] usb 1-1.1-port2: attempt power cycle

[ 3797.739827] usb 1-1.1.2: new high-speed USB device number 9 using xhci_hcd

[ 3802.540048] usb 1-1.1.2: Device not responding to setup address.

[ 3807.551624] usb 1-1.1.2: Device not responding to setup address.

[ 3807.759839] usb 1-1.1.2: device not accepting address 9, error -71

[ 3807.847440] usb 1-1.1.2: new high-speed USB device number 10 using xhci_hcd

[ 3812.648248] usb 1-1.1.2: Device not responding to setup address.

[ 3817.659847] usb 1-1.1.2: Device not responding to setup address.

[ 3817.867473] usb 1-1.1.2: device not accepting address 10, error -71

[ 3817.869346] usb 1-1.1-port2: unable to enumerate USB device

Is it possible that u-boot is broken?

The hardware connections look fine. OTG ID pin is high (3.3V) and VBUS is 5V and is connected to PMIC.

Here is the u-boot device tree. Do you see any issues here?

/ {
    usb_phy_tuning: usb-phy-tuning {
        st,current-boost = <2>;
        st,no-lfs-fb-cap;
        st,hs-dc-level = <2>;
        st,hs-rftime-reduction;
        st,hs-current-trim = <5>;
        st,hs-impedance-trim = <0>;
        st,squelch-level = <1>;
        st,no-hs-ftime-ctrl;
        st,hs-tx-staggering;
    };
};  /* root */
 
&i2c4 {
    pmic: stpmic@33 {
        /* stuff */
        regulators {
            vbus_otg: pwr_sw1 {
                regulator-name = "vbus_otg";
            };
 
            vbus_sw: pwr_sw2 {
                regulator-name = "vbus_sw";
                regulator-active-discharge = <1>;
            };
        };
    };
};
 
&usbh_ehci{
    status = "okay";
 
    /* USER CODE BEGIN usbh_ehci */
    phys = <&usbphyc_port0>;           /* Use USBPHYC HS PHY port #1, mapped on USBH controller */
    /* USER CODE END usbh_ehci */
};
 
&usbh_ohci{
    status = "okay";
 
    /* USER CODE BEGIN usbh_ohci */
    phys = <&usbphyc_port0>;           /* Use USBPHYC HS PHY port #1, mapped on USBH controller */
    phy-names = "usb";
    vbus-supply = <&vbus_sw>;
    /* USER CODE END usbh_ohci */
};
 
&usbotg_hs{
    u-boot,dm-pre-reloc;
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&usb_otg_hs_pins_mx>;
    pinctrl-1 = <&usb_otg_hs_sleep_pins_mx>;
    status = "okay";
 
    /* USER CODE BEGIN usbotg_hs */
    phys = <&usbphyc_port1 0>;   /* 0: UTMI switch selects the OTG controller */
    phy-names = "usb2-phy";
    vbus-supply = <&vbus_otg>;    /* voltage regulator to supply Vbus */
    dr_mode = "peripheral";
    /* USER CODE END usbotg_hs */
};
 
&usbphyc{
    u-boot,dm-pre-reloc;
    status = "okay";
 
    /* USER CODE BEGIN usbphyc */
    /* USER CODE END usbphyc */
};
 
&usbphyc_port0{
    u-boot,dm-pre-reloc;
    status = "okay";
 
    /* USER CODE BEGIN usbphyc_port0 */
    phy-supply = <&v3v3_vdd_io>;
    st,phy-tuning = <&usb_phy_tuning>;
    /* USER CODE END usbphyc_port0 */
};
 
&usbphyc_port1{
    u-boot,dm-pre-reloc;
    status = "okay";
 
    /* USER CODE BEGIN usbphyc_port1 */
    phy-supply = <&v3v3_vdd_io>;
    st,phy-tuning = <&usb_phy_tuning>;
    /* USER CODE END usbphyc_port1 */
};

Hi,

I assume you are using your own custom board.

Are you using latest CubeProgrammer ? On W10, Linux PC or Virtual Machine ? On VM, there is some settings to ensure the USB are 'routed' to the VM.

Is you DDR memory working, did you tuned it and tested it using DDRTool ?

Btw, maybe look also at following articles:

https://community.st.com/s/article/FAQ-STM32MP1-How-to-create-a-device-tree-with-STM32CubeMx-for-your-design

https://community.st.com/s/article/FAQ-STM32MP1-Bring-up-procedure

Regards.

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.
Olivier GALLIEN
ST Employee

Hi @Hgvfd.1​ ,

If all hints provided in this article does not help, I would rather recommend you to open a new post with complete description of your environment ( Soc, board, SW version) and traces from both CubeProg and target.

Thx,

Olivier

Olivier GALLIEN
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.