心存一 2022-08-16 19:07 采纳率: 100%
浏览 117
已结题

急需解决!liteos内核USB摄像头驱动加载不上

急需解决,请各位帮忙看看!!

问题现象描述

我在使用gk7202主控的camera编译时,编译选项中明明开启video和UVC支持的。如下图:

img

但是在系统启动后却没有挂载上:

img

启动log

RTOS # random dev init ...
MMC dev init ...sdhci0: LOSCFG_PLATFORM_GK7202V300 selected
sdhci0-slot0: 150MHz HS 4bits VDD: 3.3V 3.0V VCCQ: 3.3V DRV: BACD DMA removable
sdhci1: LOSCFG_PLATFORM_GK7202V300 selected
sdhci1-slot1: 50MHz HS 4bits VDD: 3.3V 3.0V VCCQ: 3.3V DRV: BACD DMA non-removable
sdhci1-slot1: Re-tuning count 0 secs, mode 1
mem dev init ...
porc fs init ...
Mount procfs finished.
gpio init ...
nand init ...
fmc100_host_init(876): Error:Flash type isn't SPI Nand!
spi nor flash init ...
Spi Nor ID:0xEF 0x40 0x18 0x00 0x00 0x00 0x00 0x00 
Spi Nor Flash Info:
Name:"W25Q128(B/F)V" Size:16MB Block:64KB
net init ...

************************************************************
usb init ...

******** usb_init in **********
usb v3.05 2019-10-22 09:32
Entering function [udc3_probe]
mmc: Probing bus
mmc: Current OCR: 0x00000000
mmc: No compatible cards found on bus
  ** uvc device initialized successfully! **
  ** composite attach success **
******** usb_init ok**********

uvc init ...
[CLX DBG] sdk/sample/liteos/app_init.c app_init ... line:324
g_sys_mem_addr_end=0x0x41e00000,
Date:Jul 12 2022.
Time:17:41:39.
[CLX DBG] SDK_init
==== online_flag=0, cmos_yuv_flag=0, sensor=gc2053, chip=gk7202v300, board=sck====
==== g_quick_start_flag=0 ====
sysconfig init success!
osal_proc_mkdir - parent is NULL! proc=0x406082f8 
g_mmz_start=0x42000000, g_mmz_size=0x20
mmz param= anonymous,0,0x42000000,32M
<6>Vendor Media Memory Zone Manager
load sys.ko OK!
load region.ko OK!
load vgs.ko OK!
load isp.ko OK !
load vi.ko OK !
load vpss.ko OK!
load vo.ko OK!
load chnl.ko OK!
load vedu.ko OK!
load rc.ko OK!
load venc.ko OK!
load h264e.ko OK!
load h265e.ko OK!
load jpege.ko OK!
load ive.ko OK!
load aio.ko ....OK!
load ai.ko ....OK!
load ao.ko ....OK!
load aenc.ko ....OK!
load adec.ko ....OK!
load acodec.ko ....OK!
insert audio
spi bus init ...
i2c bus init ...
load mipi_rx driver successful!
sensor i2c init OK.
load tde.ko OK!
Load gfbg.ko OK!
pm init ok!
[CLX DBG] SDK init ok...
[CLX DBG] sdk/sample/liteos/app_init.c app_init ... line:332
[CLX DBG] sdk/sample/liteos/app_init.c app_sample line:174
camera_Task 7:0
[CLX DBG] sdk/sample/liteos/app_init.c app_sample line:186

input command:
sdk_test -bulkmode -uvc -off -ivp -relay [CLX DBG] sdk/sample/liteos/app_init.c com_app line:101


@@@@@ UVC App Sample @@@@@

lixiang test! open_uvc_device  644
waiting for UAC connect!
Waiting for USB connection...

问题相关代码

UVC运行位置


#ifndef __LITEOS__
int main(int argc, char *argv[])
#else
int app_main(int argc, char *argv[])
#endif
{
    int i = argc;

    printf("\n@@@@@ UVC App Sample @@@@@\n\n");

    while (i > 1)
    {
        if (strcmp(argv[i-1], "-bulkmode") == 0)
        {
            g_bulk = 1;
        }

        if (strcmp(argv[i-1], "-h") == 0)
        {
            SAMPLE_UVC_Usage(argv[0]);
        }

        i--;
    }

#ifndef __LITEOS__
    signal(SIGINT, sample_uvc_handle_signal);
    signal(SIGTERM, sample_uvc_handle_signal);
#endif

    if (create_cache() != 0)
    {
        goto EXIT0;
    }

    if (run_camera() != 0)
    {
        goto EXIT1;
    }

EXIT1:
    stop_camera();
    destroy_cache();
EXIT0:
    printf("uvc_app exit!\n");
    return 0;
}

int app_main(int argc, char *argv[])的调用

void com_app(unsigned long p0, unsigned long p1, unsigned long p2, unsigned long p3)
{
    int i = 0;
    unsigned int argc = p0;
    char** argv = (char**)p1;

    dprintf("\ninput command:\n");

    for (i = 0; i < argc; i++)
    {
        dprintf("%s ", argv[i]);
    }
    printf("[CLX DBG] sdk/sample/liteos/app_init.c com_app line:101\n");
    dprintf("\n");
    app_main(argc, argv);
    dprintf("\nmain out\n");
    dprintf("[END]:app_test finish!\n");
    free(args_buf_t);
    args_buf_t = NULL;
    taskid = -1;
    printf("[CLX DBG] sdk/sample/liteos/app_init.c com_app line:109\n");
}

void com_app的调用

unsigned int app_sample(int argc, char **argv )
{
    int i = 0;
    unsigned int ret = 0;
    int len = 0;
    char* pch = NULL;
    TSK_INIT_PARAM_S stappTask;
/*
    if (argc < 1)
    {
        dprintf("illegal parameter!\n");
    }
*/
    if (taskid != -1)
    {
        dprintf("There's a app_main task existed.");
    }
/*
    args_buf_t = zalloc(ARG_BUF_LEN_T);
    memset(&stappTask, 0, sizeof(TSK_INIT_PARAM_S));
    pch = args_buf_t;

    for (i = 0; i < ARGS_SIZE_T; i++)
    {
        ptask_args[i] = NULL;
    }
*/
    //argc++;
    ptask_args[0] = "sdk_test";
    ptask_args[1] = "-bulkmode";
    ptask_args[2] = "-uvc";
    ptask_args[3] = "-off";
    ptask_args[4] = "-ivp";
    ptask_args[5] = "-relay";
    //ptask_args[5] = "-motor";
    
    
    argc = 6;
    /*
    for (i = 1; i < argc; i++)
    {
        len = strlen(argv[i - 1]);
        memcpy(pch, argv[i - 1], len);
        ptask_args[i] = pch;
        //keep a '\0' at the end of a string.
        pch = pch + len + 1;

        if (pch >= args_buf_t + ARG_BUF_LEN_T)
        {
            dprintf("args out of range!\n");
            break;
        }
    }
*/
   // chdir("/sharefs");

    printf("[CLX DBG] sdk/sample/liteos/app_init.c app_sample line:174\n");
    (void)memset_s(&stappTask, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
    stappTask.pfnTaskEntry = (TSK_ENTRY_FUNC)com_app;
    stappTask.uwStackSize = 0x20000;
    stappTask.pcName = "sdk_test";
    stappTask.usTaskPrio = 10;
    stappTask.uwResved = LOS_TASK_STATUS_DETACHED;
    stappTask.auwArgs[0] = argc;
    stappTask.auwArgs[1] = (unsigned long)ptask_args;
    ret = LOS_TaskCreate(&taskid, &stappTask);

    dprintf("camera_Task %d:%d\n", taskid,ret);
    printf("[CLX DBG] sdk/sample/liteos/app_init.c app_sample line:186\n");
    return ret;
}

我想要达到的结果

usb摄像头驱动正常使用。

  • 写回答

1条回答 默认 最新

  • 来灵 2022-08-17 08:42
    关注

    日志里边看uvc和usb初始化都完成了,但有个“mmc: No compatible cards found on bus”。
    还有后边的日志“Waiting for USB connection...” 没连上摄像头

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 8月30日
  • 已采纳回答 8月22日
  • 创建了问题 8月16日

悬赏问题

  • ¥15 qt+ffmpeg报错non-existing PPS 0 referenced
  • ¥15 FOC simulink
  • ¥15 咨询一下有关于王者荣耀赢藏战绩
  • ¥50 MacOS 使用虚拟机安装k8s
  • ¥500 亚马逊 COOKIE我如何才能实现 登录一个亚马逊账户 下发新 COOKIE ..我使用下发新COOKIE 导入ADS 指纹浏览器登录,我把账户密码 修改过后,原来下发新COOKIE 不会失效的方式
  • ¥20 玩游戏gpu和cpu利用率特别低,玩游戏卡顿
  • ¥25 oracle中的正则匹配
  • ¥15 关于#vscode#的问题:把软件卸载不会再出现蓝屏
  • ¥15 vimplus出现的错误
  • ¥30 怎么使用AVL fire ESE软件自带的优化模式来优化设计Soot和NOx?