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(UART): ESP32 | ESP32-S2 UART Clock Source #10172

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Aug 15, 2024

Description of Change

Problem detected with ESP32 and ESP32-S2 when the baudrate goes to 460600 bps.

REF_TICK (2MHz) seem not to work properly.
Limiting the use of REF_TICK for up to 205 Kbps.

Tests scenarios

ESP32 / S2.

#include <HardwareSerial.h>

HardwareSerial MySerial(1);
const int MySerialRX = 16;
const int MySerialTX = 17;

uint8_t rBuffer[2048]; 

void setup() 
{
    MySerial.begin(460800, SERIAL_8N1, MySerialRX, MySerialTX);
    Serial.begin(115200);
}

void loop() 
{
    while (MySerial.available() > 0) {
        int s = MySerial.readBytes(rBuffer, sizeof(rBuffer));
          Serial.write(rBuffer, s);
    }
}

Related links

Fix #10161
Fix #10117

Problem detected with ESP32 and ESP32-S2 when the baudrate goes to 460600 bps.

REF_TICK (2MHz) seem not to work properly.
Limiting the use of REF_TICK for up to 205 Kbps.
@SuGlider SuGlider added Chip: ESP32-S2 Issue is related to support of ESP32-S2 Chip Peripheral: UART labels Aug 15, 2024
@SuGlider SuGlider added this to the 3.0.5 milestone Aug 15, 2024
@SuGlider SuGlider self-assigned this Aug 15, 2024
Copy link
Contributor

github-actions bot commented Aug 15, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "fix(uart): clock source":
    • 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).

👋 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.
- 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 d303f25

Copy link
Contributor

Test Results

 56 files   56 suites   4m 57s ⏱️
 21 tests  21 ✅ 0 💤 0 ❌
135 runs  135 ✅ 0 💤 0 ❌

Results for commit d303f25.

Copy link
Contributor

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
ESP32S20⚠️ +40.000.00000.000.00
ESP32C3000.000.00000.000.00
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
ESP320⚠️ +40.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--000000⚠️ +40
BLE/examples/Client00--000000⚠️ +40
BLE/examples/EddystoneTLM_Beacon00--0000--⚠️ +40
BLE/examples/EddystoneURL_Beacon00--0000--⚠️ +40
BLE/examples/Notify00--000000⚠️ +40
BLE/examples/Scan00--000000⚠️ +40
BLE/examples/Server00--000000⚠️ +40
BLE/examples/Server_multiconnect00--000000⚠️ +40
BLE/examples/UART00--000000⚠️ +40
BLE/examples/Write00--000000⚠️ +40
BLE/examples/iBeacon00--000000⚠️ +40
DNSServer/examples/CaptivePortal00000000--00
EEPROM/examples/eeprom_class00⚠️ +40000000⚠️ +40
EEPROM/examples/eeprom_extra00⚠️ +40000000⚠️ +40
EEPROM/examples/eeprom_write00⚠️ +40000000⚠️ +40
ESP32/examples/AnalogOut/LEDCFade00⚠️ +40000000⚠️ +40
ESP32/examples/AnalogOut/LEDCSingleChannel000000000000
ESP32/examples/AnalogOut/LEDCSoftwareFade000000000000
ESP32/examples/AnalogOut/SigmaDelta000000000000
ESP32/examples/AnalogOut/ledcFrequency000000000000
ESP32/examples/AnalogOut/ledcWrite_RGB00⚠️ +40000000⚠️ +40
ESP32/examples/AnalogRead00⚠️ +40000000⚠️ +40
ESP32/examples/AnalogReadContinuous00⚠️ +40000000⚠️ +40
ESP32/examples/ArduinoStackSize00⚠️ +40000000⚠️ +40
ESP32/examples/CI/CIBoardsTest00⚠️ +40000000⚠️ +40
ESP32/examples/Camera/CameraWebServer0000------00
ESP32/examples/ChipID/GetChipID00⚠️ +40000000⚠️ +40
ESP32/examples/DeepSleep/ExternalWakeUp00⚠️ +40------⚠️ +40
ESP32/examples/DeepSleep/TimerWakeUp00⚠️ +400000--⚠️ +40
ESP32/examples/DeepSleep/TouchWakeUp00⚠️ +40------⚠️ +40
ESP32/examples/FreeRTOS/BasicMultiThreading00⚠️ +40000000⚠️ +40
ESP32/examples/FreeRTOS/Mutex00⚠️ +40000000⚠️ +40
ESP32/examples/FreeRTOS/Queue00⚠️ +40000000⚠️ +40
ESP32/examples/FreeRTOS/Semaphore00⚠️ +40000000⚠️ +40
ESP32/examples/GPIO/BlinkRGB000000000000
ESP32/examples/GPIO/FunctionalInterrupt00⚠️ +40000000⚠️ +40
ESP32/examples/GPIO/FunctionalInterruptStruct00⚠️ +40000000⚠️ +40
ESP32/examples/GPIO/GPIOInterrupt00⚠️ +40000000⚠️ +40
ESP32/examples/HWCDC_Events00--000000--
ESP32/examples/MacAddress/GetMacAddress00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/Legacy_RMT_Driver_Compatible00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMTCallback00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMTLoopback00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMTReadXJT00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMTWriteNeoPixel00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMT_CPUFreq_Test00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMT_EndOfTransmissionState00⚠️ +40000000⚠️ +40
ESP32/examples/RMT/RMT_LED_Blink00⚠️ +40000000⚠️ +40
ESP32/examples/ResetReason/ResetReason00⚠️ +40000000⚠️ +40
ESP32/examples/ResetReason/ResetReason200⚠️ +40000000⚠️ +40
ESP32/examples/Serial/BaudRateDetect_Demo00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/OnReceiveError_BREAK_Demo00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/OnReceive_Demo00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/RS485_Echo_Demo00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/RxFIFOFull_Demo00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/RxTimeout_Demo00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/Serial_All_CPU_Freqs00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/Serial_STD_Func_OnReceive00⚠️ +40000000⚠️ +40
ESP32/examples/Serial/onReceiveExample00⚠️ +40000000⚠️ +40
ESP32/examples/TWAI/TWAIreceive00⚠️ +40000000⚠️ +40
ESP32/examples/TWAI/TWAItransmit00⚠️ +40000000⚠️ +40
ESP32/examples/Template/ExampleTemplate000000000000
ESP32/examples/Time/SimpleTime00000000--00
ESP32/examples/Timer/RepeatTimer00⚠️ +40000000⚠️ +40
ESP32/examples/Timer/WatchdogTimer00⚠️ +40000000⚠️ +40
ESP32/examples/Touch/TouchButtonV200⚠️ +40--------
ESP32/examples/Touch/TouchInterrupt00⚠️ +40------⚠️ +40
ESP32/examples/Touch/TouchRead00⚠️ +40------⚠️ +40
ESP32/examples/Utilities/HEXBuilder00⚠️ +40000000⚠️ +40
ESP32/examples/Utilities/MD5Builder00⚠️ +40000000⚠️ +40
ESP32/examples/Utilities/SHA1Builder00⚠️ +40000000⚠️ +40
ESP_I2S/examples/ES8388_loopback00⚠️ +40000000⚠️ +40
ESP_I2S/examples/Record_to_WAV00--------⚠️ +40
ESP_I2S/examples/Simple_tone00⚠️ +40000000⚠️ +40
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_Test00⚠️ +40000000⚠️ +40
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_test00⚠️ +40000000⚠️ +40
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/Prefs2Struct00⚠️ +40000000⚠️ +40
Preferences/examples/StartCounter00⚠️ +40000000⚠️ +40
RainMaker/examples/RMakerCustom00000000--00
RainMaker/examples/RMakerCustomAirCooler00000000--00
RainMaker/examples/RMakerSonoffDualR300000000--00
RainMaker/examples/RMakerSwitch00000000--00
SD/examples/SD_Test00⚠️ +40000000⚠️ +40
SD/examples/SD_time00000000--00
SD_MMC/examples/SD2USBMSC00----------
SD_MMC/examples/SDMMC_Test00--------⚠️ +40
SD_MMC/examples/SDMMC_time00--------00
SPI/examples/SPI_Multiple_Buses0000------00
SPIFFS/examples/SPIFFS_Test00⚠️ +40000000⚠️ +40
SPIFFS/examples/SPIFFS_time00000000--00
SimpleBLE/examples/SimpleBleDevice00----0000⚠️ +40
TFLiteMicro/examples/hello_world000000000000
Ticker/examples/Blinker000000000000
Ticker/examples/TickerBasic000000000000
Ticker/examples/TickerParameter000000000000
USB/examples/CompositeDevice00⚠️ +40--------
USB/examples/ConsumerControl0000--------
USB/examples/CustomHIDDevice00⚠️ +40--------
USB/examples/FirmwareMSC00⚠️ +40--------
USB/examples/Gamepad00⚠️ +40--------
USB/examples/HIDVendor00⚠️ +40--------
USB/examples/Keyboard/KeyboardLogout0000--------
USB/examples/Keyboard/KeyboardMessage0000--------
USB/examples/Keyboard/KeyboardReprogram0000--------
USB/examples/Keyboard/KeyboardSerial00⚠️ +40--------
USB/examples/KeyboardAndMouseControl00⚠️ +40--------
USB/examples/MIDI/MidiController00⚠️ +40--------
USB/examples/MIDI/MidiInterface00⚠️ +40--------
USB/examples/MIDI/MidiMusicBox00⚠️ +40--------
USB/examples/MIDI/ReceiveMidi00⚠️ +40--------
USB/examples/Mouse/ButtonMouseControl0000--------
USB/examples/SystemControl0000--------
USB/examples/USBMSC00⚠️ +40--------
USB/examples/USBSerial00⚠️ +40--------
USB/examples/USBVendor00⚠️ +40--------
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_Update00⚠️ +40000000⚠️ +40
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/UploadHugeFile00⚠️ +400000--⚠️ +40
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/WireMaster00⚠️ +40000000⚠️ +40
Wire/examples/WireScan00⚠️ +40000000⚠️ +40
Wire/examples/WireSlave00⚠️ +40000000⚠️ +40
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----------⚠️ +40
BluetoothSerial/examples/GetLocalMAC----------⚠️ +40
BluetoothSerial/examples/SerialToSerialBT----------⚠️ +40
BluetoothSerial/examples/SerialToSerialBTM----------⚠️ +40
BluetoothSerial/examples/SerialToSerialBT_Legacy----------00
BluetoothSerial/examples/SerialToSerialBT_SSP----------⚠️ +40
BluetoothSerial/examples/bt_classic_device_discovery----------⚠️ +40
BluetoothSerial/examples/bt_remove_paired_devices----------⚠️ +40
ESP32/examples/DeepSleep/SmoothBlink_ULP_Code----------⚠️ +40
ESP32/examples/Touch/TouchButton----------⚠️ +40
Ethernet/examples/ETH_LAN8720----------00
Ethernet/examples/ETH_TLK110----------00

@me-no-dev me-no-dev added the Status: Pending Merge Pull Request is ready to be merged label Aug 16, 2024
@me-no-dev me-no-dev merged commit 2a97175 into master Aug 16, 2024
74 of 82 checks passed
@me-no-dev me-no-dev deleted the uart_clock_source branch August 16, 2024 13: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 Peripheral: UART Status: Pending Merge Pull Request is ready to be merged
Projects
Development

Successfully merging this pull request may close these issues.

HardwareSerial at 460800 BAUD not working Garbage on HardwareSerial ESP32S2 at 3.0.4
3 participants