• Lv1
    粉丝0

积分0 / 贡献0

提问1答案被采纳0文章0

作者动态

    求助:OpenHarmony移植到使用spinand的小型系统时出现问题

    kodiak 显示全部楼层 发表于 2025-2-9 20:02:41
    ### 【问题描述】

    我正在使用第三方的Hi3516DV300开发板。其去除了对emmc和spinor的支持,仅能够使用spinand烧录。我尝试修改了config.gni以解决这个问题:

    ```
    # Board storage type, it used for file system generation.
    storage_type = "nand"
    ```

    我尝试过不同的 `storage_type`配置, `nand`、`spinand`等,无论如何最后编译时在 `out`文件夹中的 `config.h`中,始终有:

    ```c++
    #define LOSCFG_STORAGE_SPINOR 1
    ```

    我貌似并没有看到有官方文档提过这个参数的配置应该如何修改,请问我应该如何将该项配置修正为spinand

    ### 【运行环境】

    我直接使用了命令行编译,采用从 `https://gitee.com/openharmony/manifest`仓库拉取的最新代码
    编译时使用docker编译环境,使用 `python3 build.py -p ipcamera_hispark_taurus@hisilicon`直接进行编译,期间仅对 `/home/openharmony/device/board/hisilicon/hispark_taurus/liteos_a/config.gni`中的 `storage_type`一项进行了修改,其余保持不变

    ### 【附件】

    我使用的烧录文件如下:

    ```xml
    <?xml version="1.0" encoding="GB2312" ?>
    <Partition_Info ProgrammerFile="">
    <Part Sel="1" PartitionName="fastboot" FlashType="nand" FileSystem="none" Start="0" Length="1M" SelectFile="E:\Temp\write\u-boot-hi3516dv300.bin"/>
    <Part Sel="1" PartitionName="kernel" FlashType="nand" FileSystem="none" Start="1M" Length="9M" SelectFile="E:\Temp\write\OHOS_Image.bin"/>
    <Part Sel="1" PartitionName="rootfs" FlashType="nand" FileSystem="none" Start="10M" Length="50M" SelectFile="E:\Temp\write\yaffs2-root.img"/>
    <Part Sel="1" PartitionName="" FlashType="nand" FileSystem="none" Start="60M" Length="50M" SelectFile="E:\Temp\write\yaffs2-user.img"/>
    </Partition_Info>
    ```

    使用工具对OpenHarmony生成的文件系统镜像做了修改重新生成。

    使用的boot配置如下:

    ```shell
    # setenv bootcmd "nand read 0x80000000 0x100000 0x900000;go 0x80000000";
    # setenv bootargs "console=ttyAMA0,115200n8 root=nand fstype=yaffs2 rootaddr=10M rootsize=50M rw";
    ```

    启动时日志如下(上略):

    ```shell
    ... ...
    hilog ringbuffer full, drop 5 line(s) log
    hilog ringbuffer full, drop 12 line(s) log
    hilog ringbuffer full, drop 6 line(s) log
    net init ...

    tcpip_init start
    NetifStatusCallback(): nsc event: 0xf0
    NetifStatusCallback: input args is NULL
    NetifStatusCallback(): nsc event: 0x4
    NetifStatusCallback(): nsc event: 0x8
    NetifStatusCallback(): nsc status changed: 1

    tcpip_init end
    Ethernet start.
    ************************************************************
    OsMountRootfs start ...
    [ERR][KProcess:SystemInit]Get spinor mtd failed!
    [ERR][KProcess:SystemInit]get cmdline error!
    [ERR][KProcess:SystemInit]Should call LOS_GetCmdLine() first!
    [ERR][KProcess:SystemInit]parse bootargs error!
    [ERR][KProcess:SystemInit]Cannot find root![ERR][[ERR][Init:thread0][VFS]lookup failed, invalid path err = -22
    hilog ringbuffer full, drop 38 line(s) log
    hilog ringbuffer full, drop 8 line(s) log

    ```

    我的板子并不支持spinor。我翻看了内核源码,若 `LOSCFG_STORAGE`配置正确,其不应该尝试启动spinor,应该直接去启动spinand才对

    您尚未登录,无法参与评论,登录后可以:
    参与开源共建问题交流
    认同或收藏高质量问答
    获取积分成为开源共建先驱

    Copyright   ©2025  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

    返回顶部