Comments (12)
Is this about USB Serial Device (CDC-ACM) signals?
from arduino-esp32.
@ChrGri - please keep in mind that DTR and RTS signals of the USB CDC port actually control "reset" and "boot mode" signals of the ESP32-S3.
from arduino-esp32.
It may be putting the S3 into download mode... "freezing/halting" the S3 firmware execution...
from arduino-esp32.
@ChrGri - Please read this: #6762 (comment)
from arduino-esp32.
This behaviour can be disabled permanently by burning the correct eFuse.
from arduino-esp32.
@SuGlider Thank you very much. I understood, that to enter the download mode on a regular ESP, one has to execute a specific DTR/RTS sequence, as shown below
.
From the documentation you referenced, I understood that only the download mode flag is toggled, but the chip is never asked to reset:
I think setting Serial.enableReboot(false) has improved the behaviour and the USB HID output is continuous independent of the DTR state. However, simultaneous USB HID and serial output while RTS/DTR sates beeing const. are still buggy and both stall after some time. Single output of serial data or single output of USB HID data works fine though.
BR
Chris
from arduino-esp32.
However, simultaneous USB HID and serial output while RTS/DTR sates beeing const. are still buggy and both stall after some time. Single output of serial data or single output of USB HID data works fine though.
I see that you are using PlatformIO. What is the Arduino Core version used with it?
If possible, could you test it with Arduino IDE using Arduino Core 3.0.0-RC1?
from arduino-esp32.
However, simultaneous USB HID and serial output while RTS/DTR sates beeing const. are still buggy and both stall after some time. Single output of serial data or single output of USB HID data works fine though.
I see that you are using PlatformIO. What is the Arduino Core version used with it? If possible, could you test it with Arduino IDE using Arduino Core 3.0.0-RC1?
I've changed the platformIO as shown below. No difference.
You can find the sample code here. I've played around with Serial.setTxTimeoutMs(0);
and Serial.flush();
without success. The observation is always, as soon as USB HID and serial output are activated together, the output will stall at some point.
BR
Chris
from arduino-esp32.
One thing which helped a lot, was adding a delay between the serial write and USB HID output command, as such
.
Wit that delay, the serial and USB HID output don't seem to stall immediately. Reducing the delays to 1ms will make the output stall eventually. I'm a bit confused, that replacing the delays with Serial.flush()
doesn't seem to have the same effect.
BR
Chris
from arduino-esp32.
I understand that your project uses USB OTG and TinyUSB for both, HID and CDC.
The delay seems to give TinyUSB some room to run different tasks from those 2 endpoints and/or their tasks...
It may be necessary to run a deep investigation of this issue.
from arduino-esp32.
I understand that your project uses USB OTG and TinyUSB for both, HID and CDC. The delay seems to give TinyUSB some room to run different tasks from those 2 endpoints and/or their tasks...
It may be necessary to run a deep investigation of this issue.
Yes, CDC and HID. Do you have an idea, why Serial.flush()
apparently doesn't give that room too?
Is there something I can to help to find a proper fix?
Edit:
Btw. setting the first delay to 500ms and disabling the second delay results in a stall again. Seems to be purely related to the immediate HID output call after the serial write call.
BR
Chris
from arduino-esp32.
I'd need to analyse it better and try to understand why it could fail.
Regarding Serial. Flush()
, it actually just waits until all the data is sent to the USB Host.
By other hand, delay(time_ms)
releases the FreeRTOS Scheduler to run another task while waiting for that time to pass.
Arduino has a 1 ms time slice defined for FreeRTOS.
delay(5);
means waiting for 5 time slices while other tasks could be executed - maybe something related to HID...
This is the "room" that I've mentioned about.
It is necessary to see the whole picture and try to understand the sequence of actions and possible reasons for the issue.
from arduino-esp32.
Related Issues (20)
- partitions.csv ignored HOT 1
- Error Partition Tables HOT 1
- ETH_W5500_IDF_SPI.ino // It can not get dhcp ip. HOT 12
- ESP32-C3 Arduino IDE Upload ERROR when USB CDC on, No serial data received Error occurs HOT 17
- UNABLE TO PROGRAM MY ESP CHIP USING AN EXTERNAL PROGRAMMER HOT 6
- ESP32-S3 OTA crashes with W5500 phy module HOT 13
- SmoothBlink_ULP_Code.ino fails to compile for XIAO_ESP32C6 HOT 1
- > 另
- Kendi kartımın pin.h dosyasını nasıl eklerim buraya HOT 2
- fatal error: bits/c++config.h: No such file or directory HOT 4
- ETH.end() crashes HOT 7
- Bootloop running 'Zigbee_Thermostat.ino' example on ESP32C6 HOT 1
- [Arduino Nano ESP32 board] Reboot loop upon using Serial0 HOT 9
- ESP32 I2S 24 bit data reading + INMP441 Mic + Frequency Mirroring HOT 4
- ESP32-4848S040 Not supported in 3.0.x HOT 6
- Face-Detecton on ESP32-S3 without Wifi / Webserver is very poor HOT 3
- ETH static IP configuration doesn't work HOT 11
- ETH.end clears static IP config HOT 8
- Continuous ADC does not function correctly with ADC1_CH8 and ADC1_CH9 HOT 3
- ESP32S3 Serial Port Available Fails When Device Powered Externally HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-esp32.