自己开发的i.mx8mp基板无法烧写eMMC

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

自己开发的i.mx8mp基板无法烧写eMMC

Jump to solution
5,878 Views
feiyu
Contributor III

我们根据NXP 的i.mx8mp开发板,开发自己的基板,使用基本同样的外围芯片和电源等,采用USB下载模式,利用UUU软件进行eMMC烧写时,串口输出以下log,无法成功烧写

U-Boot SPL 2020.04-5.10.9-1.0.0+g628a6631f8 (Mar 02 2023 - 16:41:57 +0800)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
Find FIT header 0x&480331a0, size 1031
Need continue download 1024
Download 2986880, total fit 2988512
NOTICE: BL31: v2.4(release):lf-5.10.y-1.0.0-0-gba76d337e
NOTICE: BL31: Built : 08:27:48, Mar 1 2021


U-Boot 2020.04-5.10.9-1.0.0+g628a6631f8 (Mar 02 2023 - 16:41:57 +0800)

CPU: i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 45C
Reset cause: POR
Model: MYIR i.MX8MPlus LPDDR4 EVK board
DRAM: 3 GiB
MMC: FSL_SDHC: 1, FSL_SDHC: 2
[*]-Video Link 0Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
fail to get display timings
probe video device failed, ret -19

[0] lcd-controller@32e80000, video
[1] mipi_dsi@32e60000, video_bridge
[2] adv7535@3d, panel
Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
fail to get display timings
probe video device failed, ret -19
In: serial
Out: serial
Err: serial

BuildInfo:
- ATF ba76d33
- U-Boot 2020.04-5.10.9-1.0.0+g628a6631f8

MMC: no card present
SF: Detected n25q512a with page size 256 Bytes, erase size 4 KiB, total 64 MiB

>>>PN=▒▒▒▒▒Pv▒Q
>>>SN=▒▒▒▒▒Pv▒Q
Detect USB boot. Will enter fastboot mode!
Net:
Error: ethernet@30be0000 address not set.

Error: ethernet@30be0000 address not set.

Error: ethernet@30bf0000 address not set.

Error: ethernet@30bf0000 address not set.
No ethernet found.

Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else booti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot: 0

## Checking Image at 43800000 ...
Unknown image format!
Run fastboot ...
Detect USB boot. Will enter fastboot mode!
flash target is MMC:1
MMC: no card present
MMC card init failed!
MMC: no card present
** Block device MMC 1 not supported
request 0000000051f42c40 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
flash target is MMC:2
Select HS400ES failed -110
Select HS400 failed -110
request 0000000051f42c40 was not queued to ep1in-bulk

烧写程序的log下 所示:

log.jpg

目前无法找到原因,希望有人能提供解决思路,非常感谢!

0 Kudos
Reply
1 Solution
5,744 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

@feiyu 

DTS中添加

mmc-hs200-1_8v;

其余标签参考:Documentation/devicetree/bindings/mmc/mmc-controller.yaml

View solution in original post

0 Kudos
Reply
11 Replies
5,852 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi  @feiyu 

eMMC驱动无法初始化,请检查硬件,如果硬件上无问题但和EVK有设计上的差异,需要修改spl.c中的usdhc初始化代码。

0 Kudos
Reply
5,847 Views
feiyu
Contributor III

Hi,Qmiller

非常感谢您的答复,后来经过调查硬件确实有问题,经过调整可以开始下载,但是下载开始时还是会出现以下错误,

## Checking Image at 43800000 ...
Unknown image format!
Run fastboot ...
Detect USB boot. Will enter fastboot mode!
flash target is MMC:1
request 0000000051f42e40 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
flash target is MMC:2
Select HS400ES failed -5
Select HS400 failed -5
request 0000000051f42e40 was not queued to ep1in-bulk
Select HS400ES failed -5
Select HS400 failed -5
switch to partitions #0, OK
mmc2(part 0) is current device
Detect USB boot. Will enter fastboot mode!
request 0000000051f42e40 was not queued to ep1in-bulk
request 0000000051f42e40 was not queued to ep1in-bulk
request 0000000051f42e40 was not queued to ep1in-bulk
Starting download of 16776232 bytes
request 0000000051f42e40 was not queued to ep1in-bulk
..........................................................................
.....................................................
downloading of 16776232 bytes finished
request 0000000051f42e40 was not queued to ep1in-bulk
writing to partition 'all'
sparse flash target is mmc:2
writing to partition 'all' for sparse, buffer size 16776232
Flashing sparse image at offset 0
Flashing Sparse Image
........ wrote 16776192 bytes to 'all'
request 0000000051f42e40 was not queued to ep1in-bulk
Starting download of 16776244 bytes
request 0000000051f42e40 was not queued to ep1in-bulk
..........................................................................
.....................................................


downloading of 3348960 bytes finished
request 0000000051f42e40 was not queued to ep1in-bulk
writing to partition 'bootloader'
Initializing 'bootloader'
Select HS400ES failed -5
Select HS400 failed -5
switch to partitions #1, OK
mmc2(part 1) is current device
Writing 'bootloader'

MMC write: dev # 2, block # 0, count 6541 ... 6541 blocks written: OK
Writing 'bootloader' DONE!
request 0000000051f42e40 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
request 0000000051f42e40 was not queued to ep1in-bulk
Detect USB boot. Will enter fastboot mode!
request 0000000051f42e40 was not queued to ep1in-bulk

最终结果是:image和dtb所在的mmc2p1分区下载完成,uboot和kernel可以启动,但root所在的mmc2p2分区无法识别,导致文件系统启动失败,log如下:

u-boot=> boot
Select HS400ES failed -5
Select HS400 failed -5
switch to partitions #0, OK
mmc2(part 0) is current device
Select HS400ES failed -5
Select HS400 failed -5
29209088 bytes read in 668 ms (41.7 MiB/s)
Booting from mmc ...
61702 bytes read in 16 ms (3.7 MiB/s)
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Using Device Tree in place at 0000000043000000, end 0000000043012105
Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
fail to get display timings
probe video device failed, ret -19

Starting kernel ...

Select HS400ES failed -5

…………省略

[ 3.581410] Waiting for root device /dev/mmcblk2p2...

希望您能有解决方案,或者提供调查思路,我们将会非常感谢!

 

0 Kudos
Reply
5,799 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

有可能是sdhc硬件布线问题,硬件上无法达到HS400的速度。去除掉HS400 的config之后需要然后重新烧写测试。分别测试MMC_HS_200,UHS_SDR104和UHS_DDR50。

0 Kudos
Reply
5,780 Views
feiyu
Contributor III

Hi,Qmiller

非常感谢答复,目前关闭了uboot和kernel中的HS400相关配置,uboot完全没有问题,kernel可能修改的不够规范,所以仍然会报错,但是目前经过修改确实可以启动系统了,目前进入系统之后,报错如下:


[ 25.395320] mmc2: running CQE recovery
[ 25.399321] mmc2: cache flush error -110
[ 25.468217] mmc2: mmc_select_hs400es failed, error -74
[ 25.482173] EXT4-fs error (device mmcblk2p2): ext4_journal_check_start:83: Detected aborted journal
[ 25.491259] EXT4-fs (mmcblk2p2): Remounting filesystem read-only
root@myd-jx8mp:/run/media/nvme0n1# [ 33.758268] can1-stby: disabling

目前基本可以确定是eMMC有问题,我们使用的SOC(i.MX8MP 工业级4核心)和eMMC(SDINBDG4-8G)型号与官方i.MX8MP开发板完全相同,所以目前找不到问题发生的原因,请问什么情况会导致eMMC报这种错误呢?

0 Kudos
Reply
5,774 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

可能是硬件上无法支持运行HS400这个模式,软件一直想跑在HS400,但是硬件达不到HS400的通信速度。你可以修改kernel dts,强制运行在HS200看看行不行。

0 Kudos
Reply
5,765 Views
feiyu
Contributor III

你好, Qmiller

非常感谢答复,现在uboot可以通过修改defconfig方式,强制不适用HS400模式,但是按照您的建议,查找kernel设备树,usdhc3节点中并没有HS400相关的记载,请问如何修改强制HS200模式呢?我们设备树记载如下:

&usdhc3 {
assigned-clocks = <&clk IMX8MP_CLK_USDHC3>;
assigned-clock-rates = <400000000>;
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc3>;
pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
bus-width = <8>;
non-removable;
status = "okay";
};

0 Kudos
Reply
5,745 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

@feiyu 

DTS中添加

mmc-hs200-1_8v;

其余标签参考:Documentation/devicetree/bindings/mmc/mmc-controller.yaml

0 Kudos
Reply
5,728 Views
feiyu
Contributor III

Hi,Qmiller

非常感谢您耐心答复,目前按照您的建议修改了设备树,并且我们把mmc.c代码中关于识别HS400模式的代码注释掉了,目前重新编译的kernel可以正常启动运行,并且不会报错,问题可以解决。但是为什么我们的eMMC不支持HS400,需要继续研究。

0 Kudos
Reply
5,839 Views
chen-wust
Contributor II

你看一下你uboot设备树有没有设置HS400模式,可能是该版本的uboot不支持这个模式,或者硬件无法支这个模式,换成HS普通模式看看还会不会报错。

0 Kudos
Reply
5,807 Views
feiyu
Contributor III

你好,我尝试修改了uboot的defconfig文件,确实可以关闭hs400模式,但是您知道imx.8mp的kernel如何关闭吗?

0 Kudos
Reply
5,830 Views
feiyu
Contributor III

Hi chen-wust

非常感谢您的答复,我们的基板是参考三方开发板,以及NXP官方开发板制作,uboot和kernel与三方开发板完全一致,这三种基板的soc、emmc、ddr、pmic等核心芯片都完全一致,但是在三方开发板上就不会有这个问题,目前可以确定的是,emmc中uboot和kernel分区的正常的,kernel也正常启动了,但是只要kernel启动之后,就不识别emmc了,会报出以下错误:


[ 1.993478] mmc2: mmc_select_hs400es failed, error -110
[ 1.998724] mmc2: error -110 whilst initialising MMC card

目前很难找到解决思路,如果您有其他调查方法,拜托告知,非常感谢您的帮助!

0 Kudos
Reply