NXPUSBLIB source code for CALLBACK_USB_GetDescriptor call

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NXPUSBLIB source code for CALLBACK_USB_GetDescriptor call

1,264 Views
ssudhir
Contributor II

Hi,

As we mentioned earlier, we are using LPC4357 and planning to use one USB controller as mass storage host and another one as HID device. We downloaded the code from NXPUSBLIB and  done bear minimum testing for the HOST. Now complied the code as both Device and Host macro on. In the device mode, there is a function  called - CALLBACK_USB_GetDescriptor which is used in USB_Device_SetConfiguration and USB_Device_GetDescriptor (in DeviceStandardReq.c file) However there is no source code for the function call -- CALLBACK_USB_GetDescriptor. Eventually we would like to use USB ROM device driver, however, wanted to conduct initial testing . You did mention that you are not supporting this library anymore. However, if you have a source code (or link to source code) for - CALLBACK_USB_GetDescriptor function please let us know.

Thanks

Tags (1)
0 Kudos
13 Replies

1,016 Views
ssudhir
Contributor II

We are getting a link error. What are we missing?

0 Kudos

1,016 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi SS,

You ask new question about link error.

Please create a new thread for it.

Let's keep one thread for one discussion topic. Thanks for your understanding.

Have a nice day,

Jun Zhang

0 Kudos

1,016 Views
ssudhir
Contributor II

Jun Zhang,

We found the  sample code to test HID device by using LPCopen in the following link.

https://community.nxp.com/thread/424538

 

In the hid_main.c there is the following structure and external variables.

extern const  USBD_HW_API_T hw_api;
extern const  USBD_CORE_API_T core_api;
extern const  USBD_HID_API_T hid_api;
/* Since this example only uses HID class link functions for that class only */
static const  USBD_API_T g_usbApi = {
&hw_api,
&core_api,
0,
0,
&hid_api,
0,
0,
0x02221101,
};

We couldn’t find the declaration for these external variables. Any idea where can we find them?

Thanks

0 Kudos

1,016 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi SS,

Variable for example hw_api is defined as external const. This is because it refers to USB ROM API function. The const variables are already in ROM when out of factory. User doesn't need define it as const again, just declare it as external and use it.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,016 Views
ssudhir
Contributor II

Jun Zhang,

Thanks for the response.

It is a customized board based on LPC4357.  We use IAR I-Jet for debugging.

In our custom board, USB0 is used as a device and USB1 as host. We used USB connector to connect the custom board to Windows 10 host to test HID communication and the windows doesn’t recognize that USB connection (to USB0 on the board).

When you connect any of your demo boards based on LPC4357 to Windows 10 host using USB0 , you might load a USB driver to Windows machine that helps windows to recognize the board.

 

Do you have any sample code that runs on windows machine and act as HID HOST to test the communication between the Windows HOST and our board?

Thanks

0 Kudos

1,016 Views
ssudhir
Contributor II

When we connect our board based on LPC4357 to a windows machine using USB cable, the Windows host is not able to recognize that device and displays the following message.

USB Device Not Recognized

One of the USB devices attached to this computer has malfunctioned, and windows doesn’t recognize it.

I am guessing the Windows has no driver for this device. Where can we find windows driver for this?

Thanks

0 Kudos

1,016 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi SS,

We recommend you use LPCOpen. we use LPCOpen USB demo code for USB application test.

Regarding to your LPC4357 connection issue, do you use demo board ? if yes, which one?

if you use customized board, which debug probe do you use?

How can we reproduce your problem?

Have a nice day,

Jun Zhang

0 Kudos

1,016 Views
ssudhir
Contributor II

Do you have any sample code that runs on windows machine and act as HID HOST to test the communication between Windows HOST and our board ?

Thanks

0 Kudos

1,016 Views
ssudhir
Contributor II

Jun Zhang

We are evaluating whether to use ROM USB STACK for generic HID device or LPC open stack. We know that if we use ROM, debugging is hard. We are looking for speed to market Do have suggestions regarding which one is better (ROM or LPC open?  Which is better tested from your end and documented? We found some HID generic example that uses ROM USB stack but not able to find any example code for LPC open.

Thanks

0 Kudos

1,016 Views
ssudhir
Contributor II

Is there an example code for generic hid device ? We found example code that uses ROM USB stack. But we are trying to link USB device components and we have the driver components but looking for an application example code for generic HID.  

Thanks

0 Kudos

1,016 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi SS

Besides LPCOpen USB demo code, I wonder we don't have other genetic HID demo code.

MCUXpresso SDK includes genetic HID demo but it doesn't support LPC4357 .

Have a nice day,

Jun Zhang

0 Kudos

1,016 Views
ssudhir
Contributor II

Thanks

0 Kudos

1,016 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi SS,

I found source code of CALLBACK_USB_GetDescriptor() in Descriptors.c file in this package v1.02 source package

from this link:

LPCOpen Software for LPC18XX | NXP 

Please try it.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos