[SOLVED] ESP32-S2 USB CDC-ACM problem in recognition

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32-S2 USB CDC problem in recognition

Postby chegewara » Tue Oct 19, 2021 7:06 am

Ok, can you post full example on github? I will check it out.

filo_gr
Posts: 110
Joined: Wed Jul 28, 2021 12:25 pm
Location: Italy

Re: ESP32-S2 USB CDC problem in recognition

Postby filo_gr » Tue Oct 19, 2021 8:24 am

chegewara wrote: Ok, can you post full example on github? I will check it out.
I uploaded the file in a repository on GitHub. I underline that I deleted some parts of code because are used for others purposes.
You can find the code here: https://github.com/filgra96/USB_project {21/10/2021 -- deleted because not useful}
Inside USB_serial_comm.c I initialize the USB interface.
Last edited by filo_gr on Thu Oct 21, 2021 8:36 am, edited 1 time in total.
Filippo

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32-S2 USB CDC problem in recognition

Postby chegewara » Tue Oct 19, 2021 8:51 am

This example is not going to work, because you are still using espressif additions inside tinyusb component. Changes in your code just are not used in any place.
With method (1) when you override tinyusb component you can do it fairly easy:

Code: Select all

Config Number: 1
	Number of Interfaces: 2
	Attributes: a0
	MaxPower Needed: 100mA

	Interface Number: 0
		Name: cdc_acm
		Alternate Number: 0
		Class: 02(comm.) 
		Sub Class: 02
		Protocol: 01
		Number of Endpoints: 1

			Endpoint Address: 81
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 8
			Interval: 16ms


chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32-S2 USB CDC problem in recognition

Postby chegewara » Tue Oct 19, 2021 8:54 am

In your project create components folder and uncompress this tinyusb component. It is with required changes and you will be able to use espressif cdc acm example you started with:
Attachments
tinyusb.zip
(2.2 MiB) Downloaded 463 times

filo_gr
Posts: 110
Joined: Wed Jul 28, 2021 12:25 pm
Location: Italy

Re: ESP32-S2 USB CDC problem in recognition

Postby filo_gr » Tue Oct 19, 2021 3:33 pm

@chegewara I want to thank you for helping me and for your patience.
There was something missing in my knowledge for completely understand how to do. I read the guide here https://docs.espressif.com/projects/esp ... ystem.html and I understood how ESP-IDF treats the custom components.
I put the files obtaining in the following tree:
untitled.png
Directory tree for custom components.
untitled.png (29.6 KiB) Viewed 4738 times
After that I built and flashed and now it has the correct desciptor's USB parameter! :D
Thank you again, you were really helpful.
Filippo

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32-S2 USB CDC problem in recognition

Postby chegewara » Tue Oct 19, 2021 5:00 pm

Glad it is working for you now. I only have feeling it was the easy part, because now you have to communicate with host device following V.250 specification and having hope that host do the same.

filo_gr
Posts: 110
Joined: Wed Jul 28, 2021 12:25 pm
Location: Italy

Re: ESP32-S2 USB CDC problem in recognition

Postby filo_gr » Wed Oct 20, 2021 12:34 pm

chegewara wrote:
Tue Oct 19, 2021 5:00 pm
Glad it is working for you now. I only have feeling it was the easy part, because now you have to communicate with host device following V.250 specification and having hope that host do the same.
The PIC32's firmware uses Microchip's libraries and it has been tested with a MCP2200 device (it uses protocol V.250).
At the moment I''m testing the reception and transmission of a character through USB between ESP32-S2 and the PIC. It seems to work well.
Filippo

Who is online

Users browsing this forum: No registered users and 48 guests