ESP32C6 - Using USB Serial without logging
Posted: Mon Jul 08, 2024 2:02 pm
Hi,
For my application I'd like to send data over the USB-serial port. However, I cannot find a way of enabling the USB-UART bridge without also enabling logging over this port. Ideally, I'd like to have the following sdkconfig fields to completely disable the ESP_LOGx functions logging to UART/USB.
But, when I am in this mode I seem unable to init the driver/usb_serial_jtag peripheral to manually send data over the USB-serial bridge. Is there a way of doing this? This is my current code to initialize and send data over the usb_serial_jtag driver.
Which outputs:
Any help or pointers would be appreciated!
Thanks in advance,
Niels
For my application I'd like to send data over the USB-serial port. However, I cannot find a way of enabling the USB-UART bridge without also enabling logging over this port. Ideally, I'd like to have the following sdkconfig fields to completely disable the ESP_LOGx functions logging to UART/USB.
Code: Select all
CONFIG_ESP_CONSOLE_NONE=y
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
Code: Select all
printf("Configuring USB\n");
usb_serial_jtag_driver_config_t usbConfig = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
esp_err_t usbRet = usb_serial_jtag_driver_install(&usbConfig);
printf("USB Configured: %d\n", usbRet);
const char* prompt = "1234567890abcdef\n";
int s = usb_serial_jtag_write_bytes((uint8_t*)prompt, strlen(prompt), portMAX_DELAY);
printf("Bytes send: %d\n", s);
Code: Select all
Configuring USB
USB Configured: 0
Bytes send: 17
Thanks in advance,
Niels