Hi Christie Su
About your questions:
1) Based on the document and demo project, USB1 can work for HS, FS. The demo HID sets USB1 to FS. Could you confirm it?
No, If you select KHCI drivers, demo will load the FS drivers with USB0, and if you select the EHCI demo will load the HS drivers with USB1. I mentioned that in case that the host doesn't support HS, device could work with FS, but this is a host characteristic.
2) In demo project, I can see USB1 is configured for self-powered. So, I need to provide 5VDC on VBUS? The VBUS from USB connector(PC) should not be used?
This "self-powered" specification is for the host driver, it is used in case that it need to know current consumption, it doesn't relate with hardware design. If you are using HS, USBHSDCD instantiation of this module for a High-Speed capable port has the additional requirement that the voltage on the USB1_VBUS pin be > 4.5V.
3) When I use USB1 HID for FS, with on control endpoint, one IN endpoint, one OUT endpoint, can I send/receive 64 bytes on IN and OUT endpoints? What is the maximum data length allowed, 128 bytes? The interval to exchange data on IN and OUT endpoints should be >= 0.5s?
The packet length of control transfers in full speed devices allow a packet size of 8, 16, 32 or 64 bytes. For Interrupt transfers, FS allows a max package size of 64 bytes (the example defined it with a max package size of 8 bytes).
The speed specification that I mentioned in my previous comment is about the interrupt transfer. FS in interrupt transfer Maximum data payload size for full-speed devices is 64 bytes every interval. An Interrupt request is queued by the device until the host polls the USB device asking for data (in the example Host polls for data every 1 ms ).
4) I can see maximum data used in Kinetis Boot-loader is 32 bytes. Is it any reason?
No, it is just a KBOOT characteristic.
5) If I want to change the maximum length to 64 or 128 bytes in sample project, where do I need to change because when I change the above definition from 8 to 64, it causes problem?
As I mentioned, The host will periodically poll the interrupt endpoint. This rate of polling is specified in the endpoint descriptor, that is the definition in
#define HS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)
#define FS_HID_GENERIC_INTERRUPT_IN_PACKET_SIZE (8U)
#define HS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x04U)
#define FS_HID_GENERIC_INTERRUPT_IN_INTERVAL (0x01U)
But FS host controllers schedule transactions in periods of 1, 2, 4, 8, 16, or 32 ms. For FS devices that request a latency of 9 to 15 ms, host will attempt a transaction every 8 ms and a device that request a latency of 32 to 255 will cause a transaction attempt every 32 ms.
This are USB caracteristics, so I recommend you to check the following link:
USB in a NutShell - Chapter 4 - Endpoint Types
Maybe It could give you a overview of USB specifications.
Hope this could helps
Regards
Jorge Alcala