Composite device MSD (SD card) + HID: MSD works, HID device "cannot start" code 10

Author
crashpilot
New Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2009/12/31 04:28:35
  • Location: 0
  • Status: offline
2013/05/21 11:08:24 (permalink)
0

Composite device MSD (SD card) + HID: MSD works, HID device "cannot start" code 10

Hello,
I am working on a project with PIC18LF26J50 and want to implement a composite device with the following features:
- USB datalogger with SD card mass memory device
- HID device for control purposes (e.g. to setup the datalogger, set RTC time etc.)

So far the datalogger and SD card mass memory device work fine, but I can't get the HID device working.
The mass memory appears on the PC and is fully accessible, the HID device appears in the PC device manager with a question mark and error code 10 ("This device cannot start") and is not accessible through the PC demo application.
I have checked my code several times and couldn't find anything wrong. I have also read a lot of entries in this forum that describe similar problems but didn't find anything that helped me to find out why it doesn't work.
 
Here is how I have proceeded:

1. I have started with the project "Device - Mass Storage - SD Card data logger" from the USB Microchip application library. I have adapted the code to my hardware and got this project running ok on my hardware.

2. After that, I have continued with the project "Device - Composite - HID + MSD" from the same library and again adapted the code to my hardware. This was also successful, the PC demo application recognizes the hardware and I can read and write data through the HID endpoint. I can also access the file system through the Windows explorer.
This project is already quite close to what I want to do, the major difference is that it uses the internal flash of the processor instead of the SD card.

3. Now I have tried to merge both projects, starting with the data logger project:
- Added usb_function_hid.c and usb_function_hid.h
- Edited usb_config.h: 2 Endpoints, added USE_HID and endpoint allocation definitions for HID
- Used usb_descriptors.c from the Composite HID + MSD project (as the data length of configDescriptor1 was different).
- All in all the descriptors in the merged project should now be the same as in the Composite project.
 
The merged project compiles without errors and does not cause USB error messages on the PC, but only the MSD function works.
The enumeration seems to work and the device state ends properly up in CONFIGURED_STATE.

As both the merged project and the Composite device project can be loaded on the same hardware, I can directly compare how they appear in the device manager on the PC. Except the "Code 10 - This device cannot start" error and the fact that the PC demo application does not recognize it, there seems to be no difference between the merged project and the composite HID + MSD project.

I am quite sure that I am overlooking something, but after having checked everything several times I have no more idea what to look after.
So I hope that someone can give me a hint what the reason might be or how to proceed.
 
I greatly appreciate any help. Thanks.
post edited by crashpilot - 2013/05/23 09:47:56
#1

1 Reply Related Threads

    crashpilot
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2009/12/31 04:28:35
    • Location: 0
    • Status: offline
    Composite device MSD (SD card) + HID: MSD works, HID device "cannot start" code 10 - re 2013/05/25 07:23:41 (permalink)
    +2 (1)
    Meanwhile I have found that I had actually been overlooking something:
    I had missed to adapt the following functions in main.c so that they handle the HID device, too. pink
     
    • void USBCBCheckOtherReq(void)
    • void USBCBInitEP(void)
    I have now replaced them by the original functions from the original demo "Device - Composite - HID + MSD" (from the application library) and everything works fine now.
    May be this information will help other people who have the same problem.
     
    post edited by crashpilot - 2013/05/26 01:42:15
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5