我司设备是基于/dev/vendor_storage下存储的sn、lan、mac等信息作为设备基本标识的,在RK3576上正常读取,但是突然在rk3588(定昌A588)主板上读取失效,其读取过程如下:

int vsfd = open("/dev/vendor_storage", O_RDONLY, 0);
    if (vsfd < 0) {
        std::cout << "vendor_storage open fail " << strerror(errno) << std::endl;
        return -1;
    }

    req.tag = VENDOR_REQ_TAG;
    req.id = VENDOR_SN_ID;
    req.len = RKNAND_SYS_STORGAE_DATA_LEN; /* max read length to read*/
    ret = ioctl(sys_fd, VENDOR_READ_IO, &req);
    close(sys_fd);
    if (DEBUG_LOG) dump_hex_data("vendor read:", req.data, req.len / 4 + 3);
    /* return req->len is the real data length stored in the NV-storage */
    if (ret) {
        std::cout << "vendor read error" << std::endl;
        // 这里读到内容全部是0x00 0x00
        return -1;
    }

        分析原因后得到,定昌A588出厂没有烧录这些工具,需要使用RKDevInfoWriteTool工具重新进行写号操作。

具体RKDevInfoWriteTool工具使用方法见下一篇。

Logo

中国智能体开发者社区,聚焦智能体与大模型开发,提供前沿资讯、实用工具链、开源项目及行业案例。通过技术沙龙、开发者大赛等活动,促进经验交流与协作,助力开发者快速构建创新智能应用。

更多推荐