cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
1,208 Views
Registered: ‎05-03-2018

BOOting image.ub from eMMC

Hi,
 Recently,I try to boot zynq7000(7020)from QSPI amd eMMc.I want to use QSPI as first bootstage emmc as second bootstage.I done as “PicoZed_Petalinux_2014_4_eMMC_boot_v2.0.pdf”writed.
1. My petalinux project config is show below:
-*- Subsystem AUTO Hardware Settings  --->
  SD/SDIO Settings  --->
   Primary SD/SDIO (ps7_sd_1)  --->
  [*]   Advanced bootable images storage Settings  --->
   boot image settings  --->
    image storage media (primary flash)  --->
    image storage media (primary sd)  --->
2. BOOT 7020 from sd first
 1).flashcp Boot.bin /dev/mtd0
 2). partition and format emmc
  Fdisk /dev/mmcblk1
  Mkdosfs -F 32 /dev/ mmcblk1p1
3. change the boot switch to qspi boot and reboot system
then I found I can boot u-boot,but I can not boot linux kernel ,I can not found emmc.

1.png

Then I Insert the microSD (not set boot switch to sd boot),

2.png

It found sd card ,My sd card In ps7_sd_0,and my eMMC in ps7_sd_1.
Then I check <project root>/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h

3.png

sdio - ps7_sd_1 is selected.looking for help…

0 Kudos
4 Replies
Highlighted
Visitor
Visitor
853 Views
Registered: ‎03-31-2019

Re: BOOting image.ub from eMMC

i meet the same problem too, have you solved it yet?
i can boot when flash the BOOT.BIN and kernel all into the QSPI flash ,use the rootfs in the eMMC
0 Kudos
Highlighted
Visitor
Visitor
848 Views
Registered: ‎03-31-2019

Re: BOOting image.ub from eMMC

O~~29])_U[`G]4V)()4DL)8.png

ok, i fonud some solution for it

on my board , the SD0 is SD card and not inserd,SD1 is the eMMC

i use the petalinux to generate my linux system,configed it use the primary SD1,kernel boot from primary sd

flash the BOOT.BIN into the qspi-flash and boot from it ,then the problem occurred

use the command 

mmc dev 1

to force change the uboot use the emmc on the sd1,and boot.It worked

 

i'm strange why my configes in the petalinux wount apply? Is there some unknow bugs?

I found the pages AR#69780  i have'nt try it , is the AR#69780 is the key to the problem?

but i fount it says it's petalinux in 2017, but i'm using the petalinux 2018.3

 

 meanwhile i take a look at  <plnx-proj-root>/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h . but it seems " tried to fix the problem" look at the variate " sdbootenv"批注 2019-06-01 171257.png

hope someone's reply

0 Kudos
Highlighted
Visitor
Visitor
835 Views
Registered: ‎03-31-2019

Re: BOOting image.ub from eMMC

好吧,找到个简单的解决方法,为了避免表述问题这里用中文回答了

这个问题的确如AR#69780 中所描述的,是uboot的变量配置出错导致的

尽管在petalinux 2018.3版本中我们可以看到官方在<plnx-proj-root>/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h 文件中“亡羊补牢”的加上了 sdbootdev 变量,并且让它表示我们在petalinux中标识的主SD编号:UGV[~WQ{J44FIGZB7)&#125;1{2G.png

cp_kernel2ram变量在后面会被执行

	"default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart}\0" \ 
""

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

但是这里,如果当板上使用了两个SD/SDIO,但是用户将SD0作为SD卡使用,SD1作为eMMC使用,则会有一个问题。那就是虽然在petalinux中配置使用eMMC作为主启动SD(也的确修改了sdbootdev变量),但是当SD0,即SD卡槽没有插入SD卡时,uboot在执行mmcinfo时会报错提示mmc0 卡槽未检测成功,导致后面的命令全部终止。

这里介绍一个简单的解决方法:simple resolution

在 project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h 文件的末尾加入下面的代码

/*   fix codes  */
#ifdef CONFIG_BOOTCOMMAND
#undef CONFIG_BOOTCOMMAND
#define CONFIG_BOOTCOMMAND	"mmc dev ${sdbootdev}; run default_bootcmd"
#endif

实际上是在执行默认启动环境变量前先将mmc切换到sdbootdev所表示的SD设备(可能是0,也可能是1,这取决于用户在petalinux中设置primary SD是哪一个)

重新生成uboot,打包

petalinux-build -c u-boot -x cleanall
petalinux-build -c u-boot
petalinux-package --boot --fsbl --fpga --u-boot --force

将生成的BOOT.BIN烧录到mtd0(dd或者flash_write),image.ub放入emmc中

这个方法成功解决了我的问题

希望能帮助到大家

 

祝好

里先森

0 Kudos
Highlighted
Observer
Observer
541 Views
Registered: ‎03-03-2017

Re: BOOting image.ub from eMMC

你好!

我也遇到跟你一样的问题,参照你的配置,确实可以解决移除SD卡的问题。

但是我发现进入系统后,/dev/目录下已经找不到mmcblk1p1这个emmc设备了。

没办法mount emmc。

请问你那边遇到过这样的问题吗?

0 Kudos