Using WebUSB API

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

Using WebUSB API

2,166 Views
evgenik
Contributor IV

Hello.

I am using Kinetis K21 development board. In the current project, I need to implement WebUSB communication. The documentation on the use of the WebUSB explains the web side, but little affected the part of the embedded device. Are there any code examples for using WebUSB API?

Thanks.

Evgeni

Labels (1)
0 Kudos
8 Replies

1,766 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Thanks a lot for your patience, I have got some reply from our internal side.
Unfortunately, we really don't have the Kinties webusb code or app note.
Our expert give you the following reply:
I did find one reference in Zephyr OS if you want to explore further.
https://docs.zephyrproject.org/latest/samples/subsys/usb/webusb/README.html

Wish it helps you!
Thanks a lot for your understanding.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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,766 Views
evgenik
Contributor IV

I want to use CDC and WebUSB in one USB device? What type of USB driver shall be used for using more than one USB descriptor, composite or can I use CDC only?

0 Kudos

1,766 Views
kerryzhou
NXP TechSupport
NXP TechSupport

As I know, you need to use composite, it can use different USB type together.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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,766 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  Evgeni Kosakovski ,

Thank you for your interest in the NXP kinetis product, I would like to provide service for you.
All the K21 USB code can be found in the SDK.
I don't know which detail K21 partnumber you are using, you can download the Kinetis USB SDK code from this link:
http://mcuxpresso.nxp.com/en/
Just take TWR-K21F120M board as an example, you can find the usb code in the related SDK folder:
SDK_2.3.1_TWR-K21F120M\boards\twrk21f120m\usb_examples
We have the cdc, HDC, MSC, PHDC, Video USB protcol code.
But I didn't find your webUSB directly.
It should not the USB low level driver, but the MCU normally provide the low level driver.
So, you need to check which detail USB protocal you are using, CDC, HID or others, then use the related MCU USB code.

Wish it helps you!
If you still have questions about it, please kindly let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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,766 Views
evgenik
Contributor IV

WebUSB API is allow to access USB Devices on the Web. Full description you can read at this link: https://developers.google.com/web/fundamentals/native-hardware/build-for-webusb. As you can see that this is USB protocol, that have USB descriptors. I know what is CDC, HID, MSD, but with this descriptor (WebUSB) I can't find any code sample. I think that NXP can prepare code for example.

I have found the next link: MCUxpresso debugger failing to connect to RT 1062 (MIMXRT1060-EVK) - Probe Index 1 , where is wrote that this code is using WebUSB API, but into project no any information, no USB code. Can you give me amy code example how using this protocol into embedded? Thanks

0 Kudos

1,766 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Evgeni Kosakovski ,

Thanks for your updated information.
The RT EVK board display the webUSB, it is the on board LPC4330 debugger firmware, and that firmware is not the open source code.
We just have the firmware, no source code:
https://www.nxp.com/design/microcontrollers-developer-resources/ides-for-kinetis-mcus/opensda-serial...
About the kinetis series, I really didn't find the webUSB driver code.
Anyway, I will double check it with our internal related team.
If I get the useful information, I will let you know, please keep patient, thanks.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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,766 Views
evgenik
Contributor IV

Ok, I will wait. In case of no any code example, may be you or technical stuff can check example from arduino demo https://github.com/webusb/arduinohttps://github.com/webusb/arduino and describe how to use with USB descriptors into Kinetis USB examples (I am usin usb/dev_cdc_vcom_bm example)?

Thanks

0 Kudos

1,766 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Evgeni Kosakovski

Thanks for your feedback.
I still didn't get the reply from internal side, so, please keep patient.
About the ardunio demo which you mention, you also can try to port it by yourself.
I will transfer your suggest to your related department, but whether the SDK plan to accept it or not, it is not determined.
Any upated information about this case from my side, I will let you know.

This community question is totally the same as your case, so you don't need to update this community, after I get the useful reply from our internal side, I will post it in this post, and reply you in your case.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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