菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
290
0

Vivado 2018.2 同时激活 SD0 (sd card) 和 SD1 (emmc) 时,从 emmc 启动的错误:no mmc device at slot 0

原创
05/13 14:22
阅读数 22404

开发环境

Vivado 2018.2

Petalinux 2018.2

 

问题描述

当同时激活 SD0 (对应SD卡座) 和 SD1 (对应板载 emmc) 时,当从 emmc 启动,报如下错误,

U-Boot 2018.01 (Apr 14 2020 - 10:49:36 +0800) Xilinx Zynq ZC702

Board: Xilinx Zynq
Silicon: v3.1
DRAM:  ECC disabled 1 GiB
MMC:   Card did not respond to voltage select!
mmc_init: -95, time 23
sdhci@e0100000 - probe failed: -95
sdhci_transfer_data: Error detected in status(0x208000)!
Card did not respond to voltage select!
mmc_init: -95, time 23

SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Board: Xilinx Zynq
Silicon: v3.1
Net:   ZYNQ GEM: e000b000, phyaddr ffffffff, interface rgmii-id
eth0: ethernet@e000b000
U-BOOT for drive_usb_qspi_sd_ethernet_with_boot_from_emmc

ethernet@e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Hit any key to stop autoboot:  4  3  2  1  0 
no mmc device at slot 0
Zynq> 

 

解决方法

root cause: 配置 Primary SD 为 SD1 后,对应的更改没有更新到 u-boot 中去。

打开 <petalinux-project-path>/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs 下的文件 platform-auto.h,有如下宏,

... 
	"netboot=tftpboot ${netstart} ${kernel_img} && bootm\0" \ 
	"default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart}\0" \ 
""

/* BOOTCOMMAND */
#define CONFIG_BOOTCOMMAND	"run default_bootcmd"

#endif /* __PLNX_CONFIG_H */

打开 <petalinux-project-path>/project-spec/meta-user/recipes-bsp/u-boot/files 下到文件 platform-top.h,添加如下内容 (对上述宏作一个重置),

/*************************************************************************************************************************************/
/* fix SD0 is sd card, SD1 is emmc, if no card insert into SD0 slot, zynq cannot detect SD1 emmc. (Vivado 2018.2 + Petalinux 2018.2) */
/*************************************************************************************************************************************/
#ifdef CONFIG_BOOTCOMMAND
#undef CONFIG_BOOTCOMMAND
#define CONFIG_BOOTCOMMAND "mmc dev ${sdbootdev}; run default_bootcmd"
#endif
/*************************************************************************************************************************************/

重新编译工程即可。

 

参考文件

https://www.xilinx.com/support/answers/69780.html?tdsourcetag=s_pcqq_aiomsg

https://forums.xilinx.com/t5/Embedded-Linux/BOOting-image-ub-from-eMMC/m-p/979363/highlight/false#M33948

 

 

完。

 

发表评论

0/200
290 点赞
0 评论
收藏
为你推荐 换一批