您尚未登录。

楼主 #1 2020-07-29 09:58:10

skliu
会员
注册时间: 2020-06-07
已发帖子: 54
积分: 23

主线 EMMC写入uboot启动问题

参考这里(感谢):
https://whycan.cn/t_3633.html

ums无法设别成sdx之类的。也不清楚哪里问题。

我的步骤:
1. 使用TF卡启动。 将板载的emmc格式化,分区如下:

Disk /dev/mmcblk1: 7456 MB, 7818182656 bytes, 15269888 sectors
238592 cylinders, 4 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/mmcblk1p1    32,0,1      640,0,1           2048      40960      38913 19.0M  c Win95 FAT32 (LBA)
/dev/mmcblk1p2    640,0,2     1023,3,16        40961   15269887   15228927 7435M 83 Linux

2. 拷贝zImage, boot.scr, sunxi**.dtb到 mmcblk1p1.  mmcblk1p2先空着。
boot.cmd内容如下:

fatload mmc 1:1 0x46000000 zImage
fatload mmc 1:1 0x49000000 sun8i-a33-sinlinx-sina33.dtb

setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rootwait panic=10

bootz 0x46000000 - 0x49000000

3. dd命令把 u-boot-sunxi-with-spl.bin写入mmcblk1。
4. tf开启动到uboot,修改过启动:

mmc partconf 1 0 7 0

5. 拿到tf卡,启动信息如下:

U-Boot SPL 2020.07 (Jul 28 2020 - 18:22:48 +0800)
DRAM: 1024 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

同样的 u-boot-sunxi-with-spl.bin写入tf卡的,启动没问题,可以进入系统的。

请大家帮忙分析一下。 谢谢了。

最近编辑记录 skliu (2020-07-29 10:00:24)

离线

#2 2020-07-29 10:47:40

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 364
积分: 313

Re: 主线 EMMC写入uboot启动问题

感觉还是那个老问题,没有开启mmc2的管脚配置,CONFIG_MMC_SUNXI_SLOT_EXTRA=2这个配置看看存在不嘛。

离线

楼主 #3 2020-07-29 11:16:00

skliu
会员
注册时间: 2020-06-07
已发帖子: 54
积分: 23

Re: 主线 EMMC写入uboot启动问题

那这个SPL也在emmc里面,为什么可以运行的?
列出来uboot的.config的所有MMC关键字信息。帮我看看。谢谢。

CONFIG_SPL_MMC_SUPPORT=y
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_MMC1_CD_PIN=""
CONFIG_MMC2_CD_PIN=""
CONFIG_MMC3_CD_PIN=""
CONFIG_MMC1_PINS=""
CONFIG_MMC2_PINS=""
CONFIG_MMC3_PINS=""
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x50
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0
# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is not set
# CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG is not set
# CONFIG_SPL_MMC_TINY is not set
# CONFIG_SPL_MMC_WRITE is not set
CONFIG_CMD_MMC=y
# CONFIG_CMD_MMC_SWRITE is not set
# CONFIG_ENV_IS_IN_MMC is not set
# CONFIG_DFU_MMC is not set
CONFIG_FASTBOOT_FLASH_MMC=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
# MMC Host controller Support
CONFIG_MMC=y
CONFIG_MMC_WRITE=y
# CONFIG_MMC_BROKEN_CD is not set
CONFIG_DM_MMC=y
# CONFIG_ARM_PL180_MMCI is not set
CONFIG_MMC_QUIRKS=y
CONFIG_MMC_HW_PARTITIONING=y
# CONFIG_SUPPORT_EMMC_RPMB is not set
CONFIG_SUPPORT_EMMC_BOOT=y
# CONFIG_MMC_IO_VOLTAGE is not set
# CONFIG_SPL_MMC_IO_VOLTAGE is not set
# CONFIG_MMC_HS400_ES_SUPPORT is not set
# CONFIG_SPL_MMC_HS400_ES_SUPPORT is not set
# CONFIG_MMC_HS400_SUPPORT is not set
# CONFIG_SPL_MMC_HS400_SUPPORT is not set
# CONFIG_MMC_HS200_SUPPORT is not set
# CONFIG_SPL_MMC_HS200_SUPPORT is not set
CONFIG_MMC_VERBOSE=y
# CONFIG_MMC_TRACE is not set
# CONFIG_MMC_DW is not set
# CONFIG_MMC_MXC is not set
# CONFIG_MMC_PCI is not set
# CONFIG_MMC_OMAP_HS is not set
# CONFIG_MMC_SDHCI is not set
CONFIG_MMC_SUNXI=y
# CONFIG_STM32_SDMMC2 is not set

离线

#4 2020-07-29 11:18:56

smartcar
会员
注册时间: 2018-02-19
已发帖子: 735
积分: 735

Re: 主线 EMMC写入uboot启动问题

dts 里面有没有把 emmc2的引脚都使能?

离线

#5 2020-07-29 13:22:32

湘楚浪子
会员
注册时间: 2019-12-22
已发帖子: 40
积分: 39.5

Re: 主线 EMMC写入uboot启动问题

参考这个帖子试一试: https://whycan.cn/t_2383.html#p31061

离线

楼主 #6 2020-07-30 07:15:12

skliu
会员
注册时间: 2020-06-07
已发帖子: 54
积分: 23

Re: 主线 EMMC写入uboot启动问题

感谢上面两位: 不过问题不在这里。 暂时还没找到。
我用的sinlinx_a33的配置。 对应的dts文件没看出问题。
主要疑点就是spl下载emmc的,能打印第一行证明emmc驱动没问题,不然走不了的,不知对否?
感觉启动环境错误了。

离线

#7 2020-07-30 08:18:29

有梦的地方
会员
注册时间: 2020-03-17
已发帖子: 284
积分: 284

Re: 主线 EMMC写入uboot启动问题

skliu 说:

感谢上面两位: 不过问题不在这里。 暂时还没找到。
我用的sinlinx_a33的配置。 对应的dts文件没看出问题。
主要疑点就是spl下载emmc的,能打印第一行证明emmc驱动没问题,不然走不了的,不知对否?
感觉启动环境错误了。

第一行是BROM加载boot0(spl)到sram运行,
然后才显示的,
只能说明你的eMMC硬件正常,
uboot不一定正常驱动了eMMC。

离线

楼主 #8 2020-07-30 08:49:59

skliu
会员
注册时间: 2020-06-07
已发帖子: 54
积分: 23

Re: 主线 EMMC写入uboot启动问题

这里顺便问一下: boot0里面会打印信息的吗?
同样的uboot,在tf卡上启动到uboot里面。可以看到emmc的。 还有哪里需要检查。 感谢。

U-Boot SPL 2020.07 (Jul 28 2020 - 21:14:53 +0800)
DRAM: 1024 MiB
Trying to boot from MMC1


U-Boot 2020.07 (Jul 28 2020 - 21:14:53 +0800) Allwinner Technology

CPU:   Allwinner A33 (SUN8I 1667)
Model: Sinlinx SinA33
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Setting up a 1024x600 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 2 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=>

mms list
Unknown command 'mms' - try 'help'
=> mmc list
mmc@1c0f000: 0
mmc@1c11000: 1 (eMMC)
=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=> mmc party
mmc - MMC sub system

Usage:
mmc info - display info of the current MMC device
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc wp - power on write protect boot partitions
mmc hwpartition [args...] - does hardware partitioning
  arguments (sizes in 512-byte blocks):
    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
    [check|set|complete] - mode, complete set partitioning completed
  WARNING: Partitioning is a write-once setting once it is set to complete.
  Power cycling is required to initialize partitions after set to complete.
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
 - Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
 - Change sizes of boot and RPMB partitions of specified device
mmc partconf dev [boot_ack boot_partition partition_access]
 - Show or change the bits of the PARTITION_CONFIG field of the specified device
mmc rst-function dev value
 - Change the RST_n_FUNCTION field of the specified device
   WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
mmc setdsr <value> - set DSR register value

=> mmc part

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

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            38913           00000000-01     0c
  2     40961           15228927        00000000-02     83
=>

最近编辑记录 skliu (2020-07-30 09:03:48)

离线

#9 2020-07-30 09:37:55

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 364
积分: 313

Re: 主线 EMMC写入uboot启动问题

那个SPL的打印就是boot0

离线

#10 2020-08-03 19:43:29

jkl
会员
注册时间: 2019-11-18
已发帖子: 251
积分: 139.5

Re: 主线 EMMC写入uboot启动问题

请问一下,楼主你的问题解决了吗?我现在也遇到跟你同样的问题?

离线

#11 2020-08-05 09:59:38

jkl
会员
注册时间: 2019-11-18
已发帖子: 251
积分: 139.5

Re: 主线 EMMC写入uboot启动问题

楼主,这个问题我已经解决了,在你进行了分区后,之后进入uboot界面,手动输入boot.cmd中的各个命令,看是否能够让系统跑起来,能够跑起来的话,你这样的分区就没有问题,你的boot.cmd应该通过这个指令生成boot.src
mkimage -C none -A arm -T script -d boot.cmd boot.src
看看是否能够从emmc启动。

离线

楼主 #12 2020-08-16 19:43:08

skliu
会员
注册时间: 2020-06-07
已发帖子: 54
积分: 23

Re: 主线 EMMC写入uboot启动问题

jkl 说:

楼主,这个问题我已经解决了,在你进行了分区后,之后进入uboot界面,手动输入boot.cmd中的各个命令,看是否能够让系统跑起来,能够跑起来的话,你这样的分区就没有问题,你的boot.cmd应该通过这个指令生成boot.src
mkimage -C none -A arm -T script -d boot.cmd boot.src
看看是否能够从emmc启动。

前几个礼拜忙别的。 今天回来继续折腾。
很高兴看到同路的。 你讲的不够详细。 你的意思是我分区有问题?
我在tf卡启动后的系统里面做的。 拿掉tf卡就卡在主题描述的位置。
那你是在哪里输入boot.cmd呢? 用tf卡启动进入uboot?

我的uboot是buildroot里面编译的,准备单独去下载编译一个看看。
谢谢。

离线

#13 2020-11-04 21:51:15

九重天
会员
注册时间: 2020-10-06
已发帖子: 25
积分: 17.5

Re: 主线 EMMC写入uboot启动问题

=> mmc list
mmc@1c0f000: 0 (SD)
mmc@1c11000: 1 (eMMC)
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=> mmc info
Device: mmc@1c0f000
Manufacturer ID: 0
OEM: 0
Name: 00000
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 2.0
High Capacity: No
Capacity: 1.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
=> mmc part

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

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            98304           d294b53e-01     0c
  2     100352          411648          d294b53e-02     83
=>
=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=> mmc info
Device: mmc@1c11000
Manufacturer ID: 15
OEM: 100
Name: 8GTF4
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 7.3 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7.3 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 512 KiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=> mmc part
## Unknown partition table type 0
=>

还行, 刚刚测试了小智的X3开发板.

离线

#14 2020-11-05 13:21:26

wupaul2001
会员
注册时间: 2019-09-30
已发帖子: 257
积分: 235

Re: 主线 EMMC写入uboot启动问题

@skliu 要么是你走线有问题

离线

#15 2022-12-09 10:50:12

MacLodge
会员
注册时间: 2022-12-07
已发帖子: 6
积分: 21

Re: 主线 EMMC写入uboot启动问题

楼主有解决吗?我现在遇到跟你一样的问题。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn