Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32s3 IDF-2048 multicore usb_osglue review (IDFGH-7291) #8879

Closed
chmorgan opened this issue May 2, 2022 · 19 comments
Closed

esp32s3 IDF-2048 multicore usb_osglue review (IDFGH-7291) #8879

chmorgan opened this issue May 2, 2022 · 19 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@chmorgan
Copy link
Contributor

chmorgan commented May 2, 2022

I'm trying to configure the console to work on the usb cdc port provided by the eep-box (and I'm guessing many other boards and dev boards).

Found the console_usb example and integrated the code in (it was pretty quick) and ran into this:

/* The two functions below need to be revisited in the multicore case TODO ESP32-S3 IDF-2048*/
_Static_assert(SOC_CPU_CORES_NUM == 1, "usb_osglue_*_int is not multicore capable");

_Static_assert(SOC_CPU_CORES_NUM == 1, "usb_osglue_*_int is not multicore capable");

Using v4.4 but the line above is from master (figured I'd see if it was fixed in master).

Anyone looking at this? I'd like to get the console on this port vs. having to use a serial/usb converter etc to interact with the system.

@espressif-bot espressif-bot added the Status: Opened Issue is new label May 2, 2022
@github-actions github-actions bot changed the title esp32s3 IDF-2048 multicore usb_osglue review esp32s3 IDF-2048 multicore usb_osglue review (IDFGH-7291) May 2, 2022
@igrr
Copy link
Member

igrr commented May 2, 2022

Hi @chmorgan,
We have a draft patch which fixes this, but we haven't got the USB_OTG CDC feature on S3 fully working yet (with reboot-into-download mode). There is also another issue open on Github which tracks making USB_OTG CDC work on S3: #8738 (comment). If you don't mind, I'd close this one and keep the earlier one open.

There is also another issue about USB console over USB_SERIAL_JTAG peripheral: #8839. Since ESP-BOX uses USB_SERIAL_JTAG peripheral by default, I think that one is more relevant for your use case.

@chmorgan
Copy link
Contributor Author

chmorgan commented May 2, 2022 via email

@igrr
Copy link
Member

igrr commented May 2, 2022

@chmorgan I think #8839 (for USB_SERIAL_JTAG console) is the simpler issue of the two. I think we can have a solution by next week.
#8738 (for USB_CDC) is a bit more complex, I can't give timeline for it yet.

I don’t quite understand the usb jtag vs usb cdc details except that I know I’d like the console on the same single USB port that I get print output on today with idf.py monitor and also program through.

ESP32-S3 chip has two USB-related peripherals:

  • USB_OTG peripheral (which is same as the one in ESP32-S2) — a programmable USB device and host controller. It can support various USB classes and requires a software driver to implement each USB class.
  • USB_SERIAL_JTAG peripheral (new, also introduced in ESP32-C3) — a fixed-function USB composite device which implements two independent functions: CDC and USB-JTAG adapter. It can not support, for instance, USB mass storage or HID. It can be used for JTAG debugging and for serial flashing/monitoring.

You can find more information on the two in the ESP32-S3 technical reference manual.

By default, ESP32-S3 built-in USB PHY is connected to USB_SERIAL_JTAG peripheral. I think that's how ESP-BOX is set up, as well.

From usage perspective, if your device doesn't need to implement any additional USB features (such as MSC, HID and so on), then I would suggest using USB_SERIAL_JTAG (which is the default). If your device needs to support USB MSC, HID or other classes, then you would have to use USB_OTG.

Take note also of limitations of console features on both of them: usb_serial_jtag, usb_otg.

@chmorgan
Copy link
Contributor Author

chmorgan commented May 2, 2022 via email

espressif-bot pushed a commit that referenced this issue May 15, 2022
Related to #8738
Related to #8879

Doesn’t implement USB_CDC (over USB_OTG peripheral) for ESP32-S3 yet;
this only works on ESP32-S2 for now. On ESP32-S3 it is now possible to
use USB_SERIAL_JTAG console.
@igrr
Copy link
Member

igrr commented May 16, 2022

Hi @chmorgan, the "basic" console example now has support for usb_serial_jtag on ESP32-S3. This should let you have a USB console on ESP-BOX. Please see commit 3390d2a for the updates.

As the issue title refers to USB_OTG CDC support on S3, I'll keep the issue open until that part is also implemented.

@chmorgan
Copy link
Contributor Author

@igrr this is great news. Thank you for putting this support in place. I think this is sufficient for our use but of course it will be good to see as the S3 support continues to build out. It still seems like a pretty new chip.

espressif-bot pushed a commit that referenced this issue Jun 8, 2022
Related to #8738
Related to #8879

Doesn’t implement USB_CDC (over USB_OTG peripheral) for ESP32-S3 yet;
this only works on ESP32-S2 for now. On ESP32-S3 it is now possible to
use USB_SERIAL_JTAG console.
@SinanAkkoyun
Copy link

SinanAkkoyun commented Aug 1, 2022

Hi, thanks for all the great resources you people provided!!! <3

I am still getting the

master/esp-idf/components/esp_system/port/soc/esp32s3/usb_console.c:69:1: error: static assertion failed: "usb_osglue_*_int is not multicore capable"
   69 | _Static_assert(SOC_CPU_CORES_NUM == 1, "usb_osglue_*_int is not multicore capable");
      | ^~~~~~~~~~~~~~
[230/861] Performing configure step for 'bootloader'

error when trying to compile for the S3, is there any approximate timeline at which the serial console will work on the S3 OTG? :)

@igrr
Copy link
Member

igrr commented Aug 1, 2022

@SinanAkkoyun Actually this is now in progress, I hope that in one-two weeks this feature will be available in master branch.

@SinanAkkoyun
Copy link

Cool, thanks so much!

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Aug 1, 2022
@udem1234
Copy link

udem1234 commented Nov 18, 2022

@SinanAkkoyun Actually this is now in progress, I hope that in one-two weeks this feature will be available in master branch.

Hi @igrr ! Any update on this ?

@dchichkov
Copy link

I've started hitting this assert(SOC_CPU_CORES_NUM == 1, "usb_osglue_*_int is not multicore capable"), is there a commit or workaround available?

@udem1234
Copy link

@SinanAkkoyun Actually this is now in progress, I hope that in one-two weeks this feature will be available in master branch.

@igrr : Is this feature/issue resolving still in progress ?

Thank you ! :-)

@kraftwerk-zone
Copy link

any update on this?

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Apr 18, 2023
espressif-bot pushed a commit that referenced this issue Aug 22, 2023
@rodmaz
Copy link

rodmaz commented Nov 14, 2023

Is this fixed in v4.4.x? We upgraded to v4.4.6 and still see this problem.

@igrr
Copy link
Member

igrr commented Nov 14, 2023

@rodmaz Support for system console via USB_OTG on ESP32-S3 was never present in v4.4.x releases, so I don't think this is a regression. Please check that you haven't accidentally set the console output channel to USB_OTG in menuconfig.

@rodmaz
Copy link

rodmaz commented Nov 14, 2023

@igrr We are actually trying to use USB_OTG in v4.4.x. It seems we need to upgrade to v5.x then?

@igrr
Copy link
Member

igrr commented Nov 14, 2023

Do you intend to use USB_OTG only for the console, or for some other functionality? If also for some other USB classes than CDC, which ones? If you are using it only for the console, have you considered using the USB_SERIAL_JTAG-based console instead?

@rodmaz
Copy link

rodmaz commented Nov 14, 2023

No, we want to use debugger as well with OpenOCD.

@igrr
Copy link
Member

igrr commented Nov 14, 2023

In this case you should use console via USB_SERIAL_JTAG — this is the peripheral which provides both CDC console and JTAG interface over USB: https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32s3/api-guides/usb-serial-jtag-console.html

(USB_OTG is a programmable USB peripheral which can be used to implement features such as MSC, CDC, HID and so on, in software. It can't be used to debug ESP32-S3 over JTAG.)

igrr added a commit that referenced this issue Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

8 participants