Page 2 of 2

Re: ESP32-S2 USB CDC problem in recognition

Posted: Tue Oct 19, 2021 7:06 am
by chegewara
Ok, can you post full example on github? I will check it out.

Re: ESP32-S2 USB CDC problem in recognition

Posted: Tue Oct 19, 2021 8:24 am
by filo_gr
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.

Re: ESP32-S2 USB CDC problem in recognition

Posted: Tue Oct 19, 2021 8:51 am
by chegewara
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


Re: ESP32-S2 USB CDC problem in recognition

Posted: Tue Oct 19, 2021 8:54 am
by chegewara
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:

Re: ESP32-S2 USB CDC problem in recognition

Posted: Tue Oct 19, 2021 3:33 pm
by filo_gr
@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 5530 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.

Re: ESP32-S2 USB CDC problem in recognition

Posted: Tue Oct 19, 2021 5:00 pm
by chegewara
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.

Re: ESP32-S2 USB CDC problem in recognition

Posted: Wed Oct 20, 2021 12:34 pm
by filo_gr
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.