Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Problem with report ID's

lock attach
Attachments are accessible only for community members.

Problem with report ID's

Anonymous
Not applicable
Question: How to enable multiple report IDs?

 

Answer:

The Wizard doesn't directly support report IDs other than '0'. You will need to redefine transfer descriptors for OUT reports with IDs '0' and '1' (if you are using report ID of '1') - Your tables should include all report IDs from '0' to which ever report ID you need. To do this: - You can void out the descriptors and RAM allocation generated by the USB Set Up Wizard, by 'uncommenting' the WIZARD_DEFINED_REPORT_STORAGE: EQU 0 line in the usb_descr.asm file You need to redefine the RAM you need and basically the reports transfer descriptors towards the end of the file in the allowed area to prevent loses while regenerating your project. You can reuse the RAM locations generated by the Wizard - USB_INTERFACE_0_OUT_RPT_DATA - 8 bytes USB_INTERFACE_0_FEATURE_RPT_DATA - 8 bytes USB_INTERFACE_0_IN_RPT_DATA - 8 bytes If you are using 2 interfaces, the Wizard generates RAM locations for the 2nd interface as well. What you need to do:-

1.) I've included the file - Please make sure you copy the section towards the end between the lines

;@PSoC_UserCode_BODY_1@ (Do not change this line.)

;---------------------------------------------------

; Insert your custom code below this banner

;---------------------------------------------------

;---------------------------------------------------

; Insert your custom code above this banner

;---------------------------------------------------

;@PSoC_UserCode_END@ (Do not change this line.)

Into your usb_descr.asm file. In this section you can also make changes for the other reports (Feature reports on every interface also) if needed.

2.) You also need to uncomment the line"WIZARD_DEFINED_REPORT_STORAGE: EQU 0" as shown below in your usb_descr.asm file

;---------------------------------------------------

;@PSoC_UserCode_BODY_1@ (Do not change this line.)

;---------------------------------------------------

; Insert your custom code below this banner

;---------------------------------------------------

; Redefine the WIZARD equate to 0 below by

; uncommenting the WIZARD: equ 0 line

; to allow your custom descriptor to take effect

;---------------------------------------------------

; WIZARD: equ 0

WIZARD_DEFINED_REPORT_STORAGE: EQU 0

;---------------------------------------------------

; Insert your custom code above this banner

;---------------------------------------------------

;@PSoC_UserCode_END@ (Do not change this line.)

So, in your user application, if you poll the appropriate RAM location, you should get your OUT report data. The attached example/file shows how to set an OUT report with report ID of "1". For Feature and IN reports with report IDs other than "0", the same procedure can be followed.

Attachments
0 Likes
222 Views
Contributors