Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Write to USB JTAG serial on ESP32-S3 #7201

Unanswered
txf- asked this question in Q&A
Discussion options

I need to be able to use the USB serial device in download mode and have a Serial device via USB. As per discussions and this bug report, one cannot have TinyUSB CDC running, or the ESP does not reset out of the bootloader.

As per the ESP-IDF documentation, I can configure printf to print using the ROM Serial in the USB-JTAG peripheral:

#include "esp_vfs_dev.h"
#include "esp_vfs_cdcacm.h"
#include "esp_vfs_usb_serial_jtag.h"
#include "driver/usb_serial_jtag.h"
#define PRINTF_USB printf
void configJtagSerialUSB(){
 setvbuf(stdin, NULL, _IONBF, 0);
 // /* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
 esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
 // /* Move the caret to the beginning of the next line on '\n' */
 esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
 
 // /* Enable non-blocking mode on stdin and stdout */
 fcntl(fileno(stdout), F_SETFL, 0);
 fcntl(fileno(stdin), F_SETFL, 0);
 usb_serial_jtag_driver_config_t usb_serial_jtag_config = (usb_serial_jtag_driver_config_t){512,256};
 // /* Install USB-SERIAL-JTAG driver for interrupt-driven reads and writes */
 esp_err_t ret = usb_serial_jtag_driver_install(&usb_serial_jtag_config);
 
 if (ret != ESP_OK) {
 }
}

This works well if I want to use printf, but how would I go about using it if I wanted to write binary data? Is there a way to map the Arduino Serial objects to the ROM serial?

Will I have to use the IDF functions like
usb_serial_jtag_write_bytes(const void* src, size_t size, TickType_t ticks_to_wait);

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /