[iMX8MPlus] [u-Boot] Flash issue Serial Downloader mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[iMX8MPlus] [u-Boot] Flash issue Serial Downloader mode

2,765 Views
khang_letruong
Senior Contributor III

Dear All,

On our custom board, the USB2 is designed to be OTG (Serial Downloader) instead of HOST as in the case of EVK. And the USB1 which is OTG in the EVK is dropped from our custom design.

The Serial Downloader mode works during the DDR4 calibration and stress test. However, I struggled with the flashing using uuu tool :

$ sudo uuu -v -b sd ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.138-0-g051a8fe

Build in config:
	Pctl	 Chip		 Vid	 Pid	 BcdVersion
	==================================================
	SDPS:	 MX8QXP		 0x1fc9	 0x012f	 [0x0002..0xffff]
	SDPS:	 MX8QM		 0x1fc9	 0x0129	 [0x0002..0xffff]
	SDPS:	 MX8DXL		 0x1fc9	 0x0147
	SDPS:	 MX28		 0x15a2	 0x004f
	SDPS:	 MX815		 0x1fc9	 0x013e
	SDPS:	 MX865		 0x1fc9	 0x0146
	SDPS:	 MX8ULP		 0x1fc9	 0x014a
	SDPS:	 MX8ULP		 0x1fc9	 0x014b
	SDP:	 MX7D		 0x15a2	 0x0076
	SDP:	 MX6Q		 0x15a2	 0x0054
	SDP:	 MX6D		 0x15a2	 0x0061
	SDP:	 MX6SL		 0x15a2	 0x0063
	SDP:	 MX6SX		 0x15a2	 0x0071
	SDP:	 MX6UL		 0x15a2	 0x007d
	SDP:	 MX6ULL		 0x15a2	 0x0080
	SDP:	 MX6SLL		 0x1fc9	 0x0128
	SDP:	 MX7ULP		 0x1fc9	 0x0126
	SDP:	 MXRT106X	 0x1fc9	 0x0135
	SDP:	 MX8MM		 0x1fc9	 0x0134
	SDP:	 MX8MQ		 0x1fc9	 0x012b
	SDPU:	 SPL		 0x0525	 0xb4a4	 [0x0000..0x04ff]
	SDPV:	 SPL1		 0x0525	 0xb4a4	 [0x0500..0x9998]
	SDPU:	 SPL		 0x0525	 0xb4a4	 [0x9999..0x9999]
	SDPU:	 SPL		 0x3016	 0x1001	 [0x0000..0x04ff]
	SDPV:	 SPL1		 0x3016	 0x1001	 [0x0500..0x9998]
	FBK:	 		 0x066f	 0x9afe
	FBK:	 		 0x066f	 0x9bff
	FB:	 		 0x0525	 0xa4a5
	FB:	 		 0x18d1	 0x0d02
	FB:	 		 0x3016	 0x0001

Run built-in script:
 
uuu_version 1.2.39

# @./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk            | bootloader
# @./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk   [./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk] | image burn to emmc, default is the same as bootloader

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk -offset 0x57c00
SDPU: jump
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk -skipspl
SDPV: jump
# }

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${sd_dev}
FB: ucmd mmc dev ${sd_dev}
FB: flash bootloader ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk
FB: Done


Wait for Known USB Device Appear...

Error: fail open file: >./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk

I would like to know if any adaptation needed for u-Boot in terms of USB modification, please ?

Thanks in advance and best regards,
Khang

 

 

 

 

0 Kudos
Reply
6 Replies

1,299 Views
dhruvinrajpura
Contributor II

@khang_letruong 
Can't found uboot image in 640K range  with 37% of flashing progress

Did you got any solution for this?I am facing simillar issur for iMX8ULP_EVK9

0 Kudos
Reply

2,743 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

The error the tool shows is that it did not find or is not able to open the uboot file you have specified, please check that the name is correct or it is in the correct directory.

Regarding changes to uboot, yes you'll need to change uboot for your custom design since this will lead to errors later.

Best regards,
Aldo.

0 Kudos
Reply

2,739 Views
khang_letruong
Senior Contributor III

Hi @AldoG ,

The error the tool shows is that it did not find or is not able to open the uboot file you have specified, please check that the name is correct or it is in the correct directory.

The file is right there in the working directory :

$ ls -l
total 4889500
-rw-r--r-- 1 developer developer 2269136 Jan 20 19:00 imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk

And I tried with both following commands :

$ sudo uuu -v -b sd ./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk
$ sudo uuu -v -b sd imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk

 

Regarding changes to uboot, yes you'll need to change uboot for your custom design since this will lead to errors later.

For USB adaptation, do you think that without it could I still do the flashing? 

Anyway, I also did the adaptation as below but the flashing issue is still there:

a. Disable USB1, switch USB2 from HOST to OTG :

diff --git a/arch/arm/dts/imx8mp-evk.dts b/arch/arm/dts/imx8mp-evk.dts
index fa923d580a..5cff97a2eb 100644
--- a/arch/arm/dts/imx8mp-evk.dts
+++ b/arch/arm/dts/imx8mp-evk.dts
@@ -418,11 +418,11 @@
        fsl,phy-comp-dis-tune = <7>;
        fsl,pcs-tx-deemph-3p5db = <0x21>;
        fsl,phy-pcs-tx-swing-full = <0x7f>;
-       status = "okay";
+       status = "disabled";
 };

 &usb3_0 {
-       status = "okay";
+       status = "disabled";
 };

 &usb_dwc3_0 {
@@ -432,18 +432,17 @@
        adp-disable;
        usb-role-switch;
        role-switch-default-mode = "none";
-       status = "okay";
-
-       port {
-               usb3_drd_sw: endpoint {
-                       remote-endpoint = <&typec_dr_sw>;
-               };
-       };
+       status = "disabled";
 };

 &usb3_phy1 {
+       vbus-power-supply = <&ptn5110>;
        fsl,phy-tx-preemp-amp-tune = <3>;
        fsl,phy-tx-vref-tune = <0xb>;
+       fsl,phy-tx-vboost-level = <5>;
+       fsl,phy-comp-dis-tune = <7>;
+       fsl,pcs-tx-deemph-3p5db = <0x21>;
+       fsl,phy-pcs-tx-swing-full = <0x7f>;
        status = "okay";
 };

@@ -452,10 +451,19 @@
 };

 &usb_dwc3_1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usb1_vbus>;
-       dr_mode = "host";
+       dr_mode = "otg";
+       hnp-disable;
+       srp-disable;
+       adp-disable;
+       usb-role-switch;
+       role-switch-default-mode = "none";
        status = "okay";
+
+       port {
+               usb3_drd_sw: endpoint {
+                       remote-endpoint = <&typec_dr_sw>;
+               };
+       };
 };

 &usdhc2 {
@@ -651,12 +659,6 @@
                >;
        };

-       pinctrl_usb1_vbus: usb1grp {
-               fsl,pins = <
-                       MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR   0x19
-               >;
-       };
-
        pinctrl_usdhc2: usdhc2grp {
                fsl,pins = <
                        MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK        0x190

 

b. Remove the USB power port as we do not have it on custom board, update the base address of USB2:

diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index f2826d3981..a0dd907b7b 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -167,7 +167,7 @@ int pd_switch_snk_enable(struct tcpc_port *port)
                return -EINVAL;
 }

-/* Port2 is the power supply, port 1 does not support power */
+/* Port 2 is not the available, port 1 does not support power */
 struct tcpc_port_config port1_config = {
        .i2c_bus = 1, /*i2c2*/
        .addr = 0x50,
@@ -209,6 +209,7 @@ void ss_mux_select(enum typec_cc_polarity pol)
 static int setup_typec(void)
 {
        int ret;
+#if 0
        struct gpio_desc per_12v_desc;

        debug("tcpc_init port 2\n");
@@ -235,7 +236,9 @@ static int setup_typec(void)
                /* Enable PER 12V regulator */
                dm_gpio_set_dir_flags(&per_12v_desc, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
        }
-
+#else
+       debug("tcpc port2 not used\n");
+#endif
        debug("tcpc_init port 1\n");
        imx_iomux_v3_setup_multiple_pads(ss_mux_gpio, ARRAY_SIZE(ss_mux_gpio));
        gpio_request(USB_TYPEC_SEL, "typec_sel");
@@ -247,6 +250,8 @@ static int setup_typec(void)
                printf("%s: tcpc port1 init failed, err=%d\n",
                       __func__, ret);
        } else {
+               printf("%s: tcpc port1 init succeeded\n",
+                      __func__);
                return ret;
        }

@@ -283,7 +288,7 @@ static struct dwc3_device dwc3_device_data = {
 #else
        .maximum_speed = USB_SPEED_SUPER,
 #endif
-       .base = USB1_BASE_ADDR,
+       .base = USB2_BASE_ADDR,
        .dr_mode = USB_DR_MODE_PERIPHERAL,
        .index = 0,
        .power_down_scale = 2,

 

Best Regards,
Khang

 

 

0 Kudos
Reply

2,724 Views
khang_letruong
Senior Contributor III

Hi @AldoG ,

I have some update :

About initial error of uuu:

 

Error: fail open file: >./imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk

 

It turned out the it was the issue of uuu installed by snap under Ubuntu. I now use the release binary from  https://github.com/NXPmicro/mfgtools and there's some progress.

Without the USB adaptation in previous comment, the flashing of u-boot could reach 37%  and ended with following error (tested with different versions of uuu : ibuuu_1.4.193-0-ge56424c and ibuuu_1.4.243-0-ged48c51) :

 

Wait for Known USB Device Appear...
New USB Device Attached at 1:12
1:12>Start Cmd:SDPS: boot -f imx-boot-imx8mp-ddr4-evk-sd.bin-flash_ddr4_evk
37%1:12>Fail HID(W):LIBUSB_ERROR_TIMEOUT(1.873s)

 

In the board debug console:

 

Normal Boot
WDT:   Not found!
Trying to boot from BOOTROM
Can't found uboot image in 640K range 
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

 

Do you think that the above error Can't found uboot image in 640K range  is compatible with my other issue that ATF (BL31) not found when flashing the SD card using dd ?

Thanks and best regards,
Khang.

0 Kudos
Reply

2,700 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

This could be caused by the different error you are seeing in your other post, regarding changes to uboot I would suggest to follow this as reference:
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Sharing-i-MX8MP-Download-image-via-USB-O...

Best regards,
Aldo.

0 Kudos
Reply

2,694 Views
khang_letruong
Senior Contributor III

Hi @AldoG ,

I did apply the patches you shared, the only difference is configs/imx8mp_ddr4_evk_defconfig instead of configs/imx8mp_evk_defconfig.

But the error Can't found uboot image in 640K range  with 37% of flashing progress still there.

Best Regards,
Khang

0 Kudos
Reply