1963 views|3 replies

1131

Posts

17

Resources
The OP
 

【MM32 eMiniBoard Review】USB Test [Copy link]

 

I listed the instructions for setting up the environment in the previous section

The main purpose of applying for this development board is to play with USB, so I will test the USB function first.

Download the official sample program first and take a look

The path in the official sample package is as follows: MM32F013x_Samples\LibSamples\USB\USB_HID_Suspend

The package has a download link in the previous section.

First, some things to modify:

Modify some USB descriptors in the usb_desc.c file in the example package.

Such as CustomHID_StringProduct

I changed it to

const u8 CustomHID_StringProduct[CUSTOMHID_SIZ_STRING_PRODUCT] = {
    CUSTOMHID_SIZ_STRING_PRODUCT,          // bLength
    USB_STRING_DESCRIPTOR_TYPE,        // bDescriptorType
    'e', 0,
    'e', 0,
    'w', 0,
    'o', 0,
    'r', 0,
    'l', 0,
    'd', 0,
    '.', 0,
    'm', 0,
    'm', 0,
    '3', 0,
    '2', 0,
    'H', 0,
    'I', 0,
    'D', 0
};

The main code is as follows:

    GPIO_Configuration();
    USB_NVIC_Config();
    USB_ClockConfig();
    USB_Init();



    while(1) {
		
        if(bDeviceState == CONFIGURED) {
				
				
				if(!(_GetUSB_CTRL1()&EP1_CTRL_TRANEN)) {
					UserToPMABufferCopy(gTableData, ENDP1,BUFF_SIZE);	//BUFF_SIZE
					_SetUSB_CTRL1(EP1_CTRL_TRANEN | BUFF_SIZE) ; //Loop IN transmission

					for(int i=0;i<0x5fffff;i++){
						__nop();
					}//延时约1秒,默认无延时,
					
				}				
			
        }
    }

Compile and download to the chip.

Test with a HID test tool on the PC

See picture:

This item [eeworld.mm32HID] already exists in the HID device list

Select this option and turn on the device. You will find that you will receive 64-byte HID data packets every second.

This chapter is now completed and the intended goal has been achieved.

The next section tests HID sending and receiving data

This post is from Domestic Chip Exchange

Latest reply

What is a certain HID test tool?   Details Published on 2020-10-30 21:41
 
 

1942

Posts

2

Resources
2
 

What is the maximum transfer rate that USB can achieve?

This post is from Domestic Chip Exchange

Comments

The host computer uses other people's ready-made tools. You will know it when you write one yourself. The library functions used have poor performance and need more optimization. It is estimated that it can reach 500-800KB/S  Details Published on 2020-10-30 16:56
 
 
 

1131

Posts

17

Resources
3
 
w494143467 Published on 2020-10-30 15:14 What is the maximum transfer rate of USB?

The host computer uses other people's ready-made tools. You will know it when you write one yourself.

The library function used has poor performance and needs more optimization. It is estimated that it can reach 500-800KB/S

This post is from Domestic Chip Exchange
 
 
 

7462

Posts

2

Resources
4
 

What is a certain HID test tool?

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list