嗨,Ashlin,
关于您的代码:
Delay必须在下面两行之间给出,对于CYU3PUBGETSCAST()返回正确的值:
状态= CYU3pCONTCOSTATE(CyrEt,CyTrue);
如果(CUU3PUBGETFAST())!= CyuU3PySuffi速度
以下是C型连接器工作的另一种方法:
下面是MXX控制中FX3/CX3固件需要遵循的一系列步骤:
1)禁用USB2支持。
2)尝试使用第一个UB3对建立UB3连接。
3)检查CYU-U3PUSB事件和CYU-U3PUSB事件ESPB3LNKFAILT。
如果触发两个事件中的任何一个,请执行以下操作:
a)通过使用CYU3pCONTCONSTATE(CYFALSE,CyFalse)禁用USB PHY;
b)切换MUX选择GPIO。
c)启用USB 2支持
d)调用连接状态API以使用第二对建立USB 3连接。
如果遵循以上步骤,则代码更改:
a)第一次改变:
在FX3/CX3固件中,注释掉CYU3PCONTCONSTATE()API,并添加下面的代码片段来代替:
状态= CYU3PUBSCONDSUB2支持(CyFLUE);
如果(状态)!= CYU-U3PY成功
{
CYU3pDebug打印(4, \RN禁用USB2失败)。停止执行“”;
(1);
}
CYU3PTHeLead睡眠(20);
状态= CYU3pCONTCOSTATE(Cytru,CyTrue);
CYU3PTHeLead睡眠(50);
对于(int i=0;(i & lt;100 &&!);u3x事件)
CYU3PTHeLead睡眠(5);
如果(!)u3-真)
{
CUU3pDebug打印(5,\rnnMultSysSL不超速枚举)。翻转MUX再尝试“”;
CYU3pCeltT态(CyFe,CyFalse);
CYU3PGPIOSET值(SSMUXXSELGGPIO22,CyTrue);
CYU3PUBSCONDSUB2支持(Cyress);
CYU3PTHeLead睡眠(20);
状态= CYU3pCONTCOSTATE(Cytru,CyTrue);
CYU3PTHeLead睡眠(50);
如果(状态)!= CYU-U3PY成功
{
CYU3pDebug打印(4)\nrAPAPIIT:CONTCONSTATE Err= 0x%x“,状态);
CYCX3UVCAPPRROR处理程序(状态);
}
}
其他的
{
CYU3pDebug打印(5, RN超速度枚举MuxSeSL低);
}
B)第二次改变:
将这两个案例添加到USB安装调用中,如下所示:
/*这是处理USB事件**的回调函数。
静态空隙
CYCX3UVCAPPUS BEN
Cyu3PueBeTyType:EVType,/*事件类型*/
UIT1616T EVDATA/*事件数据*/)
{
交换机(EvType)
{
CYU-U3PUSB事件
αIFIFF类型C~(32)启用
U3a事件=胞质;
u3-真= CyFrE;
CYU3pDebug打印(5,\nrSSyCOMPRICATION事件发生);
第二节
断裂;
CYU-U3PUSB事件ESPB3LNKFAIL:
αIFIFF类型C~(32)启用
U3a事件=胞质;
u3-真= CyFrE;
CYU3pDebug打印(5,\NRUB33LNKFAILL事件发生);
第二节
断裂;
通过上述两个代码更改,可以用C型连接器建立3个连接。
当做,
血竭
以上来自于百度翻译
以下为原文
Hi Ashlin,
With respect to your code:
Delay has to be given between the following two lines, for CyU3PU***GetSpeed() to return correct value:
status = CyU3PConnectState(CyTrue, CyTrue); AND
if(CyU3PU***GetSpeed() != CY_U3P_SUPER_SPEED)
The following is another way of working with Type C connector:
Below is the sequence of steps that needs to be followed in FX3/CX3 firmware for mux control:
1) Disable the USB2 support.
2) Try to establish USB3 connection using the first USB3 pair.
3) check for CY_U3P_USB_EVENT_SS_COMP_ENTRY and CY_U3P_USB_EVENT_USB3_LNKFAIL.
If any of the two event gets triggered, do the following:
a)disable the USB PHY by using CyU3PConnectState(CyFalse, CyFalse);
b)toggle the mux selection GPIO.
c)enable the USB 2.0 support
d)Call connectstate API to establish a USB 3.0 connection using the second pair.
Code changes if above steps are followed:
A) First change:
In your FX3/CX3 firmware comment out the CyU3PConnectState() API and
add the below snippet in place of that:
status = CyU3PU***ControlU***2Support(CyFalse);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint(4,"rnDisabling USB2 failed. Stopping Execution");
while(1);
}
CyU3PThreadSleep(20);
status = CyU3PConnectState(CyTrue, CyTrue);
CyU3PThreadSleep(50);
for(int i =0 ; (i<100 && !U3_EVENT); i++ )
CyU3PThreadSleep(5);
if(!U3_TRUE)
{
CyU3PDebugPrint(5,"rnNot Super speed enumeration with MUX_SEL low. Flipping Mux to try again");
CyU3PConnectState(CyFalse, CyFalse);
CyU3PGpioSetValue(SS_MUX_SEL_GPIO22,CyTrue);
CyU3PU***ControlU***2Support(CyTrue);
CyU3PThreadSleep(20);
status = CyU3PConnectState(CyTrue, CyTrue);
CyU3PThreadSleep(50);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "nrAppInit:ConnectState Err = 0x%x", status);
CyCx3UvcAppErrorHandler(status);
}
}
else
{
CyU3PDebugPrint(5,"rnSuper speed enumeration with MUX_SEL low");
}
B) Second change:
Add these two cases in the USB Setup call back as shown below :
/* This is the Callback function to handle the USB Events */
static void
CyCx3UvcAppUSBEventCB(
CyU3PU***EventType_t evtype, /* Event type */
uint16_t evdata /* Event data */)
{
switch (evtype)
{
case CY_U3P_USB_EVENT_SS_COMP_ENTRY:
#ifdef TYPE_C_ENABLED
U3_EVENT = CyTrue;
U3_TRUE = CyFalse;
CyU3PDebugPrint(5, "nrSS_COMP_ENTRY Event Occured");
#endif
break;
case CY_U3P_USB_EVENT_USB3_LNKFAIL:
#ifdef TYPE_C_ENABLED
U3_EVENT = CyTrue;
U3_TRUE = CyFalse;
CyU3PDebugPrint(5, "nrUSB3_LNKFAIL Event Occured");
#endif
break;
With the above two code changes, 3.0 connection can be established with a Type-C connector.
Regards,
Hemanth
嗨,Ashlin,
关于您的代码:
Delay必须在下面两行之间给出,对于CYU3PUBGETSCAST()返回正确的值:
状态= CYU3pCONTCOSTATE(CyrEt,CyTrue);
如果(CUU3PUBGETFAST())!= CyuU3PySuffi速度
以下是C型连接器工作的另一种方法:
下面是MXX控制中FX3/CX3固件需要遵循的一系列步骤:
1)禁用USB2支持。
2)尝试使用第一个UB3对建立UB3连接。
3)检查CYU-U3PUSB事件和CYU-U3PUSB事件ESPB3LNKFAILT。
如果触发两个事件中的任何一个,请执行以下操作:
a)通过使用CYU3pCONTCONSTATE(CYFALSE,CyFalse)禁用USB PHY;
b)切换MUX选择GPIO。
c)启用USB 2支持
d)调用连接状态API以使用第二对建立USB 3连接。
如果遵循以上步骤,则代码更改:
a)第一次改变:
在FX3/CX3固件中,注释掉CYU3PCONTCONSTATE()API,并添加下面的代码片段来代替:
状态= CYU3PUBSCONDSUB2支持(CyFLUE);
如果(状态)!= CYU-U3PY成功
{
CYU3pDebug打印(4, \RN禁用USB2失败)。停止执行“”;
(1);
}
CYU3PTHeLead睡眠(20);
状态= CYU3pCONTCOSTATE(Cytru,CyTrue);
CYU3PTHeLead睡眠(50);
对于(int i=0;(i & lt;100 &&!);u3x事件)
CYU3PTHeLead睡眠(5);
如果(!)u3-真)
{
CUU3pDebug打印(5,\rnnMultSysSL不超速枚举)。翻转MUX再尝试“”;
CYU3pCeltT态(CyFe,CyFalse);
CYU3PGPIOSET值(SSMUXXSELGGPIO22,CyTrue);
CYU3PUBSCONDSUB2支持(Cyress);
CYU3PTHeLead睡眠(20);
状态= CYU3pCONTCOSTATE(Cytru,CyTrue);
CYU3PTHeLead睡眠(50);
如果(状态)!= CYU-U3PY成功
{
CYU3pDebug打印(4)\nrAPAPIIT:CONTCONSTATE Err= 0x%x“,状态);
CYCX3UVCAPPRROR处理程序(状态);
}
}
其他的
{
CYU3pDebug打印(5, RN超速度枚举MuxSeSL低);
}
B)第二次改变:
将这两个案例添加到USB安装调用中,如下所示:
/*这是处理USB事件**的回调函数。
静态空隙
CYCX3UVCAPPUS BEN
Cyu3PueBeTyType:EVType,/*事件类型*/
UIT1616T EVDATA/*事件数据*/)
{
交换机(EvType)
{
CYU-U3PUSB事件
αIFIFF类型C~(32)启用
U3a事件=胞质;
u3-真= CyFrE;
CYU3pDebug打印(5,\nrSSyCOMPRICATION事件发生);
第二节
断裂;
CYU-U3PUSB事件ESPB3LNKFAIL:
αIFIFF类型C~(32)启用
U3a事件=胞质;
u3-真= CyFrE;
CYU3pDebug打印(5,\NRUB33LNKFAILL事件发生);
第二节
断裂;
通过上述两个代码更改,可以用C型连接器建立3个连接。
当做,
血竭
以上来自于百度翻译
以下为原文
Hi Ashlin,
With respect to your code:
Delay has to be given between the following two lines, for CyU3PU***GetSpeed() to return correct value:
status = CyU3PConnectState(CyTrue, CyTrue); AND
if(CyU3PU***GetSpeed() != CY_U3P_SUPER_SPEED)
The following is another way of working with Type C connector:
Below is the sequence of steps that needs to be followed in FX3/CX3 firmware for mux control:
1) Disable the USB2 support.
2) Try to establish USB3 connection using the first USB3 pair.
3) check for CY_U3P_USB_EVENT_SS_COMP_ENTRY and CY_U3P_USB_EVENT_USB3_LNKFAIL.
If any of the two event gets triggered, do the following:
a)disable the USB PHY by using CyU3PConnectState(CyFalse, CyFalse);
b)toggle the mux selection GPIO.
c)enable the USB 2.0 support
d)Call connectstate API to establish a USB 3.0 connection using the second pair.
Code changes if above steps are followed:
A) First change:
In your FX3/CX3 firmware comment out the CyU3PConnectState() API and
add the below snippet in place of that:
status = CyU3PU***ControlU***2Support(CyFalse);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint(4,"rnDisabling USB2 failed. Stopping Execution");
while(1);
}
CyU3PThreadSleep(20);
status = CyU3PConnectState(CyTrue, CyTrue);
CyU3PThreadSleep(50);
for(int i =0 ; (i<100 && !U3_EVENT); i++ )
CyU3PThreadSleep(5);
if(!U3_TRUE)
{
CyU3PDebugPrint(5,"rnNot Super speed enumeration with MUX_SEL low. Flipping Mux to try again");
CyU3PConnectState(CyFalse, CyFalse);
CyU3PGpioSetValue(SS_MUX_SEL_GPIO22,CyTrue);
CyU3PU***ControlU***2Support(CyTrue);
CyU3PThreadSleep(20);
status = CyU3PConnectState(CyTrue, CyTrue);
CyU3PThreadSleep(50);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "nrAppInit:ConnectState Err = 0x%x", status);
CyCx3UvcAppErrorHandler(status);
}
}
else
{
CyU3PDebugPrint(5,"rnSuper speed enumeration with MUX_SEL low");
}
B) Second change:
Add these two cases in the USB Setup call back as shown below :
/* This is the Callback function to handle the USB Events */
static void
CyCx3UvcAppUSBEventCB(
CyU3PU***EventType_t evtype, /* Event type */
uint16_t evdata /* Event data */)
{
switch (evtype)
{
case CY_U3P_USB_EVENT_SS_COMP_ENTRY:
#ifdef TYPE_C_ENABLED
U3_EVENT = CyTrue;
U3_TRUE = CyFalse;
CyU3PDebugPrint(5, "nrSS_COMP_ENTRY Event Occured");
#endif
break;
case CY_U3P_USB_EVENT_USB3_LNKFAIL:
#ifdef TYPE_C_ENABLED
U3_EVENT = CyTrue;
U3_TRUE = CyFalse;
CyU3PDebugPrint(5, "nrUSB3_LNKFAIL Event Occured");
#endif
break;
With the above two code changes, 3.0 connection can be established with a Type-C connector.
Regards,
Hemanth
举报