esp-rs / esp-hal

no_std Hardware Abstraction Layers for ESP32 microcontrollers
https://docs.esp-rs.org/esp-hal/
Apache License 2.0
635 stars 177 forks source link

esp-println: Use USB-CDC on esp32s2/s3 #1577

Open UseAfterFreee opened 1 year ago

UseAfterFreee commented 1 year ago

I might be misunderstanding something (or doing something wrong) as I am quite new to the esp-rs community, so sorry for that in advance. I currently have some WEMOS lolin 32 s2 mini laying around and wanted to try creating a no-std rust project for them. For simple logging purposes I wanted to use the USB Serial Console (CDC), as I do not currently have a jtag or uart to usb adapter laying around. Is it possible to use the CDC with this crate? And if not, is this planned to be implemented?

jessebraham commented 1 year ago

It is not currently possible to use USB CDC with this crate, but that's something that we should add support for. To be honest I just learned of this feature recently when it was added to espflash, so it was just missed here :)

I should be able to take a look into this next week some time.

joeatbayes commented 4 months ago

Was this ever implemented for the EPS32-s2? if so can you please provide a link for how to configure it?

MabezDev commented 4 months ago

It's not implemented yet.

jath03 commented 2 months ago

I'm coming from https://github.com/esp-rs/espflash/issues/621, and am researching how to implement this. According to the espressif docs, there is a USB CDC implementation in the ROM code. I'm trying to look at the ROM includes to understand how to use it, but I'm not getting very far. I could use some pointers from someone with a bit more experience with embedded programming and USB. I don't really know what I'm looking at with the ROM stuff.

bjoernQ commented 2 months ago

You could probably search for CONFIG_ESP_CONSOLE_USB_CDC in ESP-IDF. Especially https://github.com/espressif/esp-idf/blob/master/components/bootloader_support/src/bootloader_console.c might be interesting