Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(USB): OTG S2 and S3 debug print #10123

Merged
merged 3 commits into from
Aug 13, 2024
Merged

fix(USB): OTG S2 and S3 debug print #10123

merged 3 commits into from
Aug 13, 2024

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Aug 6, 2024

Description of Change

ESP32-S2 and S3 using USB CDC OTG (TinyUSB) won't print any log information. This commit fixes that.

Tests scenarios

Using ESP32-S2 and S3 with USB CDC On Boot enabled and in the case of S3, USB Mode shall be USB OTG (TinyUSB).
Set log level to Verbose.

#include <Arduino.h>
#include <esp_log.h>
#include <chip-debug-report.h> 

void setup() {
  neopixelWrite(RGB_BUILTIN, 32, 0, 0); // RED until Serial Monitor is open
  Serial.begin();
  Serial.setDebugOutput(true);

  while (!Serial) delay(100);
  printBeforeSetupInfo();
  esp_log_level_set("*", ESP_LOG_VERBOSE);
  neopixelWrite(RGB_BUILTIN, 0, 16, 0); // Green when Serial Monitor is open
}

void loop() {
  Serial.println("This is a Serial.println");

  log_e("This is a log_e error");
  ESP_LOGE("mainloop", "This is an ESP_LOGE error");
  delay(2000);
}

Related links

Fixes #10121

ESP32-S2 and S3 using USB CDC OTG (TinyUSB) won't print any log information. This commit fixes that.
@SuGlider SuGlider added Chip: ESP32-S2 Issue is related to support of ESP32-S2 Chip Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip labels Aug 6, 2024
@SuGlider SuGlider self-assigned this Aug 6, 2024
Copy link
Contributor

github-actions bot commented Aug 6, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "fix(USB): OTG S2 and S3 debug print":
    • scope/component should be lowercase without whitespace, allowed special characters are _ / . , * - .
  • the commit message "fix(cdc): trying macos":
    • summary looks too short

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

⚠️

The source branch "USB_OTG_debug_print" incorrect format:

  • contains uppercase letters. This can cause troubles on case-insensitive file systems (macOS).
    Please rename your branch.
Messages
📖 You might consider squashing your 3 commits (simplifying branch history).

👋 Hello SuGlider, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against b92a134

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 6, 2024

@VojtechBartoska - Please add the 3.0.5 TAG / Milestone.

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Test Results

 56 files   -  83   56 suites   - 83   4m 49s ⏱️ - 1h 38m 15s
 21 tests  -   9   21 ✅  -   9  0 💤 ±0  0 ❌ ±0 
135 runs   - 168  135 ✅  - 168  0 💤 ±0  0 ❌ ±0 

Results for commit b92a134. ± Comparison against base commit 70786dc.

This pull request removes 9 tests.
performance.coremark.test_coremark ‑ test_coremark
performance.fibonacci.test_fibonacci ‑ test_fibonacci
performance.psramspeed.test_psramspeed ‑ test_psramspeed
performance.ramspeed.test_ramspeed ‑ test_ramspeed
performance.superpi.test_superpi ‑ test_superpi
test_touch_errors
test_touch_interrtupt
test_touch_read
validation.periman.test_periman ‑ test_periman

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Aug 7, 2024

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S3000.000.00000.000.00
ESP32S2000.000.00000.000.00
ESP32C3000.000.00000.000.00
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
ESP32000.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
ArduinoOTA/examples/BasicOTA00000000--00
AsyncUDP/examples/AsyncUDPClient00000000--00
AsyncUDP/examples/AsyncUDPMulticastServer00000000--00
AsyncUDP/examples/AsyncUDPServer00000000--00
BLE/examples/BLE5_extended_scan00--000000--
BLE/examples/BLE5_multi_advertising00--000000--
BLE/examples/BLE5_periodic_advertising00--000000--
BLE/examples/BLE5_periodic_sync00--000000--
BLE/examples/Beacon_Scanner00--00000000
BLE/examples/Client00--00000000
BLE/examples/EddystoneTLM_Beacon00--0000--00
BLE/examples/EddystoneURL_Beacon00--0000--00
BLE/examples/Notify00--00000000
BLE/examples/Scan00--00000000
BLE/examples/Server00--00000000
BLE/examples/Server_multiconnect00--00000000
BLE/examples/UART00--00000000
BLE/examples/Write00--00000000
BLE/examples/iBeacon00--00000000
DNSServer/examples/CaptivePortal00000000--00
EEPROM/examples/eeprom_class000000000000
EEPROM/examples/eeprom_extra000000000000
EEPROM/examples/eeprom_write000000000000
ESP32/examples/AnalogOut/LEDCFade000000000000
ESP32/examples/AnalogOut/LEDCSingleChannel000000000000
ESP32/examples/AnalogOut/LEDCSoftwareFade000000000000
ESP32/examples/AnalogOut/SigmaDelta000000000000
ESP32/examples/AnalogOut/ledcFrequency000000000000
ESP32/examples/AnalogOut/ledcWrite_RGB000000000000
ESP32/examples/AnalogRead000000000000
ESP32/examples/AnalogReadContinuous000000000000
ESP32/examples/ArduinoStackSize000000000000
ESP32/examples/CI/CIBoardsTest000000000000
ESP32/examples/Camera/CameraWebServer0000------00
ESP32/examples/ChipID/GetChipID000000000000
ESP32/examples/DeepSleep/ExternalWakeUp0000------00
ESP32/examples/DeepSleep/TimerWakeUp00000000--00
ESP32/examples/DeepSleep/TouchWakeUp0000------00
ESP32/examples/FreeRTOS/BasicMultiThreading000000000000
ESP32/examples/FreeRTOS/Mutex000000000000
ESP32/examples/FreeRTOS/Queue000000000000
ESP32/examples/FreeRTOS/Semaphore000000000000
ESP32/examples/GPIO/BlinkRGB000000000000
ESP32/examples/GPIO/FunctionalInterrupt000000000000
ESP32/examples/GPIO/FunctionalInterruptStruct000000000000
ESP32/examples/GPIO/GPIOInterrupt000000000000
ESP32/examples/HWCDC_Events00--000000--
ESP32/examples/MacAddress/GetMacAddress000000000000
ESP32/examples/RMT/Legacy_RMT_Driver_Compatible000000000000
ESP32/examples/RMT/RMTCallback000000000000
ESP32/examples/RMT/RMTLoopback000000000000
ESP32/examples/RMT/RMTReadXJT000000000000
ESP32/examples/RMT/RMTWriteNeoPixel000000000000
ESP32/examples/RMT/RMT_CPUFreq_Test000000000000
ESP32/examples/RMT/RMT_EndOfTransmissionState000000000000
ESP32/examples/RMT/RMT_LED_Blink000000000000
ESP32/examples/ResetReason/ResetReason000000000000
ESP32/examples/ResetReason/ResetReason2000000000000
ESP32/examples/Serial/BaudRateDetect_Demo000000000000
ESP32/examples/Serial/OnReceiveError_BREAK_Demo000000000000
ESP32/examples/Serial/OnReceive_Demo000000000000
ESP32/examples/Serial/RS485_Echo_Demo000000000000
ESP32/examples/Serial/RxFIFOFull_Demo000000000000
ESP32/examples/Serial/RxTimeout_Demo000000000000
ESP32/examples/Serial/Serial_All_CPU_Freqs000000000000
ESP32/examples/Serial/Serial_STD_Func_OnReceive000000000000
ESP32/examples/Serial/onReceiveExample000000000000
ESP32/examples/TWAI/TWAIreceive000000000000
ESP32/examples/TWAI/TWAItransmit000000000000
ESP32/examples/Template/ExampleTemplate000000000000
ESP32/examples/Time/SimpleTime00000000--00
ESP32/examples/Timer/RepeatTimer000000000000
ESP32/examples/Timer/WatchdogTimer000000000000
ESP32/examples/Touch/TouchButtonV20000--------
ESP32/examples/Touch/TouchInterrupt0000------00
ESP32/examples/Touch/TouchRead0000------00
ESP32/examples/Utilities/HEXBuilder000000000000
ESP32/examples/Utilities/MD5Builder000000000000
ESP32/examples/Utilities/SHA1Builder000000000000
ESP_I2S/examples/ES8388_loopback000000000000
ESP_I2S/examples/Record_to_WAV00--------00
ESP_I2S/examples/Simple_tone000000000000
ESP_NOW/examples/ESP_NOW_Broadcast_Master00000000--00
ESP_NOW/examples/ESP_NOW_Broadcast_Slave00000000--00
ESP_NOW/examples/ESP_NOW_Network00000000--00
ESP_NOW/examples/ESP_NOW_Serial00000000--00
ESP_SR/examples/Basic00----------
ESPmDNS/examples/mDNS-SD_Extended00000000--00
ESPmDNS/examples/mDNS_Web_Server00000000--00
Ethernet/examples/ETH_W5500_Arduino_SPI000000000000
Ethernet/examples/ETH_W5500_IDF_SPI000000000000
Ethernet/examples/ETH_WIFI_BRIDGE00000000--00
FFat/examples/FFat_Test000000000000
FFat/examples/FFat_time00000000--00
HTTPClient/examples/Authorization00000000--00
HTTPClient/examples/BasicHttpClient00000000--00
HTTPClient/examples/BasicHttpsClient00000000--00
HTTPClient/examples/HTTPClientEnterprise00000000--00
HTTPClient/examples/ReuseConnection00000000--00
HTTPClient/examples/StreamHttpClient00000000--00
HTTPUpdate/examples/httpUpdate00000000--00
HTTPUpdate/examples/httpUpdateSPIFFS00000000--00
HTTPUpdate/examples/httpUpdateSecure00000000--00
HTTPUpdateServer/examples/WebUpdater00000000--00
Insights/examples/DiagnosticsSmokeTest000000----00
Insights/examples/MinimalDiagnostics000000----00
LittleFS/examples/LITTLEFS_test000000000000
LittleFS/examples/LITTLEFS_time00000000--00
NetBIOS/examples/ESP_NBNST00000000--00
NetworkClientSecure/examples/WiFiClientInsecure00000000--00
NetworkClientSecure/examples/WiFiClientPSK00000000--00
NetworkClientSecure/examples/WiFiClientSecure00000000--00
NetworkClientSecure/examples/WiFiClientSecureEnterprise00000000--00
NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade00000000--00
NetworkClientSecure/examples/WiFiClientShowPeerCredentials00000000--00
NetworkClientSecure/examples/WiFiClientTrustOnFirstUse00000000--00
PPP/examples/PPP_Basic000000000000
PPP/examples/PPP_WIFI_BRIDGE00000000--00
Preferences/examples/Prefs2Struct000000000000
Preferences/examples/StartCounter000000000000
RainMaker/examples/RMakerCustom00000000--00
RainMaker/examples/RMakerCustomAirCooler00000000--00
RainMaker/examples/RMakerSonoffDualR300000000--00
RainMaker/examples/RMakerSwitch00000000--00
SD/examples/SD_Test000000000000
SD/examples/SD_time00000000--00
SD_MMC/examples/SD2USBMSC00----------
SD_MMC/examples/SDMMC_Test00--------00
SD_MMC/examples/SDMMC_time00--------00
SPI/examples/SPI_Multiple_Buses0000------00
SPIFFS/examples/SPIFFS_Test000000000000
SPIFFS/examples/SPIFFS_time00000000--00
SimpleBLE/examples/SimpleBleDevice00----000000
TFLiteMicro/examples/hello_world000000000000
Ticker/examples/Blinker000000000000
Ticker/examples/TickerBasic000000000000
Ticker/examples/TickerParameter000000000000
USB/examples/CompositeDevice0000--------
USB/examples/ConsumerControl0000--------
USB/examples/CustomHIDDevice0000--------
USB/examples/FirmwareMSC0000--------
USB/examples/Gamepad0000--------
USB/examples/HIDVendor0000--------
USB/examples/Keyboard/KeyboardLogout0000--------
USB/examples/Keyboard/KeyboardMessage0000--------
USB/examples/Keyboard/KeyboardReprogram0000--------
USB/examples/Keyboard/KeyboardSerial0000--------
USB/examples/KeyboardAndMouseControl0000--------
USB/examples/MIDI/MidiController0000--------
USB/examples/MIDI/MidiInterface0000--------
USB/examples/MIDI/MidiMusicBox0000--------
USB/examples/MIDI/ReceiveMidi0000--------
USB/examples/Mouse/ButtonMouseControl0000--------
USB/examples/SystemControl0000--------
USB/examples/USBMSC0000--------
USB/examples/USBSerial0000--------
USB/examples/USBVendor0000--------
Update/examples/AWS_S3_OTA_Update00000000--00
Update/examples/HTTPS_OTA_Update00000000--00
Update/examples/HTTP_Client_AES_OTA_Update00000000--00
Update/examples/HTTP_Server_AES_OTA_Update00000000--00
Update/examples/OTAWebUpdater00000000--00
Update/examples/SD_Update000000000000
WebServer/examples/AdvancedWebServer00000000--00
WebServer/examples/FSBrowser00000000--00
WebServer/examples/Filters00000000--00
WebServer/examples/HelloServer00000000--00
WebServer/examples/HttpAdvancedAuth00000000--00
WebServer/examples/HttpAuthCallback00000000--00
WebServer/examples/HttpAuthCallbackInline00000000--00
WebServer/examples/HttpBasicAuth00000000--00
WebServer/examples/HttpBasicAuthSHA100000000--00
WebServer/examples/HttpBasicAuthSHA1orBearerToken00000000--00
WebServer/examples/MultiHomedServers00000000--00
WebServer/examples/PathArgServer00000000--00
WebServer/examples/SDWebServer00000000--00
WebServer/examples/SimpleAuthentification00000000--00
WebServer/examples/UploadHugeFile00000000--00
WebServer/examples/WebServer00000000--00
WebServer/examples/WebUpdate00000000--00
WiFi/examples/FTM/FTM_Initiator00000000--00
WiFi/examples/FTM/FTM_Responder00000000--00
WiFi/examples/SimpleWiFiServer00000000--00
WiFi/examples/WPS00000000--00
WiFi/examples/WiFiAccessPoint00000000--00
WiFi/examples/WiFiBlueToothSwitch00--0000--00
WiFi/examples/WiFiClient00000000--00
WiFi/examples/WiFiClientBasic00000000--00
WiFi/examples/WiFiClientConnect00000000--00
WiFi/examples/WiFiClientEnterprise00000000--00
WiFi/examples/WiFiClientEvents00000000--00
WiFi/examples/WiFiClientStaticIP00000000--00
WiFi/examples/WiFiExtender00000000--00
WiFi/examples/WiFiIPv600000000--00
WiFi/examples/WiFiMulti00000000--00
WiFi/examples/WiFiMultiAdvanced00000000--00
WiFi/examples/WiFiScan00000000--00
WiFi/examples/WiFiScanAsync00000000--00
WiFi/examples/WiFiScanDualAntenna00000000--00
WiFi/examples/WiFiScanTime00000000--00
WiFi/examples/WiFiSmartConfig00000000--00
WiFi/examples/WiFiTelnetToSerial00000000--00
WiFi/examples/WiFiUDPClient00000000--00
WiFiProv/examples/WiFiProv00000000--00
Wire/examples/WireMaster000000000000
Wire/examples/WireScan000000000000
Wire/examples/WireSlave000000000000
OpenThread/examples/COAP/coap_lamp------0000--
OpenThread/examples/COAP/coap_switch------0000--
OpenThread/examples/SimpleCLI------0000--
OpenThread/examples/SimpleNode------0000--
OpenThread/examples/SimpleThreadNetwork/LeaderNode------0000--
OpenThread/examples/SimpleThreadNetwork/RouterNode------0000--
OpenThread/examples/ThreadScan------0000--
OpenThread/examples/onReceive------0000--
BluetoothSerial/examples/DiscoverConnect----------00
BluetoothSerial/examples/GetLocalMAC----------00
BluetoothSerial/examples/SerialToSerialBT----------00
BluetoothSerial/examples/SerialToSerialBTM----------00
BluetoothSerial/examples/SerialToSerialBT_Legacy----------00
BluetoothSerial/examples/SerialToSerialBT_SSP----------00
BluetoothSerial/examples/bt_classic_device_discovery----------00
BluetoothSerial/examples/bt_remove_paired_devices----------00
ESP32/examples/DeepSleep/SmoothBlink_ULP_Code----------00
ESP32/examples/Touch/TouchButton----------00
Ethernet/examples/ETH_LAN8720----------00
Ethernet/examples/ETH_TLK110----------00

@VojtechBartoska VojtechBartoska added this to the 3.0.5 milestone Aug 7, 2024
@VojtechBartoska VojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Aug 7, 2024
@VojtechBartoska VojtechBartoska removed the request for review from me-no-dev August 7, 2024 12:18
@lucasssvaz
Copy link
Collaborator

Tested the PR with S2 and the problem still occurs

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 8, 2024

Tested the PR with S2 and the problem still occurs

I have a different result. What are the IDE settings that you have used?

@lucasssvaz
Copy link
Collaborator

Tested the PR with S2 and the problem still occurs

I have a different result. What are the IDE settings that you have used?

image

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 8, 2024

Tested the PR with S2 and the problem still occurs

I have a different result. What are the IDE settings that you have used?

image

I'm puzzled.... I use the same, but within Windows and it works. Do you see any output or nothing at all?

image

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 8, 2024

@lucasssvaz - Please use the new sketch from the desciption for your testing.
The RGB LED will go RED until the Serial Monitor is open, when it goes GREEN.
In order to upload a new sketch I always press RESET+BOOT to enter in Download mode and then I press RESET to start it.
I can confirm that the PR works for ESP32-S2.

This is the output I get from the USB Serial Port:

=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-S2
  Package           : 0
  Revision          : 0
  Cores             : 1
  CPU Frequency     : 240 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000002
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : No
  IEEE 802.15.4     : No
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   245312 B ( 239.6 KB)
  Free Bytes        :   211372 B ( 206.4 KB)
  Allocated Bytes   :    30552 B (  29.8 KB)
  Minimum Free Bytes:   206252 B ( 201.4 KB)
  Largest Free Block:   188404 B ( 184.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 80 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1408.0 KB, type: DATA, subtype: SPIFFS
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Aug  7 2024 22:30:13
  Compile Host OS   : windows
  ESP-IDF Version   : v5.1.4-257-g3f9ab2d6a6-dirty
  Arduino Version   : 3.0.4
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32S2_DEV
  Arduino Variant   : esp32s2
  Arduino FQBN      : espressif:sglM:esp32s2:JTAGAdapter=default,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=none,ZigbeeMode=default
============ Before Setup End ============
[  3809][V][esp32-hal-rmt.c:454] rmtInit(): GPIO 18 - TX MODE - MemSize[64] - Freq=10000000Hz
[  3809][V][esp32-hal-rmt.c:305] _rmtWrite(): GPIO: 18 - Request: 24 RMT Symbols - Blocking - Timeout: -1
[  3810][V][esp32-hal-rmt.c:306] _rmtWrite(): GPIO: 18 - Currently in Loop Mode: [NO] | Asked to Loop: NO, LoopCancel: NO
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   245312 B ( 239.6 KB)
  Free Bytes        :   211372 B ( 206.4 KB)
  Allocated Bytes   :    30552 B (  29.8 KB)
  Minimum Free Bytes:   206028 B ( 201.2 KB)
  Largest Free Block:   188404 B ( 184.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------  
    18 : RMT_TX
    43 : UART_TX[0]
    44 : UART_RX[0]
============ After Setup End =============
This is a Serial.println
[  3844][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[  3844][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[  5850][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[  5850][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[  7856][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[  7856][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[  9862][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[  9863][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[ 11868][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[ 11868][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[ 13874][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[ 13874][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[ 15880][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:19] loop(): This is a log_e error
[ 15880][E][issue_10121_S2_USB_CDC_Log_x_wont_work.ino:20] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Aug 8, 2024

@SuGlider The LED is working properly in the sketch.
But I have the same issue as Lucas on S2. Only printing This is a Serial.println.
I assume we are both on MacOS (CDC on Boot -> Enabled; log level -> Verbose).

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 8, 2024

The S2 has 2 different USB serial ports when using TinyUSB. One for uploading and a different one for when TinyUSB driver is activated.

For instance with Windows, I see COM12 and after reseting the board I see the COM17.

Does the S2 also create 2 "/dev/usb" files on Mac?

@SuGlider
Copy link
Collaborator Author

SuGlider commented Aug 8, 2024

@lucasssvaz @P-R-O-C-H-Y

USB logging using the S2 was working within the Arduino Core 2.0.14 using almost the same code.

Could you check it under MacOS and let me know?

@P-R-O-C-H-Y
Copy link
Member

The S2 has 2 different USB serial ports when using TinyUSB. One for uploading and a different one for when TinyUSB driver is activated.

For instance with Windows, I see COM12 and after reseting the board I see the COM17.

Does the S2 also create 2 "/dev/usb" files on Mac?

I see only 1 port after connecting the board(USB-port) to PC.

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Aug 8, 2024

@lucasssvaz @P-R-O-C-H-Y

USB logging using the S2 was working within the Arduino Core 2.0.14 using almost the same code.

Could you check it under MacOS and let me know?

@SuGlider Just tested on 2.0.14 with ESP32S2 and it works correctly using your sketch (just had to remove print info).

This is a Serial.println
[  3984][E][sketch_aug08a.ino:17] loop(): This is a log_e error
[  3989][E][sketch_aug08a.ino:18] loop(): [mainloop] This is an ESP_LOGE error
This is a Serial.println
[  6000][E][sketch_aug08a.ino:17] loop(): This is a log_e error
[  6005][E][sketch_aug08a.ino:18] loop(): [mainloop] This is an ESP_LOGE error

EDIT: Tested latest 2.X branch, also works fine.

@P-R-O-C-H-Y
Copy link
Member

To be sure tested again on master with exactly same code + same Tools menu settings.
On master it does not work :/ If you have any suggestions what to change let me know, so I can test it.

changed Macro testing
@lucasssvaz lucasssvaz added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Aug 8, 2024
@me-no-dev me-no-dev merged commit 384cc27 into master Aug 13, 2024
57 checks passed
@SuGlider SuGlider deleted the USB_OTG_debug_print branch August 26, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chip: ESP32-S2 Issue is related to support of ESP32-S2 Chip Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Status: Pending Merge Pull Request is ready to be merged
Projects
5 participants