Hi
Our system has a USB device port and SD card slot, the SD card is optional, so there are 2 cases:
1. Connect the USB to PC, it needs to be a HID device. 2. Insert SD card, then connect USB to PC, it needs to be a HID+MSC composite device.
I am using RL_USB, this means I need 2 usb configuration: one for single HID device, the other for composite HID+MSC device, firmware needs to detect if sd card is inserted to decide which configuration to enable. However, it seems I can only config the usb class in compile time, and not able to change it in runtime??
Am I right? What's the general solution for this requirement? I am using RL_USB library.
Thanks.
Yes, I want this solution: use 2 configurations, and use soft-reset to select different configuration, but problem is: does RL_USB library support this? I can't see any usbd_xxx functions to change configuration in runtime, seems I can only make one configuration in the USB_Config.c source file, then compile to one single static configuration!
I guess I must change RL_USB source code instead of using the RL_USB.Lib of CM3? But the source code is not provided in MDK4.20, I must copy these source code from early version of RL_ARM? Don't know if there is license problem.
> does RL_USB library support this?
No. You have to rewrite the library source code.
On the config switch scheme, HID connection is disturbed, every time SD card is inserted/removed. I don't think it's a decent implementation.
Tsuneo