Hi Martin
Very good, that's something.
Unfortunately, no success yet.
I always get a message saying that the baud rate of Com5 is not supported.
And then com5 is blocked.
Can you tell me which S3 board you have and post your program?
ESP32 UART-USB Brige How to use
-
stefan.erni
- Valued Contributor
- Posts: 1126
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 215 times
- Been thanked: 235 times
-
mnfisher
- Valued Contributor
- Posts: 1721
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 147 times
- Been thanked: 803 times
Re: ESP32 UART-USB Brige How to use
I used https://www.amazon.co.uk/diymore-ESP32- ... r=8-5&th=1
(there must be a better way to get a link out of amazon?)
I find I can 'lock' the board - when I need to press and hold 'boot' and then press and release reset to get Windows to recognise it.
I just do a loop with :
delay(1s)
If I add a Flowcode UART - channel 1 will open (BUT writing to it doesn't send anything- and the pins can't be selected) - channel 2 seems to lock the board (I tried 19 and 20 (message as above)
When it works - I get the usual esp32 'preamble' - output first then 'Hello.... repeated. Pressing 'reset' closes the COM port - but I can reopen to get
ESP-ROM:esp32s3-20210327
Hello world
Hello world
....
I also toggle a pin (and have a logic analyser attached) - for when I was first looking for 'life'
COM port setting - if I use PuTTY - I use 115200 baud - if I use idf.py -pCOM5 -b 921600 flash monitor - it probably uses 115200 for the monitor (upload is at 921600)?
Occasionally I need to hit the reset button when starting monitoring to get past the 'waiting for download' message.
Currently using 5.4.1 - although I might revert to 5.5 and see if there any differences?
Martin
(there must be a better way to get a link out of amazon?)
I find I can 'lock' the board - when I need to press and hold 'boot' and then press and release reset to get Windows to recognise it.
I just do a loop with :
Code: Select all
printf("Hello World\r\n"); If I add a Flowcode UART - channel 1 will open (BUT writing to it doesn't send anything- and the pins can't be selected) - channel 2 seems to lock the board (I tried 19 and 20 (message as above)
When it works - I get the usual esp32 'preamble' - output first then 'Hello.... repeated. Pressing 'reset' closes the COM port - but I can reopen to get
ESP-ROM:esp32s3-20210327
Hello world
Hello world
....
I also toggle a pin (and have a logic analyser attached) - for when I was first looking for 'life'
COM port setting - if I use PuTTY - I use 115200 baud - if I use idf.py -pCOM5 -b 921600 flash monitor - it probably uses 115200 for the monitor (upload is at 921600)?
Occasionally I need to hit the reset button when starting monitoring to get past the 'waiting for download' message.
Currently using 5.4.1 - although I might revert to 5.5 and see if there any differences?
Martin
- Attachments
-
- Flowcode1.fcfx
- (7.62 KiB) Downloaded 85 times
-
stefan.erni
- Valued Contributor
- Posts: 1126
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 215 times
- Been thanked: 235 times
Re: ESP32 UART-USB Brige How to use
Hi Martin
I found more infos, But I can't find the TinyUSB setting in sdconfig.
Actually, this should already be available in sdconfig.
I found more infos, But I can't find the TinyUSB setting in sdconfig.
Actually, this should already be available in sdconfig.
Option 2: With TinyUSB (full USB functionality)
If you need data transfer like a real USB bridge, you must enable the TinyUSB stack.
To do this:
Add the component:
idf.py add-dependency esp_tinyusb~2.0.0
Afterwards, the following options will appear in menuconfig:
Component config → TinyUSB Stack
[*] Enable TinyUSB
[*] Enable CDC class
This sets:
CONFIG_TINYUSB_ENABLED=y
CONFIG_TINYUSB_CDC_ENABLED=y
CONFIG_USB_DEVICE_ENABLED=y
Initialize in the code:
C#include “tinyusb.h”tinyusb_driver_install(&tusb_cfg);Show more lines
This allows you to use your own USB CDC endpoints and send data as you would with a virtual COM port. [docs.espressif.com], [github.com]
-
stefan.erni
- Valued Contributor
- Posts: 1126
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 215 times
- Been thanked: 235 times
Re: ESP32 UART-USB Brige How to use
I downloaded the Flowcode_Compiler_ESP_5.3a.msi and and installed.
FC11 works right away.
However, the section for USB does not appear in the menu.
FC11 works right away.
However, the section for USB does not appear in the menu.
-
mnfisher
- Valued Contributor
- Posts: 1721
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 147 times
- Been thanked: 803 times
Re: ESP32 UART-USB Brige How to use
Hi Stefan,
i've only had time for a brief play (using 5.5) - I managed to compile a demo successfully - but the program threw errors (TinyUSB task cannot have size 0 or similar)
But will experiment some more....
Martin
i've only had time for a brief play (using 5.5) - I managed to compile a demo successfully - but the program threw errors (TinyUSB task cannot have size 0 or similar)
But will experiment some more....
Martin
-
stefan.erni
- Valued Contributor
- Posts: 1126
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 215 times
- Been thanked: 235 times
Re: ESP32 UART-USB Brige How to use
Hi Martin
that's quite something
I had to enter commands via the console, then I could start the menu and TinyUSB appeared in the menu for the first time.
(I have no idea how to do that in FC11.)
This TinyUSB is for ESP32-S3 and not for all Classic ESP32
All ESP32 chips can send UART data, but:
Classic ESP32 only via external USB-UART chip.
ESP32-S3 additionally directly via USB-CDC (TinyUSB)
Probably a TinyUSB task needs to be created or used?
But then it should simply be possible to send data to the PC via uart0 to pin
Select the UART component and set it to UART0.
TX = GPIO43, RX = GPIO44 (default for ESP32-S3).
Flowcode sends data via UART0 → the chip's USB-CDC forwards it to the PC.
for the console:
Perhaps this can be done via defaults?
that's quite something
I had to enter commands via the console, then I could start the menu and TinyUSB appeared in the menu for the first time.
(I have no idea how to do that in FC11.)
This TinyUSB is for ESP32-S3 and not for all Classic ESP32
All ESP32 chips can send UART data, but:
Classic ESP32 only via external USB-UART chip.
ESP32-S3 additionally directly via USB-CDC (TinyUSB)
Probably a TinyUSB task needs to be created or used?
But then it should simply be possible to send data to the PC via uart0 to pin
Select the UART component and set it to UART0.
TX = GPIO43, RX = GPIO44 (default for ESP32-S3).
Flowcode sends data via UART0 → the chip's USB-CDC forwards it to the PC.
for the console:
Code: Select all
idf.py create-project c:\\usb_cdc_demo
cd c:\\usb_cdc_demo
idf.py add-dependency esp_tinyusb~2.0.0
idf.py menuconfig
Code: Select all
sdkconfig.defaults
CONFIG_TINYUSB_ENABLED=y
CONFIG_USB_DEVICE_ENABLED=y
CONFIG_TINYUSB_CDC_ENABLED=y
CONFIG_TINYUSB_CDC_CHANNEL_COUNT=1
CONFIG_TINYUSB_TASK_STACK_SIZE=4096
CONFIG_TINYUSB_TASK_PRIORITY=5
-
stefan.erni
- Valued Contributor
- Posts: 1126
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 215 times
- Been thanked: 235 times
Re: ESP32 UART-USB Brige How to use
Hi Martin
Do you have any idea how I can set TINYUSB_ENABLED=y and the other settings
in the menu so that it works with Flowcode?
Do you have any idea how I can set TINYUSB_ENABLED=y and the other settings
in the menu so that it works with Flowcode?