USB 2.0 Compliant Test In Hub Layer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

USB 2.0 Compliant Test In Hub Layer

跳至解决方案
1,463 次查看
bakbad
Contributor III

Hello NXP,

I want to  set some registers to do the usb 2.0 compliant test. After I set the USBCMD and PORTSC registers with host1 controller core(The host1 core has connect to a High Speed HUB  with 4 downstream facing port), there had no correct signal on oscilloscope.

USBCMD = 0x00080B00

PORTSC = 0x1C041000(Test_Packet mode)

Had you ever configed registers to done the usb 2.0 compliant test?  Could you please help me. Thanks a lot.

Best Regards

bo xu

标签 (3)
0 项奖励
1 解答
1,198 次查看
bakbad
Contributor III

Hello eveyone,

I have solved this problem with a simple program usb_settestmode.c  Also one can change this program to set the host to get into Test Mode with changing the Tier 2 Hub Address to Root Hub Address(host), but i do not confirmed that. If someone tried please tell me the results. Thanks anyway!

/*

* Filename: usb_settestmode.c
* USB 2.0一致性测试
* 设置Hub port进入Test Mode
*/

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/usbdevice_fs.h>
#include <asm/byteorder.h>
#include <sys/ioctl.h>

int main(void)
{
int fd, ret;


/* the request is come from the USB 2.0 Specification */

struct usbdevfs_ctrltransfer test_req = {
.bRequestType = 0x23,
.bRequest = 3, // SET_FEATURE
.wValue = 21, // PORT_TEST
.wIndex = 0x0401, // Test_Packet And Port 1
.wLength = 0,
.timeout = 1000,
};

fd = open("/dev/bus/usb/001/002", O_RDWR); // Tier2 Hub Address(Or you change this to Root Hub's Address)
if (fd < 0) {
perror("open");
return -1;
}


ret = ioctl(fd, USBDEVFS_CONTROL, &test_req);
if (ret < 0) {
perror("ioctl");
return -1;
}

}

Best Regards

bo xu

在原帖中查看解决方案

0 项奖励
4 回复数
1,199 次查看
bakbad
Contributor III

Hello eveyone,

I have solved this problem with a simple program usb_settestmode.c  Also one can change this program to set the host to get into Test Mode with changing the Tier 2 Hub Address to Root Hub Address(host), but i do not confirmed that. If someone tried please tell me the results. Thanks anyway!

/*

* Filename: usb_settestmode.c
* USB 2.0一致性测试
* 设置Hub port进入Test Mode
*/

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/usbdevice_fs.h>
#include <asm/byteorder.h>
#include <sys/ioctl.h>

int main(void)
{
int fd, ret;


/* the request is come from the USB 2.0 Specification */

struct usbdevfs_ctrltransfer test_req = {
.bRequestType = 0x23,
.bRequest = 3, // SET_FEATURE
.wValue = 21, // PORT_TEST
.wIndex = 0x0401, // Test_Packet And Port 1
.wLength = 0,
.timeout = 1000,
};

fd = open("/dev/bus/usb/001/002", O_RDWR); // Tier2 Hub Address(Or you change this to Root Hub's Address)
if (fd < 0) {
perror("open");
return -1;
}


ret = ioctl(fd, USBDEVFS_CONTROL, &test_req);
if (ret < 0) {
perror("ioctl");
return -1;
}

}

Best Regards

bo xu

0 项奖励
1,198 次查看
Yuri
NXP Employee
NXP Employee

Hello,

  Please refer to the following:

“I.MX6 series USB Certification Guides”

 

https://community.nxp.com/docs/DOC-105609


Have a great day,
Yuri

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
1,198 次查看
bakbad
Contributor III

Hi Yuri,

Sorry, my apologize! The actual test layer is hub, because the host1 controller core in my test board has connect to a High Speeed Hub with 4 DownStream facing port. But the signal provided by host does not transmit to hub's port. What should i do next? Thanks a lot.

Best Regards,

bo xu

0 项奖励
1,198 次查看
bakbad
Contributor III

Hello Yuri,

  Thanks for your reply.

Now i can change the OTG CORE's PORTSC1(0x02184184) PTC(bit 19-16) to 4(Test_Packet mode), but can't change the Host1 CORE's PORTSC1(0x02184384) PTC field(always be 0x0).

I use the devmem tool to change these value, But when applied to H1 Core, it didn't work.(The test board had just use OTG Core and H1 Core).

Best Regards,

bo xu

0 项奖励