USB 2.0 Compliant Test In Hub Layer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB 2.0 Compliant Test In Hub Layer

Jump to solution
1,328 Views
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

Labels (3)
0 Kudos
1 Solution
1,063 Views
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

View solution in original post

0 Kudos
4 Replies
1,064 Views
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 Kudos
1,063 Views
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 Kudos
1,063 Views
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 Kudos
1,063 Views
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 Kudos