I added customized HID device into UAC2.0 FW successfully like 2 years ago, It can send/receive 64 byte HID report data to/from XU208 device, all functions work well in UAC2.0, and I quitted XMOS works until now.
Now I come back to XMOS works and I'm trying to add same HID function to UAC1.0 because XMOS 2.0 driver cannot support 24bit format at lower frequencies (<44.1kHz, please correct me if I'm wrong), but I
got a strange error during USB enumeration process:
xrun: Program received signal ET_LOAD_STORE, Memory access exception.
[Switching to tile[0] core[2] (dual issue)]
handle_audio_request (c_mix_out=<value optimized out>) at E:/XMOS_Workspace/module_usb_audio/usb_buffer/decouple.xc:435
435 write_via_xc_ptr(g_aud_to_host_wrptr, datasize);
This was based on UAC2.0 FW, and I just add HID descriptor into UAC1.0 descriptors (BTW, UAC1.0 can work correctly), what I did:
1. Change the NUM_INTERFACES_A1 and CFG_TOTAL_LENGTH_A1 definitions.
Code: Select all
#ifdef HID_CONTROLS
#define INTERFACES_HID (1)
#else
#define INTERFACES_HID (0)
#endif
#define NUM_INTERFACES_A1 (1+INPUT_INTERFACES_A1 + OUTPUT_INTERFACES_A1 + INTERFACES_HID)
#if (NUM_USB_CHAN_IN == 0) || defined(UAC_FORCE_FEEDBACK_EP)
#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * 61) + (OUTPUT_INTERFACES_A1 * 70) + (INTERFACES_HID*32) )
#else
#define CFG_TOTAL_LENGTH_A1 (18 + AC_TOTAL_LENGTH + (INPUT_INTERFACES_A1 * 61) + (OUTPUT_INTERFACES_A1 * 61) + (INTERFACES_HID*32) )
#endif
Code: Select all
#ifdef HID_CONTROLS
// HID interface descriptor
9, /* 0 bLength : Size of descriptor in Bytes */
4, /* 1 bDescriptorType (Interface: 0x04)*/
3, /* 2 bInterfaceNumber : Number of interface */
0, /* 3 bAlternateSetting : Value used alternate interfaces using SetInterface Request */
2, /* 4: bNumEndpoints : Number of endpoitns for this interface (excluding 0) */
3, /* 5: bInterfaceClass */
0, /* 6: bInterfaceSubClass - no boot device */
0, /* 7: bInterfaceProtocol*/
0, /* 8 iInterface */
// HID descriptor
9, /* 0 bLength : Size of descriptor in Bytes */
0x21, /* 1 bDescriptorType (HID) */
0x10, /* 2 bcdHID */
0x01, /* 3 bcdHID */
0, /* 4 bCountryCode */
1, /* 5 bNumDescriptors */
0x22, /* 6 bDescriptorType[0] (Report) */
sizeof(hidReportDescriptor) & 0xff,/* 7 wDescriptorLength[0] */
sizeof(hidReportDescriptor) >> 8, /* 8 wDescriptorLength[0] */
/* Endpoint descriptor (IN) */
0x7, /* 0 bLength */
5, /* 1 bDescriptorType */
ENDPOINT_ADDRESS_IN_HID, /* 2 bEndpointAddress */
3, /* 3 bmAttributes (INTERRUPT) */
64, /* 4 wMaxPacketSize */
0,
16, /* 6 bInterval */
/* Endpoint descriptor (OUT) */
0x7, /* 0 bLength */
5, /* 1 bDescriptorType */
ENDPOINT_ADDRESS_OUT_HID, /* 2 bEndpointAddress */
// 0x03,
3, /* 3 bmAttributes (INTERRUPT) */
64, /* 4 wMaxPacketSize */
0,
16, /* 6 bInterval */
#endif
My project is based on "sw_usb_audio-[sw]_6.15.2rc1.zip".
Any advice will be appreciated.