Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    D1 fastboot烧写rootfs分区有问题

    MR Series
    12
    29
    9336
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chenlinfei LV 5 last edited by

      .\fastboot.exe flash rootfs ..\rootfs.img
      < waiting for any device >
      Sending 'rootfs' (16000 KB) OKAY [ 0.539s]
      Writing 'rootfs' OKAY [ 4.307s]
      Finished. Total time: 16.752s

      显示烧写成功,但是实际内容没有更新

      Y 1 Reply Last reply Reply Quote Share 1
      • Y
        yaoxiaoyao LV 5 last edited by

        我也有同样的问题

        1 Reply Last reply Reply Quote Share 0
        • Y
          yaoxiaoyao LV 5 @chenlinfei last edited by

          @chenlinfei 请问您找到问题了没有

          C 1 Reply Last reply Reply Quote Share 0
          • C
            chenlinfei LV 5 @yaoxiaoyao last edited by

            @yaoxiaoyao 还没有,真的不行的话只能调试跟进去看了

            1 Reply Last reply Reply Quote Share 0
            • C
              chenlinfei LV 5 last edited by

              1、#define FASTBOOT_TRANSFER_BUFFER_SIZE (256 << 20)值是错误的。导致"drivers/sunxi_usb/usb_fastboot.c"的while (data_sectors >= nblock) {的代码没有执行到。
              2、改成#define FASTBOOT_TRANSFER_BUFFER_SIZE (256 << 1),while循环能执行进去。
              3、但是后面还是无法烧写进去
              4、怀疑是ubi相关的问题

              1 Reply Last reply Reply Quote Share 0
              • C
                chenlinfei LV 5 last edited by

                刚测试,V2.0版本的SDK,这个问题还是存在。

                1 Reply Last reply Reply Quote Share 1
                • C
                  chuwangmvp LV 2 last edited by

                  问题+1
                  望速解!!!

                  1 Reply Last reply Reply Quote Share 1
                  • C
                    chunzhang LV 4 last edited by

                    望速解。。。。。。

                    1 Reply Last reply Reply Quote Share 0
                    • Z
                      zhuxinran LV 1 last edited by

                      这个问题看起来挺严重的

                      1 Reply Last reply Reply Quote Share 0
                      • Q
                        qianhao LV 4 last edited by

                        啊 这 得加速解决啊

                        1 Reply Last reply Reply Quote Share 0
                        • M
                          memory LV 7 last edited by

                          SDK是什么版本? 启动介质是 SPI NAND ? SPI NOR ? TF / eMMC?

                          1 Reply Last reply Reply Quote Share 0
                          • S
                            smartcar LV 2 last edited by whycan

                            我好奇测试了一下,完全正常。

                            D1s tina v2.0, spi nor,mangopi 麻雀开发板

                            启动按住 ssssssssss 进入 uboot命令行,输入fastboot

                            电脑执行: fastboot erase rootfs,重启后无法进入根文件系统:
                            26d20d40-4bb5-4b92-8bbd-c030d1e4f9e1-4b6468c76825f76c34002853b026240.png

                            电脑执行: fastboot flash rootfs rootfs.img,重启后正常进入shell:
                            2ad22dac-0c41-4e6f-82e6-eb28127b0af1-b471e71d5367837ad2a77c5edf1adff.png

                            参考: Win32 用 FASTBOOT 烧写 A100 eMMC
                            https://bbs.aw-ol.com/topic/1027

                            C 1 Reply Last reply Reply Quote Share 0
                            • xiaowenge
                              DOT小文哥 LV 8 last edited by

                              大家聊的不是一个?有人用D1(D1-H),有人用D1s😧

                              sora1874 1 Reply Last reply Reply Quote Share 0
                              • C
                                chunzhang LV 4 @smartcar last edited by

                                @smartcar 你好,我这边用的是D1-H,你的这种现象我这边也是能够实现的,但是烧进去之后,跟文件系统实际内容却没有更新,这是我的操作步骤
                                1、在跟文件系统下面创建文件夹:touch test
                                2、电脑执行:fastboot erase,重启后无法进入跟文件系统
                                3、电脑执行:fastboot flash,烧写成功,重启,发现 test 文件夹依然存在,跟文件系统更新失败

                                1 Reply Last reply Reply Quote Share 0
                                • C
                                  chunzhang LV 4 last edited by

                                  这个fastboot erase的实现也有点古怪,擦除flash用的是往flash写全f
                                  fastboot erase.png

                                  whycan 1 Reply Last reply Reply Quote Share 0
                                  • sora1874
                                    sora1874 LV 5 @xiaowenge last edited by

                                    @xiaowenge D1-H

                                    1 Reply Last reply Reply Quote Share 0
                                    • whycan
                                      whycan晕哥 LV 9 @chunzhang last edited by whycan

                                      @chunzhang
                                      flash擦除之后所有位都是1,工艺决定的。

                                      试一试擦除更新boot分区?

                                      C 1 Reply Last reply Reply Quote Share 0
                                      • C
                                        chunzhang LV 4 @whycan last edited by

                                        @whycan 你好,请问更新boot分区是用来干什么的?现在在更新跟文件系统,更新之后发现实际内容没有更新

                                        sora1874 1 Reply Last reply Reply Quote Share 0
                                        • sora1874
                                          sora1874 LV 5 @chunzhang last edited by

                                          @chunzhang boot分区可以更新内核,但是设备树部分我目前还没找到位置来更新

                                          C 1 Reply Last reply Reply Quote Share 0
                                          • C
                                            chunzhang LV 4 @sora1874 last edited by

                                            @sora1874 我目前是在使用fastboot更新跟文件系统,只更新跟文件系统,其他的不动。我不太明白更新跟文件系统和这个更新boot的关系,boot中对rootfs的大小,起始位置的描述都是对的

                                            whycan 1 Reply Last reply Reply Quote Share 0
                                            • whycan
                                              whycan晕哥 LV 9 @chunzhang last edited by

                                              @chunzhang
                                              你的是spi nand吗? 哪吒开发板自带的flash吗?rootfs是ubi吗?squashfs?

                                              C 1 Reply Last reply Reply Quote Share 0
                                              • C
                                                chunzhang LV 4 @whycan last edited by

                                                @whycan 你好,tina sdk默认编译的,用的就是spi nand,板子自带的flash,ubi也用了

                                                whycan 1 Reply Last reply Reply Quote Share 0
                                                • whycan
                                                  whycan晕哥 LV 9 @chunzhang last edited by

                                                  @chunzhang
                                                  麻烦提供一下sdk版本, 1.0还是2.0呢?

                                                  C 3 Replies Last reply Reply Quote Share 0
                                                  • C
                                                    chunzhang LV 4 @whycan last edited by

                                                    @whycan 2.0的

                                                    1 Reply Last reply Reply Quote Share 0
                                                    • C
                                                      chunzhang LV 4 @whycan last edited by

                                                      @whycan 函数 spinand_mtd_write_ubi 的这段代码存在问题。

                                                      	if (num == ubinfo->last_partno) {
                                                      		if (offset != ubinfo->last_offset) {
                                                      			pr_err("offset 0x%x smaller than last offset 0x%x\n",
                                                      					ubinfo->last_offset, offset);
                                                      			goto err;
                                                      		}
                                                      	}
                                                      

                                                      当PC端执行 fastboot erase rootfs 之后在执行 fastboot flash rootfs 时 ubinfo->last_partno 是上一次对 rootfs 擦除的的操作值 7,num 是本次对 flash 写的操作值 7;offset = 0,ubinfo->last_offset是上一次对 rootfs 擦除最后的偏移量 126000。此时就会进入 err。

                                                      但是在擦除操作之后重启再写 flash 可以正常写,避免这个错误,对目前 fastboot 更新 rootfs 的失败结果不造成影响。这个问题应该也需要修复。

                                                      1 Reply Last reply Reply Quote Share 0
                                                      • C
                                                        chunzhang LV 4 @whycan last edited by

                                                        @whycan 之前是认为跟文件系统的数据紧跟着跟文件系统存储的,这样执行1、fastboot erase rootfs 2、fastboot flash 就把跟文件系统的数据(在根目录下创建的test文件夹)干掉了。

                                                        但是 跟文件系统 和 跟文件系统的数据 是 分开存储 的,不知道数据放在那里了,所以更新跟文件系统之后数据依然存在(可以通过删除跟文件下的数据更新跟文件系统进行验证跟文件系统更新成功)

                                                        请问, 跟文件系统的数据 放在哪里了?

                                                        C 1 Reply Last reply Reply Quote Share 0
                                                        • C
                                                          chunzhang LV 4 @chunzhang last edited by

                                                          @chunzhang
                                                          1、跟文件系统 和 跟文件系统的数据 占了两块不连续的flash,一个rootfs区域,一个UDISK区域。
                                                          2、在 制作镜像 的时间,类似于/usr/bin/dbus-daemon 是在rootfs区域
                                                          3、启动之后,在跟文件下面 新创建 的文件夹 ( /home/root/test /usr/bin/temp) 是在UDISK区域

                                                          U 1 Reply Last reply Reply Quote Share 0
                                                          • U
                                                            uuuuid LV 6 @chunzhang last edited by

                                                            @chunzhang

                                                            042eb2a4-6a80-474d-851a-ae59b950927e-image.png

                                                            奇怪了,我这里 D1 SPI NAND fastboot 直接失败, 啥也动不了。

                                                            => part list sunxi_flash 0
                                                            
                                                            Partition Map for UNKNOWN device 0  --   Partition Type: EFI
                                                            
                                                            Part    Start LBA       End LBA         Name
                                                                    Attributes
                                                                    Type GUID
                                                                    Partition GUID
                                                              1     0x000001f8      0x00002177      "boot-resource"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e45
                                                              2     0x00002178      0x0000236f      "env"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e46
                                                              3     0x00002370      0x00002567      "env-redund"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e47
                                                              4     0x00002568      0x0000761f      "boot"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e48
                                                              5     0x00007620      0x00011597      "rootfs"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e49
                                                              6     0x00011598      0x00011987      "dsp0"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e4a
                                                              7     0x00011988      0x000187c7      "recovery"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e4b
                                                              8     0x000187c8      0x0001ebc7      "rootfs_data"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e4c
                                                              9     0x0001ebc8      0x00076197      "UDISK"
                                                                    attrs:  0x8000000000000000
                                                                    type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
                                                                    guid:   a0085546-4166-744a-a353-fca9272b8e4d
                                                            =>
                                                            
                                                            => fastboot
                                                            sunxi_fastboot_init
                                                            recv addr 0x41000000
                                                            send addr 0x7ef2d850
                                                            start to display fastbootlogo.bmp
                                                            partno erro : can't find partition bootloader
                                                            ** Unable to read file fastbootlogo.bmp **
                                                            [85.453]sunxi bmp info error : unable to open logo file fastbootlogo.bmp
                                                            delay time 0
                                                            weak:otg_phy_config
                                                            usb init ok
                                                            sunxi_usb_fastboot_status=0
                                                            set address 0x40
                                                            set address 0x40 ok
                                                            sunxi_usb_fastboot_status=1
                                                            SUNXI_USB_FASTBOOT_SETUP
                                                            fastboot command = getvar:partition-type:boot-resource
                                                            getvar
                                                            sunxi_usb_fastboot_status=0
                                                            sunxi_usb_fastboot_status=1
                                                            SUNXI_USB_FASTBOOT_SETUP
                                                            fastboot command = erase:boot-resource
                                                            erase
                                                            ********* starting to erase boot-resource partition, this may take some time, please wait for minutes ***********
                                                            sunxi fastboot: partition 'boot-resource' erased
                                                            sunxi_usb_fastboot_status=0
                                                            sunxi_usb_fastboot_status=1
                                                            SUNXI_USB_FASTBOOT_SETUP
                                                            fastboot command = getvar:partition-type:boot-resource
                                                            getvar
                                                            sunxi_usb_fastboot_status=0
                                                            sunxi_usb_fastboot_status=1
                                                            SUNXI_USB_FASTBOOT_SETUP
                                                            fastboot command = getvar:max-download-size
                                                            getvar
                                                            response: OKAY0x02000000
                                                            sunxi_usb_fastboot_status=0
                                                            sunxi_usb_fastboot_status=1
                                                            SUNXI_USB_FASTBOOT_SETUP
                                                            fastboot command = download:002f8c00
                                                            download
                                                            Starting download of 3116032 BYTES
                                                            Starting download of 2 MB
                                                            download response: DATA002f8c00
                                                            sunxi_usb_fastboot_status=3
                                                            fastboot transfer finish
                                                            sunxi_usb_fastboot_status=0
                                                            sunxi_usb_fastboot_status=1
                                                            SUNXI_USB_FASTBOOT_SETUP
                                                            fastboot command = flash:boot-resource
                                                            flash
                                                            ready to download bytes 0x2f8c00
                                                            sparse: bad magic
                                                            [115.737]offset 0x1f80 smaller than last offset 0x0
                                                            sunxi fastboot download FAIL: failed to write partition boot-resource
                                                            sunxi_usb_fastboot_status=0
                                                            
                                                            C 1 Reply Last reply Reply Quote Share 0
                                                            • C
                                                              chunzhang LV 4 @uuuuid last edited by

                                                              @uuuuid 你看这个帖子,问题就出在 erase 之后需要重启才能 flash 就是这样的

                                                              @chunzhang 在 D1 fastboot烧写rootfs分区有问题 中说:

                                                              @whycan 函数 spinand_mtd_write_ubi 的这段代码存在问题。

                                                              	if (num == ubinfo->last_partno) {
                                                              		if (offset != ubinfo->last_offset) {
                                                              			pr_err("offset 0x%x smaller than last offset 0x%x\n",
                                                              					ubinfo->last_offset, offset);
                                                              			goto err;
                                                              		}
                                                              	}
                                                              

                                                              当PC端执行 fastboot erase rootfs 之后在执行 fastboot flash rootfs 时 ubinfo->last_partno 是上一次对 rootfs 擦除的的操作值 7,num 是本次对 flash 写的操作值 7;offset = 0,ubinfo->last_offset是上一次对 rootfs 擦除最后的偏移量 126000。此时就会进入 err。

                                                              但是在擦除操作之后重启再写 flash 可以正常写,避免这个错误,对目前 fastboot 更新 rootfs 的失败结果不造成影响。这个问题应该也需要修复。

                                                              1 Reply Last reply Reply Quote Share 0
                                                              • 1 / 1
                                                              • First post
                                                                Last post

                                                              Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                                                              行为准则 | 用户协议 | 隐私权政策