hello!
i want communicate with PC by using esp32-c3's USB-SERIAL-JTAG port as usual uart,
but,i don't known how to initialize it,don't know which API can send data to the usb-serial port or receive data from it.
would you tell me the details?
there are some functions in ESP-IDF 4.4:
static void usb_serial_jtag_write_and_flush(const uint8_t *buf, uint32_t wr_len)
static void usb_serial_jtag_isr_handler_default(void *arg)
esp_err_t usb_serial_jtag_driver_install(usb_serial_jtag_driver_config_t *usb_serial_jtag_config)
int usb_serial_jtag_read_bytes(void* buf, uint32_t length, TickType_t ticks_to_wait)
int usb_serial_jtag_write_bytes(const void* src, size_t size, TickType_t ticks_to_wait)
these functions are interface of usb-serial-jtag port?how to use it? where to find examples about?
how can i use USB-SERIAL port communicate with PC?
-
- Posts: 25
- Joined: Sat Jan 08, 2022 3:11 am
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: how can i use USB-SERIAL port communicate with PC?
The most trivial use case is to use menuconfig to configure the USB-serial-JTAG as your standard input/output. You can then use the standard Unix functions (printf, getc, ...) to use it.
-
- Posts: 25
- Joined: Sat Jan 08, 2022 3:11 am
Re: how can i use USB-SERIAL port communicate with PC?
good,thanks very much.
-
- Posts: 37
- Joined: Fri Dec 24, 2021 12:40 pm
Re: how can i use USB-SERIAL port communicate with PC?
If my upper computer send datas to esp32-c3, what function or API let esp32-c3 capture these data?ESP_Sprite wrote: ↑Sun Jan 16, 2022 11:34 amThe most trivial use case is to use menuconfig to configure the USB-serial-JTAG as your standard input/output. You can then use the standard Unix functions (printf, getc, ...) to use it.
-
- Posts: 25
- Joined: Sat Jan 08, 2022 3:11 am
Re: how can i use USB-SERIAL port communicate with PC?
in my example, i try to use the function:usb_serial_jtag_write_bytes() to get data from PC
but this function work not good.
sometimes it can get data form PC,sometimes can not.
but this function work not good.
sometimes it can get data form PC,sometimes can not.
-
- Posts: 25
- Joined: Sat Jan 08, 2022 3:11 am
Re: how can i use USB-SERIAL port communicate with PC?
sorry, i mean usb_serial_jtag_read_bytes()
-
- Posts: 37
- Joined: Fri Dec 24, 2021 12:40 pm
Re: how can i use USB-SERIAL port communicate with PC?
thank you. If you use scanf or gets maybe easy to realize function.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 66 guests