嵌入式爱好者

查看: 512|回复: 1

[Linux] 有关emmc的分区困惑

[复制链接]

1

主题

4

帖子

15

积分

i.MX6Q通行证

扫一扫,手机访问本帖
发表于 2024-5-14 20:31:46 | 显示全部楼层 |阅读模式
本帖最后由 yepc 于 2024-5-14 20:37 编辑

事情是这样的 我拿到公司的板子给了2份代码 一份是spl的 一份是正常的。 烧录uboot.imx的也是起不来。因为mksdcard.sh.tar 当时用的spl的那版分区,后来用了飞凌的和nxp官网的,也是没有起来。引脚都是ok的,是串口1打印。当时以为是那个.cfg里面寄存器初始化的问题 ,我现在把那个也改了  hex看了 前3k基本一样就是长度不一样 。然后就是uboot的一系列简单的外设初始化。我只想打印个串口而已。  新手期很困惑这个到底怎么处理,请各位大佬解惑。
公司的板子是用spl+uboot.img的
mksdcard.sh.tar
        
  1. # wait for the SD/MMC device node ready
  2. while [ ! -e $1 ]
  3. do
  4. sleep 1
  5. echo “wait for $1 appear”
  6. done

  7. # call sfdisk to create partition table
  8. # destroy the partition table
  9. node=$1
  10. dd if=/dev/zero of=${node} bs=512 count=20 conv=notrunc

  11. sfdisk --force ${node} << EOF
  12. label: gpt
  13. 256M 512M L
  14. 768M 512M L
  15. 1280M 512M L
  16. 1792M 128M L
  17. 1920M 1408M L
  18. 3328M 128M L
  19. 3456M 128M L
  20. EOF
复制代码
ucl2.xml  uboot部分是这样的


  1.         <CMD state="Updater" type="push" body="$ sleep 1 ">Sleep 1s to wait /dev/mmcblk%mmc% ready</CMD>
  2.         <CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
  3.         <CMD state="Updater" type="push" body="$ tar xf $FILE "> tar Partitioning shell...</CMD>
  4.         <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>
  5.         
  6.         <!-- clear uboot args -->
  7.         <CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=768 conv=fsync count=8">clear u-boot arg</CMD>
  8.         <!-- burn SPL and UBOOT -->
  9.         <CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
  10.         <CMD state="Updater" type="push" body="send" file="files/imx6dl/SPL" ifdev="MX6D">Sending SPL</CMD>
  11.         <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write SPL to mmc boot0</CMD>
  12.         
  13.         <CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
  14.         
  15.         <CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>
复制代码
可以正常打开串口跑起来的

我自己编译的版本是uboot.imx  
mksdcard.sh.tar
  1. BOOT_ROM_SIZE=10
  2. # wait for the SD/MMC device node ready
  3. while [ ! -e $1 ]
  4. do
  5. sleep 1
  6. echo “wait for $1 appear”
  7. done

  8. # call sfdisk to create partition table
  9. # destroy the partition table
  10. node=$1
  11. dd if=/dev/zero of=${node} bs=1024 count=1

  12. sfdisk --force ${node} << EOF
  13. ${BOOT_ROM_SIZE}M,128M,c
  14. 138M,,83
  15. write
  16. EOF
复制代码



ucl2.xml  uboot部分是这样的
  1. <CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
  2.         <CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
  3.         <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>
  4.         <!-- clear uboot args -->


  5.         <CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=768 conv=fsync count=8">clear u-boot env</CMD>
  6.         <CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
  7.         <CMD state="Updater" type="push" body="send" file="files/imx6dl/u-boot.imx">Sending u-boot.bin</CMD>
  8.         <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
  9.         <CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
  10.         <CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>
复制代码
nxp的源码还有飞凌的代码源码我都试过了  板子就是参考飞凌板子做的,  uboot.imx版本的 串口就是死活打印不出来,求教还要注意什么东西?卡在这里好几天了


回复

使用道具 举报

1

主题

4

帖子

15

积分

i.MX6Q通行证

 楼主| 发表于 2024-5-14 20:38:20 | 显示全部楼层
不符合长度
点评回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-6-29 16:55

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表