How to boot the Openwrt sdcard-img on i.MX8MP device?

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

How to boot the Openwrt sdcard-img on i.MX8MP device?

322 Views
odyssey
Contributor II

Hello There,

1. I've follow the steps on imx_openwrt/target/linux/imx/README at imx-openwrt-23.05 · nxp-imx/imx_openwrt · GitHub to burn the openwrt-imx-imx8-imx8mplus-squashfs-sdcard.img to a imx8mp device internal MMC.

 

* u-boot environment

  => tftp a0000000 <image_name>-sdcard.img
  => mmc write a0000000 0 a0000

  Note: The default sdcard.img size is about 200MB. a0000 is the block number
  for 320MB. blk_num = filesize / 512.

 

And I think it should be done successfully, see the output of part and ext2ls command as follows:

 

u-boot=> part list mmc 2

Partition Map for MMC device 2  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     32768           82144           5452574f-01     83 Boot
  2     131072          213160          5452574f-02     83
u-boot=> ext2ls mmc 2:0
** Unrecognized filesystem type **
u-boot=> ext2ls mmc 2:1
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 lost+found
           64669 imx8mp-evk.dtb
        26708480 imx8mplus-kernel.bin

 

 

2.However, after reset the board, it failed to boot the system. See the following logs:

 

u-boot=> reset
resetting ...

U-Boot SPL 2020.04-g829bc5cf-dirty (Jun 06 2023 - 06:48:22 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
image offset 0x0, pagesize 0x200, ivt offset 0x0
NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.0-0-gf1d7187
NOTICE:  BL31: Built : 06:58:44, May 31 2022


U-Boot 2020.04-g829bc5cf-dirty (Jun 06 2023 - 06:48:22 +0000)

CPU:   i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 44C
Reset cause: POR
Model: NXP i.MX8MPlus LPDDR4 EVK board
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Fail to setup video link
In:    serial
Out:   serial
Err:   serial

 BuildInfo:
  - ATF f1d7187
  - U-Boot 2020.04-g829bc5cf-dirty

flash target is MMC:2
Net:   
Warning: ethernet@30be0000 (eth0) using random MAC address - 12:59:ac:67:24:67

Warning: ethernet@30bf0000 (eth1) using random MAC address - 66:c2:cc:3f:59:35
eth0: ethernet@30be0000, eth1: ethernet@30bf0000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc2(part 0) is current device
Booting system
MMC read: dev # 2, block # 50, count 1 ... 1 blocks read: OK age=0
Magic invaild in bootconfig
MMC read: dev # 2, block # 562, count 1 ... 1 blocks read: OK age=0
Magic invaild in bootconfig1
Trying upgrade boot ...
resetting USB...
Bus usb@38100000: got a VBus regulator.
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Trying upper boot ...
** Invalid partition 9 **
Trying normal boot ...
** Invalid partition 4 **
Booting system failed, reset ....
resetting ...

U-Boot SPL 2020.04-g829bc5cf-dirty (Jun 06 2023 - 06:48:22 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
image offset 0x0, pagesize 0x200, ivt offset 0x0
NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.0-0-gf1d7187
NOTICE:  BL31: Built : 06:58:44, May 31 2022


U-Boot 2020.04-g829bc5cf-dirty (Jun 06 2023 - 06:48:22 +0000)

CPU:   i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 43C
Reset cause: POR
Model: NXP i.MX8MPlus LPDDR4 EVK board
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Fail to setup video link
In:    serial
Out:   serial
Err:   serial

 BuildInfo:
  - ATF f1d7187
  - U-Boot 2020.04-g829bc5cf-dirty

flash target is MMC:2
Net:   
Warning: ethernet@30be0000 (eth0) using random MAC address - 2a:4f:fe:99:1f:a6

Warning: ethernet@30bf0000 (eth1) using random MAC address - ba:9e:22:be:91:14
eth0: ethernet@30be0000, eth1: ethernet@30bf0000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
u-boot=> 
u-boot=> print bootcmd
bootcmd=mmc dev ${mmcdev};echo Booting system;if mmc rescan; then mmc bootconfig ${mmcdev};for mode in ${boot_queue}; do echo Trying ${mode} boot ...;run boot_mode_${mode};done;fi;echo Booting system failed, reset ....;reset;

 

 

3.I'm not sure what is the potential reason, maybe the bootcmd is wrong. But I don't know how to change it or manually boot by other commands such as ext2load, etc.

4.I've done some search in the community but found none helpful answers. Could you kindly help to take a look at this problem? Thank you so much and I am looking foward to your reply.

 

Odyssey

Tags (2)
0 Kudos
5 Replies

171 Views
odyssey
Contributor II

Hello, can anyone kindly help to support?

0 Kudos

161 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Please try to dd the SD card, see the attached.

Regards,

 

0 Kudos

244 Views
odyssey
Contributor II

@JosephAtNXPHello, could you help to take a look at? Thanks.

0 Kudos

292 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

Could you please try to flash it with:

=> mmc write a0000000 0 a00000

Regards

0 Kudos

289 Views
odyssey
Contributor II

@JosephAtNXPHi, thanks for your quick reply.

I tried the a00000 instead of a0000. However, it can't work. See the logs:

         514.6 KiB/s
done
Bytes transferred = 176160768 (a800000 hex)
u-boot=> mmc write a0000000 0 a00000
MMC: no card present
u-boot=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device
u-boot=> mmc write a0000000 0 a00000

MMC write: dev # 2, block # 0, count 10485760 ... "Synchronous Abort" handler, esr 0x96000145
elr: 0000000040202034 lr : 000000004023d1f0 (reloc)
elr: 0000000054f02034 lr : 0000000054f3d1f0
x0 : 00000000c0000000 x1 : 00000000c1ffde00
x2 : 0000000000000040 x3 : 000000000000003f
x4 : 0000000052f02f70 x5 : 0000000000000014
x6 : 0000000000000030 x7 : 0000000000000004
x8 : 0000000000000006 x9 : 00000000a4e93adc
x10: 00000000ffffffe0 x11: 000000000000000d
x12: 0000000000000006 x13: 000000000001869f
x14: 0000000000000000 x15: 0000000000000002
x16: 0000000054f3cff0 x17: 00000000000042f0
x18: 0000000052bffdb8 x19: 0000000030b60000
x20: 0000000052bf6cb8 x21: 0000000052bf6cd0
x22: 0000000030b60000 x23: 0000000052f033f0
x24: 0000000000000080 x25: 0000000052f0e9c0
x26: 0000000000000200 x27: 0000000000000015
x28: 0000000000000002 x29: 0000000052bf6c00

Code: d2800082 9ac32042 d1000443 8a230000 (d50b7e20) 
Resetting CPU ...

resetting ...

U-Boot SPL 2020.04-g829bc5cf-dirty (Jun 06 2023 - 06:48:22 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
image offset 0x0, pagesize 0x200, ivt offset 0x0
NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.0-0-gf1d7187
NOTICE:  BL31: Built : 06:58:44, May 31 2022


U-Boot 2020.04-g829bc5cf-dirty (Jun 06 2023 - 06:48:22 +0000)

CPU:   i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 38C
Reset cause: POR
Model: NXP i.MX8MPlus LPDDR4 EVK board
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Fail to setup video link
In:    serial
Out:   serial
Err:   serial

 BuildInfo:
  - ATF f1d7187
  - U-Boot 2020.04-g829bc5cf-dirty

flash target is MMC:2
Net:   
Warning: ethernet@30be0000 (eth0) using random MAC address - aa:59:0b:c5:44:30

Warning: ethernet@30bf0000 (eth1) using random MAC address - 12:e1:8a:80:54:62
eth0: ethernet@30be0000, eth1: ethernet@30bf0000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
u-boot=> part list
part - disk partition related commands

Usage:
part uuid <interface> <dev>:<part>
    - print partition UUID
part uuid <interface> <dev>:<part> <varname>
    - set environment variable to partition UUID
part list <interface> <dev>
    - print a device's partition table
part list <interface> <dev> [flags] <varname>
    - set environment variable to the list of partitions
      flags can be -bootable (list only bootable partitions)
part start <interface> <dev> <part> <varname>
    - set environment variable to the start of the partition (in blocks)
      part can be either partition number or partition name
part size <interface> <dev> <part> <varname>
    - set environment variable to the size of the partition (in blocks)
      part can be either partition number or partition name
part number <interface> <dev> <part> <varname>
    - set environment variable to the partition number using the partition name
      part must be specified as partition name
u-boot=> part list mmc 2

Partition Map for MMC device 2  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     32768           82144           5452574f-01     83 Boot
  2     131072          213160          5452574f-02     83

The file size of openwrt-sd.img is 176160768 bytes, which means 0x54000 block count when each block size is 512, so I think the original a0000 is enough, right?

 

Odyssey

0 Kudos