Hi Martin
My testprogram:
You can find a description of the hardware here
viewtopic.php?t=3644
ESP32 UART-USB Brige How to use
-
stefan.erni
- Valued Contributor
- Posts: 1204
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 222 times
- Been thanked: 240 times
-
stefan.erni
- Valued Contributor
- Posts: 1204
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 222 times
- Been thanked: 240 times
Re: ESP32 UART-USB Brige How to use
Hi Martin
One a question:
There is still one entry missing :
But in FC11 there are so many sdkconfig.defaults.esp32s3.
Which one is the right one?
One a question:
There is still one entry missing :
in the file:CONFIG_USB_DEVICE_ENABLED=y
CONFIG_TINYUSB_ENABLED=y
CONFIG_TINYUSB_DEVICE_ENABLED=y
CONFIG_TINYUSB_CDC_ENABLED=y
sdkconfig.defaults.esp32s3
But in FC11 there are so many sdkconfig.defaults.esp32s3.
Which one is the right one?
-
stefan.erni
- Valued Contributor
- Posts: 1204
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 222 times
- Been thanked: 240 times
Re: ESP32 UART-USB Brige How to use
Hi Martin
I've now updated to 5.3.1 and added the USB Tiny dependency.
I also have some C code there can I use it in Flowcode?
include are ok:
C-Code for USB:
I've now updated to 5.3.1 and added the USB Tiny dependency.
I also have some C code there can I use it in Flowcode?
include are ok:
Code: Select all
#include "tinyusb.h"
#include "tusb_cdc_acm.h"
#include "esp_log.h"
Code: Select all
void app_main(void)
{
// TinyUSB Basisconfig
tinyusb_config_t tusb_cfg = {
.device_descriptor = NULL,
.string_descriptor = NULL,
.external_phy = false // intern USB-PHY des ESP32-S3
};
// USB-Device (TinyUSB) start
tinyusb_driver_install(&tusb_cfg);
// USB-CDC (virtueller COM-Port) config
tinyusb_cdcacm_config_t cdc_cfg = {
.usb_dev = TINYUSB_USBDEV_0,
.cdc_port = TINYUSB_CDC_ACM_0,
.rx_unread_size = 64,
};
tusb_cdc_acm_init(&cdc_cfg);
// wait, for USB clean
vTaskDelay(pdMS_TO_TICKS(300));
// „Hello world“ send
const char *msg = "Hello world\r\n";
tusb_cdc_acm_write(TINYUSB_CDC_ACM_0, (uint8_t *)msg, strlen(msg));
tusb_cdc_acm_write_flush(TINYUSB_CDC_ACM_0, 0);
// (Flowcode need main loop)
while (1)
{
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
-
mnfisher
- Valued Contributor
- Posts: 1887
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 154 times
- Been thanked: 889 times
Re: ESP32 UART-USB Brige How to use
Hi Stefan,
Yes - you can use the C to initialise - rename (app_main) initialise (or some such) and add a function definition to the 'includes' (top) box of supplementary code... ( void initialise(void); ) Remove the loop (and the 'hello world'?) from the end of the function...
Then call initialise(); from a C block.
You can also add a 'Print(char *str);' function - which could call tusb_cdc_acm_write and flush..
Martin
Yes - you can use the C to initialise - rename (app_main) initialise (or some such) and add a function definition to the 'includes' (top) box of supplementary code... ( void initialise(void); ) Remove the loop (and the 'hello world'?) from the end of the function...
Then call initialise(); from a C block.
You can also add a 'Print(char *str);' function - which could call tusb_cdc_acm_write and flush..
Martin
-
stefan.erni
- Valued Contributor
- Posts: 1204
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 222 times
- Been thanked: 240 times
Re: ESP32 UART-USB Brige How to use
Hi Martin
Thank you Martin I'll give that a try.
I've had a bit of success with `print_F` so far.
I still have no idea how to send an array
Very short program: C-Code: On computer (regardless of the baud rate)
Thank you Martin I'll give that a try.
I've had a bit of success with `print_F` so far.
I still have no idea how to send an array
Very short program: C-Code: On computer (regardless of the baud rate)