- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have been working on the USB HID Generic code sample available for the psoc 6 on modus toolbox 3 . I am not interested in using the debug uart function setup by the retargeting io function however if this is disabled the HID enumeration also doesn't work. If I re-enable it the HID gets enumerated.
The Question is why would I need to Enable the following piece of code to enable the HID enumeration, I am not using any printf function here . All printf messages in the code have been masked out .
If I Mask out the segment as I did below it does not work , why?
// /* Initialize retarget-io to use the debug UART port */
// result = cy_retarget_io_init(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX, CY_RETARGET_IO_BAUDRATE);
// /* retarget-io init failed. Stop program execution */
// if (result != CY_RSLT_SUCCESS)
// {
// CY_ASSERT(0);
// }
example followed is the following
https://github.com/Infineon/mtb-example-usb-device-hid-generic
Any input on this will be great .
Regards
C
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@RodolfoGL Thanks for the feedback , there is two areas actually that had to be disabled
void USB_X_Log(const char * s) {
void USB_X_Warn(const char * s) {
I disabled every putc () function call , it seemed to solve the problem . Thansk
Ragards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's probably because you are calling printf() without initializing the retarget-io(). Try to comment out the printf() calls.
The retarget-io library basically implements some underneath functions to redirect the STDIO to the UART. Without implementing these underneath functions, you would get a hard fault on printf() calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi RodolfGL
Hope you are well.
Thanks for the feedback , I agree with you if I was using the printf . You may have misunderstood my previous point. But in this case i am not using the printf therefore that function should not be required to enable the HID interface on the USB . But yet Without it is the HID does not get setup .
I am trying to find out why the Retargeting function is required to setup HID interface , none of the USB documentation mentions that this is required.
Regards
C
Regards
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, actually the emUSB itself is using printf() or some other STDIO function.
Let me check internally what's the correct procedure to disable this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked internally.
We are going to add an option to disable the STDIO calls in the USBD in the next release of the emUSB-device library, which will happen in middle of March.
In the meanwhile, you could comment out the printf() call located at emusb-device/export/Config/usbd_config_io.c.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rodolfo,
I first thought this will be the resolution but the problem is worse , even if I mask out the above mentioned printf the HID stops again . if i put it back the HID is enumerated .
Now the even worse part is that the pins CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX used in the default debug uart cannot be changed to a free and available uart . Once i do this everything stops again . Changing this in the cycfg_pins.h file does not work nor does it when changed in the device configurator. I have forced the re-define of the debug IO to the free uart pins but still does not work and the HID does not get enumerated . It insists on being use on P5_0 and P5_1 , and this is a problem as these pins are designated to other purposes on the board .
Any ideas on this ?
regards
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ops... there are two more lines to be commented out on udbd_config_io.c:
void USB_X_Log(const char * s) {
USB_OS_IncDI();
_ShowStamp();
//_puts(s);
//_puts("\r\n");
USB_OS_DecRI();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@RodolfoGL Thanks for the feedback , there is two areas actually that had to be disabled
void USB_X_Log(const char * s) {
void USB_X_Warn(const char * s) {
I disabled every putc () function call , it seemed to solve the problem . Thansk
Ragards