FX3/CX3(CYUSB3065) 关于线程被锁住的问题

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YaXi_4492421
Level 2
Level 2
10 replies posted 10 questions asked 5 replies posted

我使用这个芯片,然后使用例程,创建了一个DMA通过USB3传递UVC视频数据(作为电脑的摄像头),功能已经实现,但是当设备连接到电脑,电脑枚举到设备,但是尚未选中设备做摄像头的时候,设备系统的线程都不在运行(看起来像被锁住了),包含系统提供的时钟接口(CyU3PTimerCreate或tx_timer_create)也不再回调函数,直到电脑选中设备,这些线程才会继续运行。

注意:设备没有连接到电脑,或者设备被电脑选中之后,设备的线程都是正常的

0 点赞
1 解答
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

您好,这种情况是因为CX3根据USB协议的要求进入了suspend状态。

参考一下部分代码:

/* Handle Suspend Event*/

  if (eventFlag & CX3_USB_SUSP_EVENT_FLAG)

  {

  /* Place CX3 in Low Power Suspend mode, with USB bus activity as the wakeup source. */

  CyU3PMipicsiSleep ();

  CyCx3_ImageSensor_Sleep ();

  

  status = CyU3PSysEnterSuspendMode (CY_U3P_SYS_USB_BUS_ACTVTY_WAKEUP_SRC, 0, &wakeReason);

  CyU3PDebugPrint (4, "\n\rEnterSuspendMode Status = 0x%x, Wakeup reason = 0x%x", status, wakeReason);

  

  if (glMipiActive)

  {

  CyU3PMipicsiWakeup ();

  CyCx3_ImageSensor_Wakeup ();

  }

  }

在原帖中查看解决方案

0 点赞
1 回复
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

您好,这种情况是因为CX3根据USB协议的要求进入了suspend状态。

参考一下部分代码:

/* Handle Suspend Event*/

  if (eventFlag & CX3_USB_SUSP_EVENT_FLAG)

  {

  /* Place CX3 in Low Power Suspend mode, with USB bus activity as the wakeup source. */

  CyU3PMipicsiSleep ();

  CyCx3_ImageSensor_Sleep ();

  

  status = CyU3PSysEnterSuspendMode (CY_U3P_SYS_USB_BUS_ACTVTY_WAKEUP_SRC, 0, &wakeReason);

  CyU3PDebugPrint (4, "\n\rEnterSuspendMode Status = 0x%x, Wakeup reason = 0x%x", status, wakeReason);

  

  if (glMipiActive)

  {

  CyU3PMipicsiWakeup ();

  CyCx3_ImageSensor_Wakeup ();

  }

  }

0 点赞