diff --git a/.github/ISSUE_TEMPLATE/Issue-report.yml b/.github/ISSUE_TEMPLATE/Issue-report.yml index 0e9c25621c8..1c7c1fe4c7c 100644 --- a/.github/ISSUE_TEMPLATE/Issue-report.yml +++ b/.github/ISSUE_TEMPLATE/Issue-report.yml @@ -41,6 +41,7 @@ body: options: - latest master (checkout manually) - latest development Release Candidate (RC-X) + - v2.0.5 - v2.0.4 - v2.0.3 - v2.0.2 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6110efda7e8..3c76df5f741 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,10 +22,10 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Build diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 6f9cbb2e2ab..cea5e1eac86 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -16,7 +16,7 @@ jobs: name: Build GitHub Pages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Copy Files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index 600e932d82f..1aafdcaca97 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -25,7 +25,7 @@ jobs: chunks: ${{ steps.gen-chunks.outputs.chunks }} steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate Chunks matrix id: gen-chunks @@ -52,7 +52,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build sketches run: | @@ -84,7 +84,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download ${{matrix.chip}}-${{matrix.chunks}} artifacts uses: actions/download-artifact@v2 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c2fe46df8c7..fecf743dfc9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -18,7 +18,7 @@ jobs: name: Check cmake file runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: bash ./.github/scripts/check-cmakelists.sh # Ubuntu @@ -30,13 +30,13 @@ jobs: chunk: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Cache tools id: cache-linux - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ./tools/dist @@ -56,8 +56,8 @@ jobs: os: [windows-latest, macOS-latest] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Build Sketches @@ -72,8 +72,8 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Build Sketches @@ -93,7 +93,7 @@ jobs: container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Check out arduino-esp32 as a component - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive path: components/arduino-esp32 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da6a8e4ce2f..c5555027bf0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Build Release diff --git a/.github/workflows/upload-idf-component.yml b/.github/workflows/upload-idf-component.yml index b68e504fca0..8fcebf00204 100644 --- a/.github/workflows/upload-idf-component.yml +++ b/.github/workflows/upload-idf-component.yml @@ -7,13 +7,14 @@ jobs: upload_components: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: "recursive" - name: Upload components to the component registry - uses: espressif/github-actions/upload_components@master + uses: espressif/upload-components-ci-action@v1 with: name: arduino-esp32 + version: ${{ github.ref_name }} namespace: espressif api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} diff --git a/boards.txt b/boards.txt index bc59eab7c60..2edd8d6ce94 100644 --- a/boards.txt +++ b/boards.txt @@ -4831,6 +4831,215 @@ nina_w10.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +nora_w10.name=u-blox NORA-W10 series (ESP32-S3) +nora_w10.vid.0=0x303a +nora_w10.pid.0=0x1001 + +nora_w10.bootloader.tool=esptool_py +nora_w10.bootloader.tool.default=esptool_py + +nora_w10.upload.tool=esptool_py +nora_w10.upload.tool.default=esptool_py +nora_w10.upload.tool.network=esp_ota + +nora_w10.upload.maximum_size=1310720 +nora_w10.upload.maximum_data_size=327680 +nora_w10.upload.flags= +nora_w10.upload.extra_flags= +nora_w10.upload.use_1200bps_touch=false +nora_w10.upload.wait_for_upload_port=false + +nora_w10.serial.disableDTR=false +nora_w10.serial.disableRTS=false + +nora_w10.build.tarch=xtensa +nora_w10.build.bootloader_addr=0x0 +nora_w10.build.target=esp32s3 +nora_w10.build.mcu=esp32s3 +nora_w10.build.core=esp32 +nora_w10.build.variant=nora_w10 +nora_w10.build.board=UBLOX_NORA_W10 + +nora_w10.build.usb_mode=1 +nora_w10.build.cdc_on_boot=0 +nora_w10.build.msc_on_boot=0 +nora_w10.build.dfu_on_boot=0 +nora_w10.build.f_cpu=240000000L +nora_w10.build.flash_size=4MB +nora_w10.build.flash_freq=80m +nora_w10.build.flash_mode=dio +nora_w10.build.boot=qio +nora_w10.build.boot_freq=80m +nora_w10.build.partitions=default +nora_w10.build.defines= +nora_w10.build.loop_core= +nora_w10.build.event_core= +nora_w10.build.psram_type=qspi +nora_w10.build.memory_type={build.boot}_{build.psram_type} + +nora_w10.menu.PSRAM.disabled=Disabled +nora_w10.menu.PSRAM.disabled.build.defines= +nora_w10.menu.PSRAM.disabled.build.psram_type=qspi +nora_w10.menu.PSRAM.enabled=QSPI PSRAM +nora_w10.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +nora_w10.menu.PSRAM.enabled.build.psram_type=qspi +nora_w10.menu.PSRAM.opi=OPI PSRAM +nora_w10.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +nora_w10.menu.PSRAM.opi.build.psram_type=opi + +nora_w10.menu.FlashMode.qio=QIO 80MHz +nora_w10.menu.FlashMode.qio.build.flash_mode=dio +nora_w10.menu.FlashMode.qio.build.boot=qio +nora_w10.menu.FlashMode.qio.build.boot_freq=80m +nora_w10.menu.FlashMode.qio.build.flash_freq=80m +nora_w10.menu.FlashMode.qio120=QIO 120MHz +nora_w10.menu.FlashMode.qio120.build.flash_mode=dio +nora_w10.menu.FlashMode.qio120.build.boot=qio +nora_w10.menu.FlashMode.qio120.build.boot_freq=120m +nora_w10.menu.FlashMode.qio120.build.flash_freq=80m +nora_w10.menu.FlashMode.dio=DIO 80MHz +nora_w10.menu.FlashMode.dio.build.flash_mode=dio +nora_w10.menu.FlashMode.dio.build.boot=dio +nora_w10.menu.FlashMode.dio.build.boot_freq=80m +nora_w10.menu.FlashMode.dio.build.flash_freq=80m +nora_w10.menu.FlashMode.opi=OPI 80MHz +nora_w10.menu.FlashMode.opi.build.flash_mode=dout +nora_w10.menu.FlashMode.opi.build.boot=opi +nora_w10.menu.FlashMode.opi.build.boot_freq=80m +nora_w10.menu.FlashMode.opi.build.flash_freq=80m + +nora_w10.menu.FlashSize.4M=4MB (32Mb) +nora_w10.menu.FlashSize.4M.build.flash_size=4MB +nora_w10.menu.FlashSize.8M=8MB (64Mb) +nora_w10.menu.FlashSize.8M.build.flash_size=8MB +nora_w10.menu.FlashSize.8M.build.partitions=default_8MB +#nora_w10.menu.FlashSize.16M=16MB (128Mb) +#nora_w10.menu.FlashSize.16M.build.flash_size=16MB +#nora_w10.menu.FlashSize.32M=32MB (256Mb) +#nora_w10.menu.FlashSize.32M.build.flash_size=32MB + +nora_w10.menu.LoopCore.1=Core 1 +nora_w10.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +nora_w10.menu.LoopCore.0=Core 0 +nora_w10.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +nora_w10.menu.EventsCore.1=Core 1 +nora_w10.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +nora_w10.menu.EventsCore.0=Core 0 +nora_w10.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +nora_w10.menu.USBMode.hwcdc=Hardware CDC and JTAG +nora_w10.menu.USBMode.hwcdc.build.usb_mode=1 +nora_w10.menu.USBMode.default=USB-OTG (TinyUSB) +nora_w10.menu.USBMode.default.build.usb_mode=0 + +nora_w10.menu.CDCOnBoot.default=Disabled +nora_w10.menu.CDCOnBoot.default.build.cdc_on_boot=0 +nora_w10.menu.CDCOnBoot.cdc=Enabled +nora_w10.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 + +nora_w10.menu.MSCOnBoot.default=Disabled +nora_w10.menu.MSCOnBoot.default.build.msc_on_boot=0 +nora_w10.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +nora_w10.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +nora_w10.menu.DFUOnBoot.default=Disabled +nora_w10.menu.DFUOnBoot.default.build.dfu_on_boot=0 +nora_w10.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +nora_w10.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +nora_w10.menu.UploadMode.default=UART0 / Hardware CDC +nora_w10.menu.UploadMode.default.upload.use_1200bps_touch=false +nora_w10.menu.UploadMode.default.upload.wait_for_upload_port=false +nora_w10.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +nora_w10.menu.UploadMode.cdc.upload.use_1200bps_touch=true +nora_w10.menu.UploadMode.cdc.upload.wait_for_upload_port=true + +nora_w10.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +nora_w10.menu.PartitionScheme.default.build.partitions=default +nora_w10.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +nora_w10.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +nora_w10.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +nora_w10.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +nora_w10.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +nora_w10.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +nora_w10.menu.PartitionScheme.minimal.build.partitions=minimal +nora_w10.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +nora_w10.menu.PartitionScheme.no_ota.build.partitions=no_ota +nora_w10.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +nora_w10.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +nora_w10.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +nora_w10.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +nora_w10.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +nora_w10.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +nora_w10.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +nora_w10.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +nora_w10.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +nora_w10.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +nora_w10.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +nora_w10.menu.PartitionScheme.huge_app.build.partitions=huge_app +nora_w10.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +nora_w10.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +nora_w10.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +nora_w10.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +#nora_w10.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +#nora_w10.menu.PartitionScheme.fatflash.build.partitions=ffat +#nora_w10.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +#nora_w10.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) +#nora_w10.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +#nora_w10.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +nora_w10.menu.PartitionScheme.rainmaker=RainMaker +nora_w10.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +nora_w10.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +nora_w10.menu.CPUFreq.240=240MHz (WiFi) +nora_w10.menu.CPUFreq.240.build.f_cpu=240000000L +nora_w10.menu.CPUFreq.160=160MHz (WiFi) +nora_w10.menu.CPUFreq.160.build.f_cpu=160000000L +nora_w10.menu.CPUFreq.80=80MHz (WiFi) +nora_w10.menu.CPUFreq.80.build.f_cpu=80000000L +nora_w10.menu.CPUFreq.40=40MHz +nora_w10.menu.CPUFreq.40.build.f_cpu=40000000L +nora_w10.menu.CPUFreq.20=20MHz +nora_w10.menu.CPUFreq.20.build.f_cpu=20000000L +nora_w10.menu.CPUFreq.10=10MHz +nora_w10.menu.CPUFreq.10.build.f_cpu=10000000L + +nora_w10.menu.UploadSpeed.921600=921600 +nora_w10.menu.UploadSpeed.921600.upload.speed=921600 +nora_w10.menu.UploadSpeed.115200=115200 +nora_w10.menu.UploadSpeed.115200.upload.speed=115200 +nora_w10.menu.UploadSpeed.256000.windows=256000 +nora_w10.menu.UploadSpeed.256000.upload.speed=256000 +nora_w10.menu.UploadSpeed.230400.windows.upload.speed=256000 +nora_w10.menu.UploadSpeed.230400=230400 +nora_w10.menu.UploadSpeed.230400.upload.speed=230400 +nora_w10.menu.UploadSpeed.460800.linux=460800 +nora_w10.menu.UploadSpeed.460800.macosx=460800 +nora_w10.menu.UploadSpeed.460800.upload.speed=460800 +nora_w10.menu.UploadSpeed.512000.windows=512000 +nora_w10.menu.UploadSpeed.512000.upload.speed=512000 + +nora_w10.menu.DebugLevel.none=None +nora_w10.menu.DebugLevel.none.build.code_debug=0 +nora_w10.menu.DebugLevel.error=Error +nora_w10.menu.DebugLevel.error.build.code_debug=1 +nora_w10.menu.DebugLevel.warn=Warn +nora_w10.menu.DebugLevel.warn.build.code_debug=2 +nora_w10.menu.DebugLevel.info=Info +nora_w10.menu.DebugLevel.info.build.code_debug=3 +nora_w10.menu.DebugLevel.debug=Debug +nora_w10.menu.DebugLevel.debug.build.code_debug=4 +nora_w10.menu.DebugLevel.verbose=Verbose +nora_w10.menu.DebugLevel.verbose.build.code_debug=5 + +nora_w10.menu.EraseFlash.none=Disabled +nora_w10.menu.EraseFlash.none.upload.erase_cmd= +nora_w10.menu.EraseFlash.all=Enabled +nora_w10.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + widora-air.name=Widora AIR widora-air.bootloader.tool=esptool_py @@ -9264,6 +9473,118 @@ adafruit_qtpy_esp32s3_nopsram.menu.EraseFlash.none.upload.erase_cmd= adafruit_qtpy_esp32s3_nopsram.menu.EraseFlash.all=Enabled adafruit_qtpy_esp32s3_nopsram.menu.EraseFlash.all.upload.erase_cmd=-e +############################################################## +# Adafruit ItsyBitsy ESP32 + +adafruit_itsybitsy_esp32.name=Adafruit ItsyBitsy ESP32 + +adafruit_itsybitsy_esp32.bootloader.tool=esptool_py +adafruit_itsybitsy_esp32.bootloader.tool.default=esptool_py + +adafruit_itsybitsy_esp32.upload.tool=esptool_py +adafruit_itsybitsy_esp32.upload.tool.default=esptool_py +adafruit_itsybitsy_esp32.upload.tool.network=esp_ota + +adafruit_itsybitsy_esp32.upload.maximum_size=1310720 +adafruit_itsybitsy_esp32.upload.maximum_data_size=327680 +adafruit_itsybitsy_esp32.upload.flags= +adafruit_itsybitsy_esp32.upload.extra_flags= + +adafruit_itsybitsy_esp32.serial.disableDTR=true +adafruit_itsybitsy_esp32.serial.disableRTS=true + +adafruit_itsybitsy_esp32.build.tarch=xtensa +adafruit_itsybitsy_esp32.build.bootloader_addr=0x1000 +adafruit_itsybitsy_esp32.build.target=esp32 +adafruit_itsybitsy_esp32.build.mcu=esp32 +adafruit_itsybitsy_esp32.build.core=esp32 +adafruit_itsybitsy_esp32.build.variant=adafruit_itsybitsy_esp32 +adafruit_itsybitsy_esp32.build.board=ADAFRUIT_ITSYBITSY_ESP32 + +adafruit_itsybitsy_esp32.build.f_cpu=240000000L +adafruit_itsybitsy_esp32.build.flash_size=8MB +adafruit_itsybitsy_esp32.build.flash_freq=80m +adafruit_itsybitsy_esp32.build.flash_mode=dio +adafruit_itsybitsy_esp32.build.boot=dio +adafruit_itsybitsy_esp32.build.partitions=default +adafruit_itsybitsy_esp32.build.defines= +adafruit_itsybitsy_esp32.build.loop_core= +adafruit_itsybitsy_esp32.build.event_core= + +adafruit_itsybitsy_esp32.menu.LoopCore.1=Core 1 +adafruit_itsybitsy_esp32.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +adafruit_itsybitsy_esp32.menu.LoopCore.0=Core 0 +adafruit_itsybitsy_esp32.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +adafruit_itsybitsy_esp32.menu.EventsCore.1=Core 1 +adafruit_itsybitsy_esp32.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +adafruit_itsybitsy_esp32.menu.EventsCore.0=Core 0 +adafruit_itsybitsy_esp32.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +adafruit_itsybitsy_esp32.menu.PSRAM.enabled=Enabled +adafruit_itsybitsy_esp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw +adafruit_itsybitsy_esp32.menu.PSRAM.disabled=Disabled +adafruit_itsybitsy_esp32.menu.PSRAM.disabled.build.defines= + +adafruit_itsybitsy_esp32.menu.PartitionScheme.default_8MB=Default (3MB APP/1.5MB SPIFFS) +adafruit_itsybitsy_esp32.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +adafruit_itsybitsy_esp32.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 + +adafruit_itsybitsy_esp32.menu.CPUFreq.240=240MHz (WiFi/BT) +adafruit_itsybitsy_esp32.menu.CPUFreq.240.build.f_cpu=240000000L +adafruit_itsybitsy_esp32.menu.CPUFreq.160=160MHz (WiFi/BT) +adafruit_itsybitsy_esp32.menu.CPUFreq.160.build.f_cpu=160000000L +adafruit_itsybitsy_esp32.menu.CPUFreq.80=80MHz (WiFi/BT) +adafruit_itsybitsy_esp32.menu.CPUFreq.80.build.f_cpu=80000000L +adafruit_itsybitsy_esp32.menu.CPUFreq.40=40MHz +adafruit_itsybitsy_esp32.menu.CPUFreq.40.build.f_cpu=40000000L +adafruit_itsybitsy_esp32.menu.CPUFreq.20=20MHz +adafruit_itsybitsy_esp32.menu.CPUFreq.20.build.f_cpu=20000000L +adafruit_itsybitsy_esp32.menu.CPUFreq.10=10MHz +adafruit_itsybitsy_esp32.menu.CPUFreq.10.build.f_cpu=10000000L + +adafruit_itsybitsy_esp32.menu.FlashFreq.80=80MHz +adafruit_itsybitsy_esp32.menu.FlashFreq.80.build.flash_freq=80m +adafruit_itsybitsy_esp32.menu.FlashFreq.40=40MHz +adafruit_itsybitsy_esp32.menu.FlashFreq.40.build.flash_freq=40m + +adafruit_itsybitsy_esp32.menu.FlashSize.8M=8MB (64Mb) +adafruit_itsybitsy_esp32.menu.FlashSize.8M.build.flash_size=8MB + +adafruit_itsybitsy_esp32.menu.UploadSpeed.921600=921600 +adafruit_itsybitsy_esp32.menu.UploadSpeed.921600.upload.speed=921600 +adafruit_itsybitsy_esp32.menu.UploadSpeed.115200=115200 +adafruit_itsybitsy_esp32.menu.UploadSpeed.115200.upload.speed=115200 +adafruit_itsybitsy_esp32.menu.UploadSpeed.256000.windows=256000 +adafruit_itsybitsy_esp32.menu.UploadSpeed.256000.upload.speed=256000 +adafruit_itsybitsy_esp32.menu.UploadSpeed.230400.windows.upload.speed=256000 +adafruit_itsybitsy_esp32.menu.UploadSpeed.230400=230400 +adafruit_itsybitsy_esp32.menu.UploadSpeed.230400.upload.speed=230400 +adafruit_itsybitsy_esp32.menu.UploadSpeed.460800.linux=460800 +adafruit_itsybitsy_esp32.menu.UploadSpeed.460800.macosx=460800 +adafruit_itsybitsy_esp32.menu.UploadSpeed.460800.upload.speed=460800 +adafruit_itsybitsy_esp32.menu.UploadSpeed.512000.windows=512000 +adafruit_itsybitsy_esp32.menu.UploadSpeed.512000.upload.speed=512000 + +adafruit_itsybitsy_esp32.menu.DebugLevel.none=None +adafruit_itsybitsy_esp32.menu.DebugLevel.none.build.code_debug=0 +adafruit_itsybitsy_esp32.menu.DebugLevel.error=Error +adafruit_itsybitsy_esp32.menu.DebugLevel.error.build.code_debug=1 +adafruit_itsybitsy_esp32.menu.DebugLevel.warn=Warn +adafruit_itsybitsy_esp32.menu.DebugLevel.warn.build.code_debug=2 +adafruit_itsybitsy_esp32.menu.DebugLevel.info=Info +adafruit_itsybitsy_esp32.menu.DebugLevel.info.build.code_debug=3 +adafruit_itsybitsy_esp32.menu.DebugLevel.debug=Debug +adafruit_itsybitsy_esp32.menu.DebugLevel.debug.build.code_debug=4 +adafruit_itsybitsy_esp32.menu.DebugLevel.verbose=Verbose +adafruit_itsybitsy_esp32.menu.DebugLevel.verbose.build.code_debug=5 + +adafruit_itsybitsy_esp32.menu.EraseFlash.none=Disabled +adafruit_itsybitsy_esp32.menu.EraseFlash.none.upload.erase_cmd= +adafruit_itsybitsy_esp32.menu.EraseFlash.all=Enabled +adafruit_itsybitsy_esp32.menu.EraseFlash.all.upload.erase_cmd=-e + + ############################################################## nodemcu-32s.name=NodeMCU-32S @@ -11095,6 +11416,31 @@ heltec_wifi_lora_32.build.boot=dio heltec_wifi_lora_32.build.partitions=default heltec_wifi_lora_32.build.defines=-D{build.band} -DLoRaWAN_DEBUG_LEVEL={build.LoRaWanDebugLevel} -DACTIVE_REGION=LORAMAC_{build.band} {build.psram} +heltec_wifi_lora_32.menu.PartitionScheme.default=Regular 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +heltec_wifi_lora_32.menu.PartitionScheme.default.build.partitions=default +heltec_wifi_lora_32.menu.PartitionScheme.defaultffat=Regular 4MB with ffat (1.2MB APP/1.5MB FATFS) +heltec_wifi_lora_32.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +heltec_wifi_lora_32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +heltec_wifi_lora_32.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +heltec_wifi_lora_32.menu.PartitionScheme.minimal.build.partitions=minimal +heltec_wifi_lora_32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +heltec_wifi_lora_32.menu.PartitionScheme.huge_app.build.partitions=huge_app +heltec_wifi_lora_32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +heltec_wifi_lora_32.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +heltec_wifi_lora_32.menu.PartitionScheme.no_ota.build.partitions=no_ota +heltec_wifi_lora_32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +heltec_wifi_lora_32.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +heltec_wifi_lora_32.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +heltec_wifi_lora_32.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +heltec_wifi_lora_32.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +heltec_wifi_lora_32.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +heltec_wifi_lora_32.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +heltec_wifi_lora_32.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +heltec_wifi_lora_32.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +heltec_wifi_lora_32.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 + heltec_wifi_lora_32.menu.PSRAM.disabled=Disabled heltec_wifi_lora_32.menu.PSRAM.disabled.build.psram= heltec_wifi_lora_32.menu.PSRAM.disabled.build.extra_libs= @@ -12089,6 +12435,215 @@ bpi-bit.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +bpi_leaf_s3.name=BPI-Leaf-S3 +bpi_leaf_s3.vid.0=0x303a +bpi_leaf_s3.pid.0=0x80df + +bpi_leaf_s3.bootloader.tool=esptool_py +bpi_leaf_s3.bootloader.tool.default=esptool_py + +bpi_leaf_s3.upload.tool=esptool_py +bpi_leaf_s3.upload.tool.default=esptool_py +bpi_leaf_s3.upload.tool.network=esp_ota + +bpi_leaf_s3.upload.maximum_size=1310720 +bpi_leaf_s3.upload.maximum_data_size=327680 +bpi_leaf_s3.upload.flags= +bpi_leaf_s3.upload.extra_flags= +bpi_leaf_s3.upload.use_1200bps_touch=false +bpi_leaf_s3.upload.wait_for_upload_port=false + +bpi_leaf_s3.serial.disableDTR=false +bpi_leaf_s3.serial.disableRTS=false + +bpi_leaf_s3.build.tarch=xtensa +bpi_leaf_s3.build.bootloader_addr=0x0 +bpi_leaf_s3.build.target=esp32s3 +bpi_leaf_s3.build.mcu=esp32s3 +bpi_leaf_s3.build.core=esp32 +bpi_leaf_s3.build.variant=bpi_leaf_s3 +bpi_leaf_s3.build.board=BPI_LEAF_S3 + +bpi_leaf_s3.build.usb_mode=1 +bpi_leaf_s3.build.cdc_on_boot=0 +bpi_leaf_s3.build.msc_on_boot=0 +bpi_leaf_s3.build.dfu_on_boot=0 +bpi_leaf_s3.build.f_cpu=240000000L +bpi_leaf_s3.build.flash_size=8MB +bpi_leaf_s3.build.flash_freq=80m +bpi_leaf_s3.build.flash_mode=dio +bpi_leaf_s3.build.boot=qio +bpi_leaf_s3.build.boot_freq=80m +bpi_leaf_s3.build.partitions=default +bpi_leaf_s3.build.defines= +bpi_leaf_s3.build.loop_core= +bpi_leaf_s3.build.event_core= +bpi_leaf_s3.build.psram_type=qspi +bpi_leaf_s3.build.memory_type={build.boot}_{build.psram_type} + +bpi_leaf_s3.menu.PSRAM.enabled=QSPI PSRAM +bpi_leaf_s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +bpi_leaf_s3.menu.PSRAM.enabled.build.psram_type=qspi +bpi_leaf_s3.menu.PSRAM.disabled=Disabled +bpi_leaf_s3.menu.PSRAM.disabled.build.defines= +bpi_leaf_s3.menu.PSRAM.disabled.build.psram_type=qspi +bpi_leaf_s3.menu.PSRAM.opi=OPI PSRAM +bpi_leaf_s3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +bpi_leaf_s3.menu.PSRAM.opi.build.psram_type=opi + +bpi_leaf_s3.menu.FlashMode.qio=QIO 80MHz +bpi_leaf_s3.menu.FlashMode.qio.build.flash_mode=dio +bpi_leaf_s3.menu.FlashMode.qio.build.boot=qio +bpi_leaf_s3.menu.FlashMode.qio.build.boot_freq=80m +bpi_leaf_s3.menu.FlashMode.qio.build.flash_freq=80m +bpi_leaf_s3.menu.FlashMode.qio120=QIO 120MHz +bpi_leaf_s3.menu.FlashMode.qio120.build.flash_mode=dio +bpi_leaf_s3.menu.FlashMode.qio120.build.boot=qio +bpi_leaf_s3.menu.FlashMode.qio120.build.boot_freq=120m +bpi_leaf_s3.menu.FlashMode.qio120.build.flash_freq=80m +bpi_leaf_s3.menu.FlashMode.dio=DIO 80MHz +bpi_leaf_s3.menu.FlashMode.dio.build.flash_mode=dio +bpi_leaf_s3.menu.FlashMode.dio.build.boot=dio +bpi_leaf_s3.menu.FlashMode.dio.build.boot_freq=80m +bpi_leaf_s3.menu.FlashMode.dio.build.flash_freq=80m +bpi_leaf_s3.menu.FlashMode.opi=OPI 80MHz +bpi_leaf_s3.menu.FlashMode.opi.build.flash_mode=dout +bpi_leaf_s3.menu.FlashMode.opi.build.boot=opi +bpi_leaf_s3.menu.FlashMode.opi.build.boot_freq=80m +bpi_leaf_s3.menu.FlashMode.opi.build.flash_freq=80m + +bpi_leaf_s3.menu.FlashSize.8M=8MB (64Mb) +bpi_leaf_s3.menu.FlashSize.8M.build.flash_size=8MB +bpi_leaf_s3.menu.FlashSize.8M.build.partitions=default_8MB +bpi_leaf_s3.menu.FlashSize.4M=4MB (32Mb) +bpi_leaf_s3.menu.FlashSize.4M.build.flash_size=4MB +bpi_leaf_s3.menu.FlashSize.16M=16MB (128Mb) +bpi_leaf_s3.menu.FlashSize.16M.build.flash_size=16MB +#bpi_leaf_s3.menu.FlashSize.32M=32MB (256Mb) +#bpi_leaf_s3.menu.FlashSize.32M.build.flash_size=32MB + +bpi_leaf_s3.menu.LoopCore.1=Core 1 +bpi_leaf_s3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +bpi_leaf_s3.menu.LoopCore.0=Core 0 +bpi_leaf_s3.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +bpi_leaf_s3.menu.EventsCore.1=Core 1 +bpi_leaf_s3.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +bpi_leaf_s3.menu.EventsCore.0=Core 0 +bpi_leaf_s3.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +bpi_leaf_s3.menu.USBMode.default=USB-OTG (TinyUSB) +bpi_leaf_s3.menu.USBMode.default.build.usb_mode=0 +bpi_leaf_s3.menu.USBMode.hwcdc=Hardware CDC and JTAG +bpi_leaf_s3.menu.USBMode.hwcdc.build.usb_mode=1 + +bpi_leaf_s3.menu.CDCOnBoot.cdc=Enabled +bpi_leaf_s3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +bpi_leaf_s3.menu.CDCOnBoot.default=Disabled +bpi_leaf_s3.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +bpi_leaf_s3.menu.MSCOnBoot.default=Disabled +bpi_leaf_s3.menu.MSCOnBoot.default.build.msc_on_boot=0 +bpi_leaf_s3.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +bpi_leaf_s3.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +bpi_leaf_s3.menu.DFUOnBoot.default=Disabled +bpi_leaf_s3.menu.DFUOnBoot.default.build.dfu_on_boot=0 +bpi_leaf_s3.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +bpi_leaf_s3.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +bpi_leaf_s3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +bpi_leaf_s3.menu.UploadMode.cdc.upload.use_1200bps_touch=true +bpi_leaf_s3.menu.UploadMode.cdc.upload.wait_for_upload_port=true +bpi_leaf_s3.menu.UploadMode.default=UART0 / Hardware CDC +bpi_leaf_s3.menu.UploadMode.default.upload.use_1200bps_touch=false +bpi_leaf_s3.menu.UploadMode.default.upload.wait_for_upload_port=false + +bpi_leaf_s3.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +bpi_leaf_s3.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +bpi_leaf_s3.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.default.build.partitions=default +bpi_leaf_s3.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +bpi_leaf_s3.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +bpi_leaf_s3.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.minimal.build.partitions=minimal +bpi_leaf_s3.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.no_ota.build.partitions=no_ota +bpi_leaf_s3.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +bpi_leaf_s3.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +bpi_leaf_s3.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +bpi_leaf_s3.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +bpi_leaf_s3.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +bpi_leaf_s3.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +bpi_leaf_s3.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +bpi_leaf_s3.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +bpi_leaf_s3.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +bpi_leaf_s3.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.huge_app.build.partitions=huge_app +bpi_leaf_s3.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +bpi_leaf_s3.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +bpi_leaf_s3.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +bpi_leaf_s3.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +bpi_leaf_s3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +bpi_leaf_s3.menu.PartitionScheme.fatflash.build.partitions=ffat +bpi_leaf_s3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +bpi_leaf_s3.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +bpi_leaf_s3.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +bpi_leaf_s3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +bpi_leaf_s3.menu.PartitionScheme.rainmaker=RainMaker +bpi_leaf_s3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +bpi_leaf_s3.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +bpi_leaf_s3.menu.CPUFreq.240=240MHz (WiFi) +bpi_leaf_s3.menu.CPUFreq.240.build.f_cpu=240000000L +bpi_leaf_s3.menu.CPUFreq.160=160MHz (WiFi) +bpi_leaf_s3.menu.CPUFreq.160.build.f_cpu=160000000L +bpi_leaf_s3.menu.CPUFreq.80=80MHz (WiFi) +bpi_leaf_s3.menu.CPUFreq.80.build.f_cpu=80000000L +bpi_leaf_s3.menu.CPUFreq.40=40MHz +bpi_leaf_s3.menu.CPUFreq.40.build.f_cpu=40000000L +bpi_leaf_s3.menu.CPUFreq.20=20MHz +bpi_leaf_s3.menu.CPUFreq.20.build.f_cpu=20000000L +bpi_leaf_s3.menu.CPUFreq.10=10MHz +bpi_leaf_s3.menu.CPUFreq.10.build.f_cpu=10000000L + +bpi_leaf_s3.menu.UploadSpeed.921600=921600 +bpi_leaf_s3.menu.UploadSpeed.921600.upload.speed=921600 +bpi_leaf_s3.menu.UploadSpeed.115200=115200 +bpi_leaf_s3.menu.UploadSpeed.115200.upload.speed=115200 +bpi_leaf_s3.menu.UploadSpeed.256000.windows=256000 +bpi_leaf_s3.menu.UploadSpeed.256000.upload.speed=256000 +bpi_leaf_s3.menu.UploadSpeed.230400.windows.upload.speed=256000 +bpi_leaf_s3.menu.UploadSpeed.230400=230400 +bpi_leaf_s3.menu.UploadSpeed.230400.upload.speed=230400 +bpi_leaf_s3.menu.UploadSpeed.460800.linux=460800 +bpi_leaf_s3.menu.UploadSpeed.460800.macosx=460800 +bpi_leaf_s3.menu.UploadSpeed.460800.upload.speed=460800 +bpi_leaf_s3.menu.UploadSpeed.512000.windows=512000 +bpi_leaf_s3.menu.UploadSpeed.512000.upload.speed=512000 + +bpi_leaf_s3.menu.DebugLevel.none=None +bpi_leaf_s3.menu.DebugLevel.none.build.code_debug=0 +bpi_leaf_s3.menu.DebugLevel.error=Error +bpi_leaf_s3.menu.DebugLevel.error.build.code_debug=1 +bpi_leaf_s3.menu.DebugLevel.warn=Warn +bpi_leaf_s3.menu.DebugLevel.warn.build.code_debug=2 +bpi_leaf_s3.menu.DebugLevel.info=Info +bpi_leaf_s3.menu.DebugLevel.info.build.code_debug=3 +bpi_leaf_s3.menu.DebugLevel.debug=Debug +bpi_leaf_s3.menu.DebugLevel.debug.build.code_debug=4 +bpi_leaf_s3.menu.DebugLevel.verbose=Verbose +bpi_leaf_s3.menu.DebugLevel.verbose.build.code_debug=5 + +bpi_leaf_s3.menu.EraseFlash.none=Disabled +bpi_leaf_s3.menu.EraseFlash.none.upload.erase_cmd= +bpi_leaf_s3.menu.EraseFlash.all=Enabled +bpi_leaf_s3.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + wesp32.name=Silicognition wESP32 wesp32.bootloader.tool=esptool_py @@ -12186,6 +12741,17 @@ t-beam.build.core=esp32 t-beam.build.variant=tbeam t-beam.build.board=TBeam +t-beam.menu.Revision.Radio_SX1262=Radio-SX1262 +t-beam.menu.Revision.Radio_SX1262.build.board=TBEAM_USE_RADIO_SX1262 +t-beam.menu.Revision.Radio_SX1276=Radio-SX1276 +t-beam.menu.Revision.Radio_SX1276.build.board=TBEAM_USE_RADIO_SX1276 +t-beam.menu.Revision.Radio_SX1278=Radio-SX1278 +t-beam.menu.Revision.Radio_SX1278.build.board=TBEAM_USE_RADIO_SX1278 +t-beam.menu.Revision.Radio_SX1280=Radio-SX1280 +t-beam.menu.Revision.Radio_SX1280.build.board=TBEAM_USE_RADIO_SX1280 +t-beam.menu.Revision.Radio_SX1268=Radio-SX1268 +t-beam.menu.Revision.Radio_SX1268.build.board=TBEAM_USE_RADIO_SX1268 + t-beam.build.f_cpu=240000000L t-beam.build.flash_mode=dio t-beam.build.flash_size=4MB @@ -14287,6 +14853,370 @@ wifiduino32.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +wifiduino32c3.name=WiFiduinoV2 +wifiduino32c3.vid.0=0x303a +wifiduino32c3.pid.0=0x1001 + +wifiduino32c3.bootloader.tool=esptool_py +wifiduino32c3.bootloader.tool.default=esptool_py + +wifiduino32c3.upload.tool=esptool_py +wifiduino32c3.upload.tool.default=esptool_py +wifiduino32c3.upload.tool.network=esp_ota + +wifiduino32c3.upload.maximum_size=1310720 +wifiduino32c3.upload.maximum_data_size=327680 +wifiduino32c3.upload.flags= +wifiduino32c3.upload.extra_flags= +wifiduino32c3.upload.use_1200bps_touch=false +wifiduino32c3.upload.wait_for_upload_port=false + +wifiduino32c3.serial.disableDTR=false +wifiduino32c3.serial.disableRTS=false + +wifiduino32c3.build.tarch=riscv32 +wifiduino32c3.build.target=esp +wifiduino32c3.build.mcu=esp32c3 +wifiduino32c3.build.core=esp32 +wifiduino32c3.build.variant=wifiduinov2 +wifiduino32c3.build.board=WiFiduinoV2 +wifiduino32c3.build.bootloader_addr=0x0 + +wifiduino32c3.build.cdc_on_boot=0 +wifiduino32c3.build.f_cpu=160000000L +wifiduino32c3.build.flash_size=4MB +wifiduino32c3.build.flash_freq=80m +wifiduino32c3.build.flash_mode=qio +wifiduino32c3.build.boot=qio +wifiduino32c3.build.partitions=default +wifiduino32c3.build.defines= + +wifiduino32c3.menu.CDCOnBoot.default=Disabled +wifiduino32c3.menu.CDCOnBoot.default.build.cdc_on_boot=0 +wifiduino32c3.menu.CDCOnBoot.cdc=Enabled +wifiduino32c3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 + +wifiduino32c3.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +wifiduino32c3.menu.PartitionScheme.default.build.partitions=default +wifiduino32c3.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +wifiduino32c3.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +wifiduino32c3.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +wifiduino32c3.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +wifiduino32c3.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +wifiduino32c3.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +wifiduino32c3.menu.PartitionScheme.minimal.build.partitions=minimal +wifiduino32c3.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +wifiduino32c3.menu.PartitionScheme.no_ota.build.partitions=no_ota +wifiduino32c3.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +wifiduino32c3.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +wifiduino32c3.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +wifiduino32c3.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +wifiduino32c3.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +wifiduino32c3.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +wifiduino32c3.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +wifiduino32c3.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +wifiduino32c3.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +wifiduino32c3.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +wifiduino32c3.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +wifiduino32c3.menu.PartitionScheme.huge_app.build.partitions=huge_app +wifiduino32c3.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +wifiduino32c3.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +wifiduino32c3.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +wifiduino32c3.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +wifiduino32c3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +wifiduino32c3.menu.PartitionScheme.fatflash.build.partitions=ffat +wifiduino32c3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +wifiduino32c3.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +wifiduino32c3.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +wifiduino32c3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +wifiduino32c3.menu.PartitionScheme.rainmaker=RainMaker +wifiduino32c3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +wifiduino32c3.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +wifiduino32c3.menu.CPUFreq.160=160MHz (WiFi) +wifiduino32c3.menu.CPUFreq.160.build.f_cpu=160000000L +wifiduino32c3.menu.CPUFreq.80=80MHz (WiFi) +wifiduino32c3.menu.CPUFreq.80.build.f_cpu=80000000L +wifiduino32c3.menu.CPUFreq.40=40MHz +wifiduino32c3.menu.CPUFreq.40.build.f_cpu=40000000L +wifiduino32c3.menu.CPUFreq.20=20MHz +wifiduino32c3.menu.CPUFreq.20.build.f_cpu=20000000L +wifiduino32c3.menu.CPUFreq.10=10MHz +wifiduino32c3.menu.CPUFreq.10.build.f_cpu=10000000L + +wifiduino32c3.menu.FlashMode.qio=QIO +wifiduino32c3.menu.FlashMode.qio.build.flash_mode=dio +wifiduino32c3.menu.FlashMode.qio.build.boot=qio +wifiduino32c3.menu.FlashMode.dio=DIO +wifiduino32c3.menu.FlashMode.dio.build.flash_mode=dio +wifiduino32c3.menu.FlashMode.dio.build.boot=dio +wifiduino32c3.menu.FlashMode.qout=QOUT +wifiduino32c3.menu.FlashMode.qout.build.flash_mode=dout +wifiduino32c3.menu.FlashMode.qout.build.boot=qout +wifiduino32c3.menu.FlashMode.dout=DOUT +wifiduino32c3.menu.FlashMode.dout.build.flash_mode=dout +wifiduino32c3.menu.FlashMode.dout.build.boot=dout + +wifiduino32c3.menu.FlashFreq.80=80MHz +wifiduino32c3.menu.FlashFreq.80.build.flash_freq=80m +wifiduino32c3.menu.FlashFreq.40=40MHz +wifiduino32c3.menu.FlashFreq.40.build.flash_freq=40m + +wifiduino32c3.menu.FlashSize.4M=4MB (32Mb) +wifiduino32c3.menu.FlashSize.4M.build.flash_size=4MB +wifiduino32c3.menu.FlashSize.8M=8MB (64Mb) +wifiduino32c3.menu.FlashSize.8M.build.flash_size=8MB +wifiduino32c3.menu.FlashSize.8M.build.partitions=default_8MB +wifiduino32c3.menu.FlashSize.2M=2MB (16Mb) +wifiduino32c3.menu.FlashSize.2M.build.flash_size=2MB +wifiduino32c3.menu.FlashSize.2M.build.partitions=minimal +wifiduino32c3.menu.FlashSize.16M=16MB (128Mb) +wifiduino32c3.menu.FlashSize.16M.build.flash_size=16MB + +wifiduino32c3.menu.UploadSpeed.921600=921600 +wifiduino32c3.menu.UploadSpeed.921600.upload.speed=921600 +wifiduino32c3.menu.UploadSpeed.115200=115200 +wifiduino32c3.menu.UploadSpeed.115200.upload.speed=115200 +wifiduino32c3.menu.UploadSpeed.256000.windows=256000 +wifiduino32c3.menu.UploadSpeed.256000.upload.speed=256000 +wifiduino32c3.menu.UploadSpeed.230400.windows.upload.speed=256000 +wifiduino32c3.menu.UploadSpeed.230400=230400 +wifiduino32c3.menu.UploadSpeed.230400.upload.speed=230400 +wifiduino32c3.menu.UploadSpeed.460800.linux=460800 +wifiduino32c3.menu.UploadSpeed.460800.macosx=460800 +wifiduino32c3.menu.UploadSpeed.460800.upload.speed=460800 +wifiduino32c3.menu.UploadSpeed.512000.windows=512000 +wifiduino32c3.menu.UploadSpeed.512000.upload.speed=512000 + +wifiduino32c3.menu.DebugLevel.none=None +wifiduino32c3.menu.DebugLevel.none.build.code_debug=0 +wifiduino32c3.menu.DebugLevel.error=Error +wifiduino32c3.menu.DebugLevel.error.build.code_debug=1 +wifiduino32c3.menu.DebugLevel.warn=Warn +wifiduino32c3.menu.DebugLevel.warn.build.code_debug=2 +wifiduino32c3.menu.DebugLevel.info=Info +wifiduino32c3.menu.DebugLevel.info.build.code_debug=3 +wifiduino32c3.menu.DebugLevel.debug=Debug +wifiduino32c3.menu.DebugLevel.debug.build.code_debug=4 +wifiduino32c3.menu.DebugLevel.verbose=Verbose +wifiduino32c3.menu.DebugLevel.verbose.build.code_debug=5 + +wifiduino32c3.menu.EraseFlash.none=Disabled +wifiduino32c3.menu.EraseFlash.none.upload.erase_cmd= +wifiduino32c3.menu.EraseFlash.all=Enabled +wifiduino32c3.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + +wifiduino32s3.name=WiFiduino32S3 +wifiduino32s3.vid.0=0x303a +wifiduino32s3.pid.0=0x1001 + +wifiduino32s3.bootloader.tool=esptool_py +wifiduino32s3.bootloader.tool.default=esptool_py + +wifiduino32s3.upload.tool=esptool_py +wifiduino32s3.upload.tool.default=esptool_py +wifiduino32s3.upload.tool.network=esp_ota + +wifiduino32s3.upload.maximum_size=1310720 +wifiduino32s3.upload.maximum_data_size=327680 +wifiduino32s3.upload.flags= +wifiduino32s3.upload.extra_flags= +wifiduino32s3.upload.use_1200bps_touch=false +wifiduino32s3.upload.wait_for_upload_port=false + +wifiduino32s3.serial.disableDTR=false +wifiduino32s3.serial.disableRTS=false + +wifiduino32s3.build.tarch=xtensa +wifiduino32s3.build.bootloader_addr=0x0 +wifiduino32s3.build.target=esp32s3 +wifiduino32s3.build.mcu=esp32s3 +wifiduino32s3.build.core=esp32 +wifiduino32s3.build.variant=wifiduino32s3 +wifiduino32s3.build.board=WiFiduino32S3 + +wifiduino32s3.build.usb_mode=1 +wifiduino32s3.build.cdc_on_boot=0 +wifiduino32s3.build.msc_on_boot=0 +wifiduino32s3.build.dfu_on_boot=0 +wifiduino32s3.build.f_cpu=240000000L +wifiduino32s3.build.flash_size=4MB +wifiduino32s3.build.flash_freq=80m +wifiduino32s3.build.flash_mode=dio +wifiduino32s3.build.boot=qio +wifiduino32s3.build.boot_freq=80m +wifiduino32s3.build.partitions=default +wifiduino32s3.build.defines= +wifiduino32s3.build.loop_core= +wifiduino32s3.build.event_core= +wifiduino32s3.build.psram_type=qspi +wifiduino32s3.build.memory_type={build.boot}_{build.psram_type} + +wifiduino32s3.menu.PSRAM.disabled=Disabled +wifiduino32s3.menu.PSRAM.disabled.build.defines= +wifiduino32s3.menu.PSRAM.disabled.build.psram_type=qspi +wifiduino32s3.menu.PSRAM.enabled=QSPI PSRAM +wifiduino32s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +wifiduino32s3.menu.PSRAM.enabled.build.psram_type=qspi +wifiduino32s3.menu.PSRAM.opi=OPI PSRAM +wifiduino32s3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +wifiduino32s3.menu.PSRAM.opi.build.psram_type=opi + +wifiduino32s3.menu.FlashMode.qio=QIO 80MHz +wifiduino32s3.menu.FlashMode.qio.build.flash_mode=dio +wifiduino32s3.menu.FlashMode.qio.build.boot=qio +wifiduino32s3.menu.FlashMode.qio.build.boot_freq=80m +wifiduino32s3.menu.FlashMode.qio.build.flash_freq=80m +wifiduino32s3.menu.FlashMode.qio120=QIO 120MHz +wifiduino32s3.menu.FlashMode.qio120.build.flash_mode=dio +wifiduino32s3.menu.FlashMode.qio120.build.boot=qio +wifiduino32s3.menu.FlashMode.qio120.build.boot_freq=120m +wifiduino32s3.menu.FlashMode.qio120.build.flash_freq=80m +wifiduino32s3.menu.FlashMode.dio=DIO 80MHz +wifiduino32s3.menu.FlashMode.dio.build.flash_mode=dio +wifiduino32s3.menu.FlashMode.dio.build.boot=dio +wifiduino32s3.menu.FlashMode.dio.build.boot_freq=80m +wifiduino32s3.menu.FlashMode.dio.build.flash_freq=80m +wifiduino32s3.menu.FlashMode.opi=OPI 80MHz +wifiduino32s3.menu.FlashMode.opi.build.flash_mode=dout +wifiduino32s3.menu.FlashMode.opi.build.boot=opi +wifiduino32s3.menu.FlashMode.opi.build.boot_freq=80m +wifiduino32s3.menu.FlashMode.opi.build.flash_freq=80m + +wifiduino32s3.menu.FlashSize.4M=4MB (32Mb) +wifiduino32s3.menu.FlashSize.4M.build.flash_size=4MB +wifiduino32s3.menu.FlashSize.8M=8MB (64Mb) +wifiduino32s3.menu.FlashSize.8M.build.flash_size=8MB +wifiduino32s3.menu.FlashSize.8M.build.partitions=default_8MB +wifiduino32s3.menu.FlashSize.16M=16MB (128Mb) +wifiduino32s3.menu.FlashSize.16M.build.flash_size=16MB +#wifiduino32s3.menu.FlashSize.32M=32MB (256Mb) +#wifiduino32s3.menu.FlashSize.32M.build.flash_size=32MB + +wifiduino32s3.menu.LoopCore.1=Core 1 +wifiduino32s3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +wifiduino32s3.menu.LoopCore.0=Core 0 +wifiduino32s3.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +wifiduino32s3.menu.EventsCore.1=Core 1 +wifiduino32s3.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +wifiduino32s3.menu.EventsCore.0=Core 0 +wifiduino32s3.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +wifiduino32s3.menu.USBMode.hwcdc=Hardware CDC and JTAG +wifiduino32s3.menu.USBMode.hwcdc.build.usb_mode=1 +wifiduino32s3.menu.USBMode.default=USB-OTG (TinyUSB) +wifiduino32s3.menu.USBMode.default.build.usb_mode=0 + +wifiduino32s3.menu.CDCOnBoot.default=Disabled +wifiduino32s3.menu.CDCOnBoot.default.build.cdc_on_boot=0 +wifiduino32s3.menu.CDCOnBoot.cdc=Enabled +wifiduino32s3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 + +wifiduino32s3.menu.MSCOnBoot.default=Disabled +wifiduino32s3.menu.MSCOnBoot.default.build.msc_on_boot=0 +wifiduino32s3.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +wifiduino32s3.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +wifiduino32s3.menu.DFUOnBoot.default=Disabled +wifiduino32s3.menu.DFUOnBoot.default.build.dfu_on_boot=0 +wifiduino32s3.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +wifiduino32s3.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +wifiduino32s3.menu.UploadMode.default=UART0 / Hardware CDC +wifiduino32s3.menu.UploadMode.default.upload.use_1200bps_touch=false +wifiduino32s3.menu.UploadMode.default.upload.wait_for_upload_port=false +wifiduino32s3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +wifiduino32s3.menu.UploadMode.cdc.upload.use_1200bps_touch=true +wifiduino32s3.menu.UploadMode.cdc.upload.wait_for_upload_port=true + +wifiduino32s3.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +wifiduino32s3.menu.PartitionScheme.default.build.partitions=default +wifiduino32s3.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +wifiduino32s3.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +wifiduino32s3.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +wifiduino32s3.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +wifiduino32s3.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +wifiduino32s3.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +wifiduino32s3.menu.PartitionScheme.minimal.build.partitions=minimal +wifiduino32s3.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +wifiduino32s3.menu.PartitionScheme.no_ota.build.partitions=no_ota +wifiduino32s3.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +wifiduino32s3.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +wifiduino32s3.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +wifiduino32s3.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +wifiduino32s3.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +wifiduino32s3.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +wifiduino32s3.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +wifiduino32s3.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +wifiduino32s3.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +wifiduino32s3.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +wifiduino32s3.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +wifiduino32s3.menu.PartitionScheme.huge_app.build.partitions=huge_app +wifiduino32s3.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +wifiduino32s3.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +wifiduino32s3.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +wifiduino32s3.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +wifiduino32s3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +wifiduino32s3.menu.PartitionScheme.fatflash.build.partitions=ffat +wifiduino32s3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +wifiduino32s3.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +wifiduino32s3.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +wifiduino32s3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +wifiduino32s3.menu.PartitionScheme.rainmaker=RainMaker +wifiduino32s3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +wifiduino32s3.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +wifiduino32s3.menu.CPUFreq.240=240MHz (WiFi) +wifiduino32s3.menu.CPUFreq.240.build.f_cpu=240000000L +wifiduino32s3.menu.CPUFreq.160=160MHz (WiFi) +wifiduino32s3.menu.CPUFreq.160.build.f_cpu=160000000L +wifiduino32s3.menu.CPUFreq.80=80MHz (WiFi) +wifiduino32s3.menu.CPUFreq.80.build.f_cpu=80000000L +wifiduino32s3.menu.CPUFreq.40=40MHz +wifiduino32s3.menu.CPUFreq.40.build.f_cpu=40000000L +wifiduino32s3.menu.CPUFreq.20=20MHz +wifiduino32s3.menu.CPUFreq.20.build.f_cpu=20000000L +wifiduino32s3.menu.CPUFreq.10=10MHz +wifiduino32s3.menu.CPUFreq.10.build.f_cpu=10000000L + +wifiduino32s3.menu.UploadSpeed.921600=921600 +wifiduino32s3.menu.UploadSpeed.921600.upload.speed=921600 +wifiduino32s3.menu.UploadSpeed.115200=115200 +wifiduino32s3.menu.UploadSpeed.115200.upload.speed=115200 +wifiduino32s3.menu.UploadSpeed.256000.windows=256000 +wifiduino32s3.menu.UploadSpeed.256000.upload.speed=256000 +wifiduino32s3.menu.UploadSpeed.230400.windows.upload.speed=256000 +wifiduino32s3.menu.UploadSpeed.230400=230400 +wifiduino32s3.menu.UploadSpeed.230400.upload.speed=230400 +wifiduino32s3.menu.UploadSpeed.460800.linux=460800 +wifiduino32s3.menu.UploadSpeed.460800.macosx=460800 +wifiduino32s3.menu.UploadSpeed.460800.upload.speed=460800 +wifiduino32s3.menu.UploadSpeed.512000.windows=512000 +wifiduino32s3.menu.UploadSpeed.512000.upload.speed=512000 + +wifiduino32s3.menu.DebugLevel.none=None +wifiduino32s3.menu.DebugLevel.none.build.code_debug=0 +wifiduino32s3.menu.DebugLevel.error=Error +wifiduino32s3.menu.DebugLevel.error.build.code_debug=1 +wifiduino32s3.menu.DebugLevel.warn=Warn +wifiduino32s3.menu.DebugLevel.warn.build.code_debug=2 +wifiduino32s3.menu.DebugLevel.info=Info +wifiduino32s3.menu.DebugLevel.info.build.code_debug=3 +wifiduino32s3.menu.DebugLevel.debug=Debug +wifiduino32s3.menu.DebugLevel.debug.build.code_debug=4 +wifiduino32s3.menu.DebugLevel.verbose=Verbose +wifiduino32s3.menu.DebugLevel.verbose.build.code_debug=5 + +wifiduino32s3.menu.EraseFlash.none=Disabled +wifiduino32s3.menu.EraseFlash.none.upload.erase_cmd= +wifiduino32s3.menu.EraseFlash.all=Enabled +wifiduino32s3.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + imbrios-logsens-v1p1.name=IMBRIOS LOGSENS_V1P1 imbrios-logsens-v1p1.bootloader.tool=esptool_py @@ -15172,113 +16102,585 @@ deneyapkart.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## -esp32-trueverit-iot-driver.name=Trueverit ESP32 Universal IoT Driver +deneyapmini.name=Deneyap Mini -esp32-trueverit-iot-driver.bootloader.tool=esptool_py -esp32-trueverit-iot-driver.bootloader.tool.default=esptool_py +deneyapmini.vid.0=0x303a +deneyapmini.pid.0=0x0002 -esp32-trueverit-iot-driver.upload.tool=esptool_py -esp32-trueverit-iot-driver.upload.tool.default=esptool_py -esp32-trueverit-iot-driver.upload.tool.network=esp_ota +deneyapmini.bootloader.tool=esptool_py +deneyapmini.bootloader.tool.default=esptool_py -esp32-trueverit-iot-driver.upload.maximum_size=1310720 -esp32-trueverit-iot-driver.upload.maximum_data_size=327680 -esp32-trueverit-iot-driver.upload.flags= -esp32-trueverit-iot-driver.upload.extra_flags= +deneyapmini.upload.tool=esptool_py +deneyapmini.upload.tool.default=esptool_py +deneyapmini.upload.tool.network=esp_ota -esp32-trueverit-iot-driver.serial.disableDTR=true -esp32-trueverit-iot-driver.serial.disableRTS=true +deneyapmini.upload.maximum_size=1310720 +deneyapmini.upload.maximum_data_size=327680 +deneyapmini.upload.flags= +deneyapmini.upload.extra_flags= +deneyapmini.upload.use_1200bps_touch=false +deneyapmini.upload.wait_for_upload_port=false -esp32-trueverit-iot-driver.build.tarch=xtensa -esp32-trueverit-iot-driver.build.bootloader_addr=0x1000 -esp32-trueverit-iot-driver.build.target=esp32 -esp32-trueverit-iot-driver.build.mcu=esp32 -esp32-trueverit-iot-driver.build.core=esp32 -esp32-trueverit-iot-driver.build.variant=esp32-trueverit-iot-driver -esp32-trueverit-iot-driver.build.board=Trueverit_ESP32_Universal_IoT_Driver +deneyapmini.serial.disableDTR=false +deneyapmini.serial.disableRTS=false -esp32-trueverit-iot-driver.build.f_cpu=240000000L -esp32-trueverit-iot-driver.build.flash_mode=dio -esp32-trueverit-iot-driver.build.flash_size=4MB -esp32-trueverit-iot-driver.build.boot=dio -esp32-trueverit-iot-driver.build.partitions=default -esp32-trueverit-iot-driver.build.defines= +deneyapmini.build.tarch=xtensa +deneyapmini.build.bootloader_addr=0x1000 +deneyapmini.build.target=esp32s2 +deneyapmini.build.mcu=esp32s2 +deneyapmini.build.core=esp32 +deneyapmini.build.variant=deneyapmini +deneyapmini.build.board=DYM -esp32-trueverit-iot-driver.menu.FlashFreq.80=80MHz -esp32-trueverit-iot-driver.menu.FlashFreq.80.build.flash_freq=80m -esp32-trueverit-iot-driver.menu.FlashFreq.40=40MHz -esp32-trueverit-iot-driver.menu.FlashFreq.40.build.flash_freq=40m +deneyapmini.build.serial=0 +deneyapmini.build.f_cpu=240000000L +deneyapmini.build.flash_size=4MB +deneyapmini.build.flash_freq=80m +deneyapmini.build.flash_mode=qio +deneyapmini.build.boot=qio +deneyapmini.build.partitions=default +deneyapmini.build.defines= -esp32-trueverit-iot-driver.menu.UploadSpeed.115200=115200 -esp32-trueverit-iot-driver.menu.UploadSpeed.115200.upload.speed=115200 -esp32-trueverit-iot-driver.menu.UploadSpeed.256000.windows=256000 -esp32-trueverit-iot-driver.menu.UploadSpeed.256000.upload.speed=256000 -esp32-trueverit-iot-driver.menu.UploadSpeed.230400.windows.upload.speed=256000 -esp32-trueverit-iot-driver.menu.UploadSpeed.230400=230400 -esp32-trueverit-iot-driver.menu.UploadSpeed.230400.upload.speed=230400 -esp32-trueverit-iot-driver.menu.UploadSpeed.460800.linux=460800 -esp32-trueverit-iot-driver.menu.UploadSpeed.460800.macosx=460800 -esp32-trueverit-iot-driver.menu.UploadSpeed.460800.upload.speed=460800 +deneyapmini.menu.CDCOnBoot.default=Enabled +deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=1 +deneyapmini.menu.CDCOnBoot.cdc=Disabled +deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=0 -esp32-trueverit-iot-driver.menu.DebugLevel.none=None -esp32-trueverit-iot-driver.menu.DebugLevel.none.build.code_debug=0 -esp32-trueverit-iot-driver.menu.DebugLevel.error=Error -esp32-trueverit-iot-driver.menu.DebugLevel.error.build.code_debug=1 -esp32-trueverit-iot-driver.menu.DebugLevel.warn=Warn -esp32-trueverit-iot-driver.menu.DebugLevel.warn.build.code_debug=2 -esp32-trueverit-iot-driver.menu.DebugLevel.info=Info -esp32-trueverit-iot-driver.menu.DebugLevel.info.build.code_debug=3 -esp32-trueverit-iot-driver.menu.DebugLevel.debug=Debug -esp32-trueverit-iot-driver.menu.DebugLevel.debug.build.code_debug=4 -esp32-trueverit-iot-driver.menu.DebugLevel.verbose=Verbose -esp32-trueverit-iot-driver.menu.DebugLevel.verbose.build.code_debug=5 +deneyapmini.menu.MSCOnBoot.default=Disabled +deneyapmini.menu.MSCOnBoot.default.build.msc_on_boot=0 +deneyapmini.menu.MSCOnBoot.msc=Enabled +deneyapmini.menu.MSCOnBoot.msc.build.msc_on_boot=1 -esp32-trueverit-iot-driver.menu.EraseFlash.none=Disabled -esp32-trueverit-iot-driver.menu.EraseFlash.none.upload.erase_cmd= -esp32-trueverit-iot-driver.menu.EraseFlash.all=Enabled -esp32-trueverit-iot-driver.menu.EraseFlash.all.upload.erase_cmd=-e +deneyapmini.menu.DFUOnBoot.default=Disabled +deneyapmini.menu.DFUOnBoot.default.build.dfu_on_boot=0 +deneyapmini.menu.DFUOnBoot.dfu=Enabled +deneyapmini.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 -############################################################## +deneyapmini.menu.PSRAM.disabled=Disabled +deneyapmini.menu.PSRAM.disabled.build.defines= +deneyapmini.menu.PSRAM.enabled=Enabled +deneyapmini.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -esp32-trueverit-iot-driver-mkii.name=Trueverit ESP32 Universal IoT Driver MK II +deneyapmini.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +deneyapmini.menu.PartitionScheme.default.build.partitions=default +deneyapmini.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +deneyapmini.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +deneyapmini.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +deneyapmini.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +deneyapmini.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +deneyapmini.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +deneyapmini.menu.PartitionScheme.minimal.build.partitions=minimal +deneyapmini.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +deneyapmini.menu.PartitionScheme.no_ota.build.partitions=no_ota +deneyapmini.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +deneyapmini.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +deneyapmini.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +deneyapmini.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +deneyapmini.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +deneyapmini.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +deneyapmini.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +deneyapmini.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +deneyapmini.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +deneyapmini.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +deneyapmini.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +deneyapmini.menu.PartitionScheme.huge_app.build.partitions=huge_app +deneyapmini.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +deneyapmini.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +deneyapmini.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +deneyapmini.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +deneyapmini.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +deneyapmini.menu.PartitionScheme.fatflash.build.partitions=ffat +deneyapmini.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +deneyapmini.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +deneyapmini.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +deneyapmini.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 -esp32-trueverit-iot-driver-mkii.bootloader.tool=esptool_py -esp32-trueverit-iot-driver-mkii.bootloader.tool.default=esptool_py +deneyapmini.menu.CPUFreq.240=240MHz (WiFi) +deneyapmini.menu.CPUFreq.240.build.f_cpu=240000000L +deneyapmini.menu.CPUFreq.160=160MHz (WiFi) +deneyapmini.menu.CPUFreq.160.build.f_cpu=160000000L +deneyapmini.menu.CPUFreq.80=80MHz (WiFi) +deneyapmini.menu.CPUFreq.80.build.f_cpu=80000000L +deneyapmini.menu.CPUFreq.40=40MHz +deneyapmini.menu.CPUFreq.40.build.f_cpu=40000000L +deneyapmini.menu.CPUFreq.20=20MHz +deneyapmini.menu.CPUFreq.20.build.f_cpu=20000000L +deneyapmini.menu.CPUFreq.10=10MHz +deneyapmini.menu.CPUFreq.10.build.f_cpu=10000000L -esp32-trueverit-iot-driver-mkii.upload.tool=esptool_py -esp32-trueverit-iot-driver-mkii.upload.tool.default=esptool_py -esp32-trueverit-iot-driver-mkii.upload.tool.network=esp_ota +deneyapmini.menu.FlashMode.qio=QIO +deneyapmini.menu.FlashMode.qio.build.flash_mode=dio +deneyapmini.menu.FlashMode.qio.build.boot=qio +deneyapmini.menu.FlashMode.dio=DIO +deneyapmini.menu.FlashMode.dio.build.flash_mode=dio +deneyapmini.menu.FlashMode.dio.build.boot=dio +deneyapmini.menu.FlashMode.qout=QOUT +deneyapmini.menu.FlashMode.qout.build.flash_mode=dout +deneyapmini.menu.FlashMode.qout.build.boot=qout +deneyapmini.menu.FlashMode.dout=DOUT +deneyapmini.menu.FlashMode.dout.build.flash_mode=dout +deneyapmini.menu.FlashMode.dout.build.boot=dout -esp32-trueverit-iot-driver-mkii.upload.maximum_size=1310720 -esp32-trueverit-iot-driver-mkii.upload.maximum_data_size=327680 -esp32-trueverit-iot-driver-mkii.upload.flags= -esp32-trueverit-iot-driver-mkii.upload.extra_flags= +deneyapmini.menu.FlashFreq.80=80MHz +deneyapmini.menu.FlashFreq.80.build.flash_freq=80m +deneyapmini.menu.FlashFreq.40=40MHz +deneyapmini.menu.FlashFreq.40.build.flash_freq=40m -esp32-trueverit-iot-driver-mkii.serial.disableDTR=true -esp32-trueverit-iot-driver-mkii.serial.disableRTS=true +deneyapmini.menu.FlashSize.4M=4MB (32Mb) +deneyapmini.menu.FlashSize.4M.build.flash_size=4MB +deneyapmini.menu.FlashSize.8M=8MB (64Mb) +deneyapmini.menu.FlashSize.8M.build.flash_size=8MB +deneyapmini.menu.FlashSize.8M.build.partitions=default_8MB +deneyapmini.menu.FlashSize.2M=2MB (16Mb) +deneyapmini.menu.FlashSize.2M.build.flash_size=2MB +deneyapmini.menu.FlashSize.2M.build.partitions=minimal +deneyapmini.menu.FlashSize.16M=16MB (128Mb) +deneyapmini.menu.FlashSize.16M.build.flash_size=16MB -esp32-trueverit-iot-driver-mkii.build.tarch=xtensa -esp32-trueverit-iot-driver-mkii.build.bootloader_addr=0x1000 -esp32-trueverit-iot-driver-mkii.build.target=esp32 -esp32-trueverit-iot-driver-mkii.build.mcu=esp32 -esp32-trueverit-iot-driver-mkii.build.core=esp32 -esp32-trueverit-iot-driver-mkii.build.variant=esp32-trueverit-iot-driver-mkii -esp32-trueverit-iot-driver-mkii.build.board=Trueverit_ESP32_Universal_IoT_Driver_MK_II +deneyapmini.menu.UploadMode.default=Internal USB +deneyapmini.menu.UploadMode.default.upload.use_1200bps_touch=true +deneyapmini.menu.UploadMode.default.upload.wait_for_upload_port=true +deneyapmini.menu.UploadMode.default.upload.mode=default_reset +deneyapmini.menu.UploadMode.cdc=UART0 +deneyapmini.menu.UploadMode.cdc.upload.use_1200bps_touch=false +deneyapmini.menu.UploadMode.cdc.upload.wait_for_upload_port=false +deneyapmini.menu.UploadMode.cdc.upload.mode=default_reset -esp32-trueverit-iot-driver-mkii.build.f_cpu=240000000L -esp32-trueverit-iot-driver-mkii.build.flash_mode=dio -esp32-trueverit-iot-driver-mkii.build.flash_size=4MB -esp32-trueverit-iot-driver-mkii.build.boot=dio -esp32-trueverit-iot-driver-mkii.build.partitions=default -esp32-trueverit-iot-driver-mkii.build.defines= +deneyapmini.menu.UploadSpeed.921600=921600 +deneyapmini.menu.UploadSpeed.921600.upload.speed=921600 +deneyapmini.menu.UploadSpeed.115200=115200 +deneyapmini.menu.UploadSpeed.115200.upload.speed=115200 +deneyapmini.menu.UploadSpeed.256000.windows=256000 +deneyapmini.menu.UploadSpeed.256000.upload.speed=256000 +deneyapmini.menu.UploadSpeed.230400.windows.upload.speed=256000 +deneyapmini.menu.UploadSpeed.230400=230400 +deneyapmini.menu.UploadSpeed.230400.upload.speed=230400 +deneyapmini.menu.UploadSpeed.460800.linux=460800 +deneyapmini.menu.UploadSpeed.460800.macosx=460800 +deneyapmini.menu.UploadSpeed.460800.upload.speed=460800 +deneyapmini.menu.UploadSpeed.512000.windows=512000 +deneyapmini.menu.UploadSpeed.512000.upload.speed=512000 -esp32-trueverit-iot-driver-mkii.menu.FlashFreq.80=80MHz -esp32-trueverit-iot-driver-mkii.menu.FlashFreq.80.build.flash_freq=80m -esp32-trueverit-iot-driver-mkii.menu.FlashFreq.40=40MHz -esp32-trueverit-iot-driver-mkii.menu.FlashFreq.40.build.flash_freq=40m +deneyapmini.menu.DebugLevel.none=None +deneyapmini.menu.DebugLevel.none.build.code_debug=0 +deneyapmini.menu.DebugLevel.error=Error +deneyapmini.menu.DebugLevel.error.build.code_debug=1 +deneyapmini.menu.DebugLevel.warn=Warn +deneyapmini.menu.DebugLevel.warn.build.code_debug=2 +deneyapmini.menu.DebugLevel.info=Info +deneyapmini.menu.DebugLevel.info.build.code_debug=3 +deneyapmini.menu.DebugLevel.debug=Debug +deneyapmini.menu.DebugLevel.debug.build.code_debug=4 +deneyapmini.menu.DebugLevel.verbose=Verbose +deneyapmini.menu.DebugLevel.verbose.build.code_debug=5 -esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.115200=115200 -esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.115200.upload.speed=115200 +deneyapmini.menu.EraseFlash.none=Disabled +deneyapmini.menu.EraseFlash.none.upload.erase_cmd= +deneyapmini.menu.EraseFlash.all=Enabled +deneyapmini.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + +deneyapkart1A.name=Deneyap Kart 1A + +deneyapkart1A.bootloader.tool=esptool_py +deneyapkart1A.bootloader.tool.default=esptool_py + +deneyapkart1A.upload.tool=esptool_py +deneyapkart1A.upload.tool.default=esptool_py +deneyapkart1A.upload.tool.network=esp_ota + +deneyapkart1A.upload.maximum_size=1310720 +deneyapkart1A.upload.maximum_data_size=327680 +deneyapkart1A.upload.wait_for_upload_port=true +deneyapkart1A.upload.flags= +deneyapkart1A.upload.extra_flags= + +deneyapkart1A.serial.disableDTR=true +deneyapkart1A.serial.disableRTS=true + +deneyapkart1A.build.tarch=xtensa +deneyapkart1A.build.bootloader_addr=0x1000 +deneyapkart1A.build.target=esp32 +deneyapkart1A.build.mcu=esp32 +deneyapkart1A.build.core=esp32 +deneyapkart1A.build.variant=deneyapkart1A +deneyapkart1A.build.board=DYDK1A + +deneyapkart1A.build.f_cpu=240000000L +deneyapkart1A.build.flash_size=4MB +deneyapkart1A.build.flash_freq=40m +deneyapkart1A.build.flash_mode=dio +deneyapkart1A.build.boot=dio +deneyapkart1A.build.partitions=default +deneyapkart1A.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw +deneyapkart1A.build.extra_libs= + +deneyapkart1A.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +deneyapkart1A.menu.PartitionScheme.default.build.partitions=default +deneyapkart1A.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +deneyapkart1A.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +deneyapkart1A.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +deneyapkart1A.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +deneyapkart1A.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +deneyapkart1A.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +deneyapkart1A.menu.PartitionScheme.minimal.build.partitions=minimal +deneyapkart1A.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +deneyapkart1A.menu.PartitionScheme.no_ota.build.partitions=no_ota +deneyapkart1A.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +deneyapkart1A.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +deneyapkart1A.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +deneyapkart1A.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +deneyapkart1A.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +deneyapkart1A.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +deneyapkart1A.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +deneyapkart1A.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +deneyapkart1A.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +deneyapkart1A.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +deneyapkart1A.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +deneyapkart1A.menu.PartitionScheme.huge_app.build.partitions=huge_app +deneyapkart1A.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +deneyapkart1A.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +deneyapkart1A.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +deneyapkart1A.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +deneyapkart1A.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +deneyapkart1A.menu.PartitionScheme.fatflash.build.partitions=ffat +deneyapkart1A.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +deneyapkart1A.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +deneyapkart1A.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +deneyapkart1A.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +deneyapkart1A.menu.PartitionScheme.rainmaker=RainMaker +deneyapkart1A.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +deneyapkart1A.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +deneyapkart1A.menu.CPUFreq.240=240MHz (WiFi/BT) +deneyapkart1A.menu.CPUFreq.240.build.f_cpu=240000000L +deneyapkart1A.menu.CPUFreq.160=160MHz (WiFi/BT) +deneyapkart1A.menu.CPUFreq.160.build.f_cpu=160000000L +deneyapkart1A.menu.CPUFreq.80=80MHz (WiFi/BT) +deneyapkart1A.menu.CPUFreq.80.build.f_cpu=80000000L +deneyapkart1A.menu.CPUFreq.40=40MHz +deneyapkart1A.menu.CPUFreq.40.build.f_cpu=40000000L +deneyapkart1A.menu.CPUFreq.20=20MHz +deneyapkart1A.menu.CPUFreq.20.build.f_cpu=20000000L +deneyapkart1A.menu.CPUFreq.10=10MHz +deneyapkart1A.menu.CPUFreq.10.build.f_cpu=10000000L + +deneyapkart1A.menu.FlashMode.qio=QIO +deneyapkart1A.menu.FlashMode.qio.build.flash_mode=dio +deneyapkart1A.menu.FlashMode.qio.build.boot=qio +deneyapkart1A.menu.FlashMode.dio=DIO +deneyapkart1A.menu.FlashMode.dio.build.flash_mode=dio +deneyapkart1A.menu.FlashMode.dio.build.boot=dio +deneyapkart1A.menu.FlashMode.qout=QOUT +deneyapkart1A.menu.FlashMode.qout.build.flash_mode=dout +deneyapkart1A.menu.FlashMode.qout.build.boot=qout +deneyapkart1A.menu.FlashMode.dout=DOUT +deneyapkart1A.menu.FlashMode.dout.build.flash_mode=dout +deneyapkart1A.menu.FlashMode.dout.build.boot=dout + +deneyapkart1A.menu.FlashFreq.80=80MHz +deneyapkart1A.menu.FlashFreq.80.build.flash_freq=80m +deneyapkart1A.menu.FlashFreq.40=40MHz +deneyapkart1A.menu.FlashFreq.40.build.flash_freq=40m + +deneyapkart1A.menu.UploadSpeed.921600=921600 +deneyapkart1A.menu.UploadSpeed.921600.upload.speed=921600 +deneyapkart1A.menu.UploadSpeed.115200=115200 +deneyapkart1A.menu.UploadSpeed.115200.upload.speed=115200 +deneyapkart1A.menu.UploadSpeed.256000.windows=256000 +deneyapkart1A.menu.UploadSpeed.256000.upload.speed=256000 +deneyapkart1A.menu.UploadSpeed.230400.windows.upload.speed=256000 +deneyapkart1A.menu.UploadSpeed.230400=230400 +deneyapkart1A.menu.UploadSpeed.230400.upload.speed=230400 +deneyapkart1A.menu.UploadSpeed.460800.linux=460800 +deneyapkart1A.menu.UploadSpeed.460800.macosx=460800 +deneyapkart1A.menu.UploadSpeed.460800.upload.speed=460800 +deneyapkart1A.menu.UploadSpeed.512000.windows=512000 +deneyapkart1A.menu.UploadSpeed.512000.upload.speed=512000 + +deneyapkart1A.menu.DebugLevel.none=None +deneyapkart1A.menu.DebugLevel.none.build.code_debug=0 +deneyapkart1A.menu.DebugLevel.error=Error +deneyapkart1A.menu.DebugLevel.error.build.code_debug=1 +deneyapkart1A.menu.DebugLevel.warn=Warn +deneyapkart1A.menu.DebugLevel.warn.build.code_debug=2 +deneyapkart1A.menu.DebugLevel.info=Info +deneyapkart1A.menu.DebugLevel.info.build.code_debug=3 +deneyapkart1A.menu.DebugLevel.debug=Debug +deneyapkart1A.menu.DebugLevel.debug.build.code_debug=4 +deneyapkart1A.menu.DebugLevel.verbose=Verbose +deneyapkart1A.menu.DebugLevel.verbose.build.code_debug=5 + +deneyapkart1A.menu.EraseFlash.none=Disabled +deneyapkart1A.menu.EraseFlash.none.upload.erase_cmd= +deneyapkart1A.menu.EraseFlash.all=Enabled +deneyapkart1A.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + +deneyapkartg.name=Deneyap Kart G +deneyapkartg.vid.0=0x303a +deneyapkartg.pid.0=0x1001 + +deneyapkartg.bootloader.tool=esptool_py +deneyapkartg.bootloader.tool.default=esptool_py + +deneyapkartg.upload.tool=esptool_py +deneyapkartg.upload.tool.default=esptool_py +deneyapkartg.upload.tool.network=esp_ota + +deneyapkartg.upload.maximum_size=1310720 +deneyapkartg.upload.maximum_data_size=327680 +deneyapkartg.upload.flags= +deneyapkartg.upload.extra_flags= +deneyapkartg.upload.use_1200bps_touch=false +deneyapkartg.upload.wait_for_upload_port=false + +deneyapkartg.serial.disableDTR=false +deneyapkartg.serial.disableRTS=false + +deneyapkartg.build.tarch=riscv32 +deneyapkartg.build.target=esp +deneyapkartg.build.mcu=esp32c3 +deneyapkartg.build.core=esp32 +deneyapkartg.build.variant=deneyapkartg +deneyapkartg.build.board=DYG +deneyapkartg.build.bootloader_addr=0x0 + +deneyapkartg.build.cdc_on_boot=0 +deneyapkartg.build.f_cpu=160000000L +deneyapkartg.build.flash_size=4MB +deneyapkartg.build.flash_freq=80m +deneyapkartg.build.flash_mode=qio +deneyapkartg.build.boot=qio +deneyapkartg.build.partitions=default +deneyapkartg.build.defines= + +deneyapkartg.menu.CDCOnBoot.cdc=Enabled +deneyapkartg.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +deneyapkartg.menu.CDCOnBoot.default=Disabled +deneyapkartg.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +deneyapkartg.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +deneyapkartg.menu.PartitionScheme.default.build.partitions=default +deneyapkartg.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +deneyapkartg.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +deneyapkartg.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +deneyapkartg.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +deneyapkartg.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +deneyapkartg.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +deneyapkartg.menu.PartitionScheme.minimal.build.partitions=minimal +deneyapkartg.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +deneyapkartg.menu.PartitionScheme.no_ota.build.partitions=no_ota +deneyapkartg.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +deneyapkartg.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +deneyapkartg.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +deneyapkartg.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +deneyapkartg.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +deneyapkartg.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +deneyapkartg.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +deneyapkartg.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +deneyapkartg.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +deneyapkartg.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +deneyapkartg.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +deneyapkartg.menu.PartitionScheme.huge_app.build.partitions=huge_app +deneyapkartg.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +deneyapkartg.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +deneyapkartg.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +deneyapkartg.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +deneyapkartg.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) +deneyapkartg.menu.PartitionScheme.fatflash.build.partitions=ffat +deneyapkartg.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +deneyapkartg.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) +deneyapkartg.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +deneyapkartg.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +deneyapkartg.menu.PartitionScheme.rainmaker=RainMaker +deneyapkartg.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +deneyapkartg.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +deneyapkartg.menu.CPUFreq.160=160MHz (WiFi) +deneyapkartg.menu.CPUFreq.160.build.f_cpu=160000000L +deneyapkartg.menu.CPUFreq.80=80MHz (WiFi) +deneyapkartg.menu.CPUFreq.80.build.f_cpu=80000000L +deneyapkartg.menu.CPUFreq.40=40MHz +deneyapkartg.menu.CPUFreq.40.build.f_cpu=40000000L +deneyapkartg.menu.CPUFreq.20=20MHz +deneyapkartg.menu.CPUFreq.20.build.f_cpu=20000000L +deneyapkartg.menu.CPUFreq.10=10MHz +deneyapkartg.menu.CPUFreq.10.build.f_cpu=10000000L + +deneyapkartg.menu.FlashMode.qio=QIO +deneyapkartg.menu.FlashMode.qio.build.flash_mode=dio +deneyapkartg.menu.FlashMode.qio.build.boot=qio +deneyapkartg.menu.FlashMode.dio=DIO +deneyapkartg.menu.FlashMode.dio.build.flash_mode=dio +deneyapkartg.menu.FlashMode.dio.build.boot=dio +deneyapkartg.menu.FlashMode.qout=QOUT +deneyapkartg.menu.FlashMode.qout.build.flash_mode=dout +deneyapkartg.menu.FlashMode.qout.build.boot=qout +deneyapkartg.menu.FlashMode.dout=DOUT +deneyapkartg.menu.FlashMode.dout.build.flash_mode=dout +deneyapkartg.menu.FlashMode.dout.build.boot=dout + +deneyapkartg.menu.FlashFreq.80=80MHz +deneyapkartg.menu.FlashFreq.80.build.flash_freq=80m +deneyapkartg.menu.FlashFreq.40=40MHz +deneyapkartg.menu.FlashFreq.40.build.flash_freq=40m + +deneyapkartg.menu.FlashSize.4M=4MB (32Mb) +deneyapkartg.menu.FlashSize.4M.build.flash_size=4MB +deneyapkartg.menu.FlashSize.8M=8MB (64Mb) +deneyapkartg.menu.FlashSize.8M.build.flash_size=8MB +deneyapkartg.menu.FlashSize.8M.build.partitions=default_8MB +deneyapkartg.menu.FlashSize.2M=2MB (16Mb) +deneyapkartg.menu.FlashSize.2M.build.flash_size=2MB +deneyapkartg.menu.FlashSize.2M.build.partitions=minimal +deneyapkartg.menu.FlashSize.16M=16MB (128Mb) +deneyapkartg.menu.FlashSize.16M.build.flash_size=16MB + +deneyapkartg.menu.UploadSpeed.921600=921600 +deneyapkartg.menu.UploadSpeed.921600.upload.speed=921600 +deneyapkartg.menu.UploadSpeed.115200=115200 +deneyapkartg.menu.UploadSpeed.115200.upload.speed=115200 +deneyapkartg.menu.UploadSpeed.256000.windows=256000 +deneyapkartg.menu.UploadSpeed.256000.upload.speed=256000 +deneyapkartg.menu.UploadSpeed.230400.windows.upload.speed=256000 +deneyapkartg.menu.UploadSpeed.230400=230400 +deneyapkartg.menu.UploadSpeed.230400.upload.speed=230400 +deneyapkartg.menu.UploadSpeed.460800.linux=460800 +deneyapkartg.menu.UploadSpeed.460800.macosx=460800 +deneyapkartg.menu.UploadSpeed.460800.upload.speed=460800 +deneyapkartg.menu.UploadSpeed.512000.windows=512000 +deneyapkartg.menu.UploadSpeed.512000.upload.speed=512000 + +deneyapkartg.menu.DebugLevel.none=None +deneyapkartg.menu.DebugLevel.none.build.code_debug=0 +deneyapkartg.menu.DebugLevel.error=Error +deneyapkartg.menu.DebugLevel.error.build.code_debug=1 +deneyapkartg.menu.DebugLevel.warn=Warn +deneyapkartg.menu.DebugLevel.warn.build.code_debug=2 +deneyapkartg.menu.DebugLevel.info=Info +deneyapkartg.menu.DebugLevel.info.build.code_debug=3 +deneyapkartg.menu.DebugLevel.debug=Debug +deneyapkartg.menu.DebugLevel.debug.build.code_debug=4 +deneyapkartg.menu.DebugLevel.verbose=Verbose +deneyapkartg.menu.DebugLevel.verbose.build.code_debug=5 + +deneyapkartg.menu.EraseFlash.none=Disabled +deneyapkartg.menu.EraseFlash.none.upload.erase_cmd= +deneyapkartg.menu.EraseFlash.all=Enabled +deneyapkartg.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + +esp32-trueverit-iot-driver.name=Trueverit ESP32 Universal IoT Driver + +esp32-trueverit-iot-driver.bootloader.tool=esptool_py +esp32-trueverit-iot-driver.bootloader.tool.default=esptool_py + +esp32-trueverit-iot-driver.upload.tool=esptool_py +esp32-trueverit-iot-driver.upload.tool.default=esptool_py +esp32-trueverit-iot-driver.upload.tool.network=esp_ota + +esp32-trueverit-iot-driver.upload.maximum_size=1310720 +esp32-trueverit-iot-driver.upload.maximum_data_size=327680 +esp32-trueverit-iot-driver.upload.flags= +esp32-trueverit-iot-driver.upload.extra_flags= + +esp32-trueverit-iot-driver.serial.disableDTR=true +esp32-trueverit-iot-driver.serial.disableRTS=true + +esp32-trueverit-iot-driver.build.tarch=xtensa +esp32-trueverit-iot-driver.build.bootloader_addr=0x1000 +esp32-trueverit-iot-driver.build.target=esp32 +esp32-trueverit-iot-driver.build.mcu=esp32 +esp32-trueverit-iot-driver.build.core=esp32 +esp32-trueverit-iot-driver.build.variant=esp32-trueverit-iot-driver +esp32-trueverit-iot-driver.build.board=Trueverit_ESP32_Universal_IoT_Driver + +esp32-trueverit-iot-driver.build.f_cpu=240000000L +esp32-trueverit-iot-driver.build.flash_mode=dio +esp32-trueverit-iot-driver.build.flash_size=4MB +esp32-trueverit-iot-driver.build.boot=dio +esp32-trueverit-iot-driver.build.partitions=default +esp32-trueverit-iot-driver.build.defines= + +esp32-trueverit-iot-driver.menu.FlashFreq.80=80MHz +esp32-trueverit-iot-driver.menu.FlashFreq.80.build.flash_freq=80m +esp32-trueverit-iot-driver.menu.FlashFreq.40=40MHz +esp32-trueverit-iot-driver.menu.FlashFreq.40.build.flash_freq=40m + +esp32-trueverit-iot-driver.menu.UploadSpeed.115200=115200 +esp32-trueverit-iot-driver.menu.UploadSpeed.115200.upload.speed=115200 +esp32-trueverit-iot-driver.menu.UploadSpeed.256000.windows=256000 +esp32-trueverit-iot-driver.menu.UploadSpeed.256000.upload.speed=256000 +esp32-trueverit-iot-driver.menu.UploadSpeed.230400.windows.upload.speed=256000 +esp32-trueverit-iot-driver.menu.UploadSpeed.230400=230400 +esp32-trueverit-iot-driver.menu.UploadSpeed.230400.upload.speed=230400 +esp32-trueverit-iot-driver.menu.UploadSpeed.460800.linux=460800 +esp32-trueverit-iot-driver.menu.UploadSpeed.460800.macosx=460800 +esp32-trueverit-iot-driver.menu.UploadSpeed.460800.upload.speed=460800 + +esp32-trueverit-iot-driver.menu.DebugLevel.none=None +esp32-trueverit-iot-driver.menu.DebugLevel.none.build.code_debug=0 +esp32-trueverit-iot-driver.menu.DebugLevel.error=Error +esp32-trueverit-iot-driver.menu.DebugLevel.error.build.code_debug=1 +esp32-trueverit-iot-driver.menu.DebugLevel.warn=Warn +esp32-trueverit-iot-driver.menu.DebugLevel.warn.build.code_debug=2 +esp32-trueverit-iot-driver.menu.DebugLevel.info=Info +esp32-trueverit-iot-driver.menu.DebugLevel.info.build.code_debug=3 +esp32-trueverit-iot-driver.menu.DebugLevel.debug=Debug +esp32-trueverit-iot-driver.menu.DebugLevel.debug.build.code_debug=4 +esp32-trueverit-iot-driver.menu.DebugLevel.verbose=Verbose +esp32-trueverit-iot-driver.menu.DebugLevel.verbose.build.code_debug=5 + +esp32-trueverit-iot-driver.menu.EraseFlash.none=Disabled +esp32-trueverit-iot-driver.menu.EraseFlash.none.upload.erase_cmd= +esp32-trueverit-iot-driver.menu.EraseFlash.all=Enabled +esp32-trueverit-iot-driver.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + +esp32-trueverit-iot-driver-mkii.name=Trueverit ESP32 Universal IoT Driver MK II + +esp32-trueverit-iot-driver-mkii.bootloader.tool=esptool_py +esp32-trueverit-iot-driver-mkii.bootloader.tool.default=esptool_py + +esp32-trueverit-iot-driver-mkii.upload.tool=esptool_py +esp32-trueverit-iot-driver-mkii.upload.tool.default=esptool_py +esp32-trueverit-iot-driver-mkii.upload.tool.network=esp_ota + +esp32-trueverit-iot-driver-mkii.upload.maximum_size=1310720 +esp32-trueverit-iot-driver-mkii.upload.maximum_data_size=327680 +esp32-trueverit-iot-driver-mkii.upload.flags= +esp32-trueverit-iot-driver-mkii.upload.extra_flags= + +esp32-trueverit-iot-driver-mkii.serial.disableDTR=true +esp32-trueverit-iot-driver-mkii.serial.disableRTS=true + +esp32-trueverit-iot-driver-mkii.build.tarch=xtensa +esp32-trueverit-iot-driver-mkii.build.bootloader_addr=0x1000 +esp32-trueverit-iot-driver-mkii.build.target=esp32 +esp32-trueverit-iot-driver-mkii.build.mcu=esp32 +esp32-trueverit-iot-driver-mkii.build.core=esp32 +esp32-trueverit-iot-driver-mkii.build.variant=esp32-trueverit-iot-driver-mkii +esp32-trueverit-iot-driver-mkii.build.board=Trueverit_ESP32_Universal_IoT_Driver_MK_II + +esp32-trueverit-iot-driver-mkii.build.f_cpu=240000000L +esp32-trueverit-iot-driver-mkii.build.flash_mode=dio +esp32-trueverit-iot-driver-mkii.build.flash_size=4MB +esp32-trueverit-iot-driver-mkii.build.boot=dio +esp32-trueverit-iot-driver-mkii.build.partitions=default +esp32-trueverit-iot-driver-mkii.build.defines= + +esp32-trueverit-iot-driver-mkii.menu.FlashFreq.80=80MHz +esp32-trueverit-iot-driver-mkii.menu.FlashFreq.80.build.flash_freq=80m +esp32-trueverit-iot-driver-mkii.menu.FlashFreq.40=40MHz +esp32-trueverit-iot-driver-mkii.menu.FlashFreq.40.build.flash_freq=40m + +esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.115200=115200 +esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.115200.upload.speed=115200 esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.256000.windows=256000 esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.256000.upload.speed=256000 esp32-trueverit-iot-driver-mkii.menu.UploadSpeed.230400.windows.upload.speed=256000 @@ -15415,252 +16817,73 @@ atmegazero_esp32s2.menu.CPUFreq.160.build.f_cpu=160000000L atmegazero_esp32s2.menu.CPUFreq.80=80MHz (WiFi) atmegazero_esp32s2.menu.CPUFreq.80.build.f_cpu=80000000L atmegazero_esp32s2.menu.CPUFreq.40=40MHz -atmegazero_esp32s2.menu.CPUFreq.40.build.f_cpu=40000000L -atmegazero_esp32s2.menu.CPUFreq.20=20MHz -atmegazero_esp32s2.menu.CPUFreq.20.build.f_cpu=20000000L -atmegazero_esp32s2.menu.CPUFreq.10=10MHz -atmegazero_esp32s2.menu.CPUFreq.10.build.f_cpu=10000000L - -atmegazero_esp32s2.menu.FlashMode.qio=QIO -atmegazero_esp32s2.menu.FlashMode.qio.build.flash_mode=dio -atmegazero_esp32s2.menu.FlashMode.qio.build.boot=qio -atmegazero_esp32s2.menu.FlashMode.dio=DIO -atmegazero_esp32s2.menu.FlashMode.dio.build.flash_mode=dio -atmegazero_esp32s2.menu.FlashMode.dio.build.boot=dio -atmegazero_esp32s2.menu.FlashMode.qout=QOUT -atmegazero_esp32s2.menu.FlashMode.qout.build.flash_mode=dout -atmegazero_esp32s2.menu.FlashMode.qout.build.boot=qout -atmegazero_esp32s2.menu.FlashMode.dout=DOUT -atmegazero_esp32s2.menu.FlashMode.dout.build.flash_mode=dout -atmegazero_esp32s2.menu.FlashMode.dout.build.boot=dout - -atmegazero_esp32s2.menu.FlashFreq.80=80MHz -atmegazero_esp32s2.menu.FlashFreq.80.build.flash_freq=80m -atmegazero_esp32s2.menu.FlashFreq.40=40MHz -atmegazero_esp32s2.menu.FlashFreq.40.build.flash_freq=40m - -atmegazero_esp32s2.menu.FlashSize.4M=4MB (32Mb) -atmegazero_esp32s2.menu.FlashSize.4M.build.flash_size=4MB -atmegazero_esp32s2.menu.FlashSize.8M=8MB (64Mb) -atmegazero_esp32s2.menu.FlashSize.8M.build.flash_size=8MB -atmegazero_esp32s2.menu.FlashSize.8M.build.partitions=default_8MB -atmegazero_esp32s2.menu.FlashSize.2M=2MB (16Mb) -atmegazero_esp32s2.menu.FlashSize.2M.build.flash_size=2MB -atmegazero_esp32s2.menu.FlashSize.2M.build.partitions=minimal -atmegazero_esp32s2.menu.FlashSize.16M=16MB (128Mb) -atmegazero_esp32s2.menu.FlashSize.16M.build.flash_size=16MB - -atmegazero_esp32s2.menu.UploadSpeed.921600=921600 -atmegazero_esp32s2.menu.UploadSpeed.921600.upload.speed=921600 -atmegazero_esp32s2.menu.UploadSpeed.115200=115200 -atmegazero_esp32s2.menu.UploadSpeed.115200.upload.speed=115200 -atmegazero_esp32s2.menu.UploadSpeed.256000.windows=256000 -atmegazero_esp32s2.menu.UploadSpeed.256000.upload.speed=256000 -atmegazero_esp32s2.menu.UploadSpeed.230400.windows.upload.speed=256000 -atmegazero_esp32s2.menu.UploadSpeed.230400=230400 -atmegazero_esp32s2.menu.UploadSpeed.230400.upload.speed=230400 -atmegazero_esp32s2.menu.UploadSpeed.460800.linux=460800 -atmegazero_esp32s2.menu.UploadSpeed.460800.macosx=460800 -atmegazero_esp32s2.menu.UploadSpeed.460800.upload.speed=460800 -atmegazero_esp32s2.menu.UploadSpeed.512000.windows=512000 -atmegazero_esp32s2.menu.UploadSpeed.512000.upload.speed=512000 - -atmegazero_esp32s2.menu.DebugLevel.none=None -atmegazero_esp32s2.menu.DebugLevel.none.build.code_debug=0 -atmegazero_esp32s2.menu.DebugLevel.error=Error -atmegazero_esp32s2.menu.DebugLevel.error.build.code_debug=1 -atmegazero_esp32s2.menu.DebugLevel.warn=Warn -atmegazero_esp32s2.menu.DebugLevel.warn.build.code_debug=2 -atmegazero_esp32s2.menu.DebugLevel.info=Info -atmegazero_esp32s2.menu.DebugLevel.info.build.code_debug=3 -atmegazero_esp32s2.menu.DebugLevel.debug=Debug -atmegazero_esp32s2.menu.DebugLevel.debug.build.code_debug=4 -atmegazero_esp32s2.menu.DebugLevel.verbose=Verbose -atmegazero_esp32s2.menu.DebugLevel.verbose.build.code_debug=5 - -atmegazero_esp32s2.menu.EraseFlash.none=Disabled -atmegazero_esp32s2.menu.EraseFlash.none.upload.erase_cmd= -atmegazero_esp32s2.menu.EraseFlash.all=Enabled -atmegazero_esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e - -############################################################## - -deneyapmini.name=Deneyap Mini - -deneyapmini.vid.0=0x303a -deneyapmini.pid.0=0x0002 - -deneyapmini.bootloader.tool=esptool_py -deneyapmini.bootloader.tool.default=esptool_py - -deneyapmini.upload.tool=esptool_py -deneyapmini.upload.tool.default=esptool_py -deneyapmini.upload.tool.network=esp_ota - -deneyapmini.upload.maximum_size=1310720 -deneyapmini.upload.maximum_data_size=327680 -deneyapmini.upload.flags= -deneyapmini.upload.extra_flags= -deneyapmini.upload.use_1200bps_touch=false -deneyapmini.upload.wait_for_upload_port=false - -deneyapmini.serial.disableDTR=false -deneyapmini.serial.disableRTS=false - -deneyapmini.build.tarch=xtensa -deneyapmini.build.bootloader_addr=0x1000 -deneyapmini.build.target=esp32s2 -deneyapmini.build.mcu=esp32s2 -deneyapmini.build.core=esp32 -deneyapmini.build.variant=deneyapmini -deneyapmini.build.board=DYM - -deneyapmini.build.serial=0 -deneyapmini.build.f_cpu=240000000L -deneyapmini.build.flash_size=4MB -deneyapmini.build.flash_freq=80m -deneyapmini.build.flash_mode=qio -deneyapmini.build.boot=qio -deneyapmini.build.partitions=default -deneyapmini.build.defines= - -deneyapmini.menu.CDCOnBoot.default=Enabled -deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=1 -deneyapmini.menu.CDCOnBoot.cdc=Disabled -deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=0 - -deneyapmini.menu.MSCOnBoot.default=Disabled -deneyapmini.menu.MSCOnBoot.default.build.msc_on_boot=0 -deneyapmini.menu.MSCOnBoot.msc=Enabled -deneyapmini.menu.MSCOnBoot.msc.build.msc_on_boot=1 - -deneyapmini.menu.DFUOnBoot.default=Disabled -deneyapmini.menu.DFUOnBoot.default.build.dfu_on_boot=0 -deneyapmini.menu.DFUOnBoot.dfu=Enabled -deneyapmini.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 - -deneyapmini.menu.PSRAM.disabled=Disabled -deneyapmini.menu.PSRAM.disabled.build.defines= -deneyapmini.menu.PSRAM.enabled=Enabled -deneyapmini.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM - -deneyapmini.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -deneyapmini.menu.PartitionScheme.default.build.partitions=default -deneyapmini.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) -deneyapmini.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -deneyapmini.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) -deneyapmini.menu.PartitionScheme.default_8MB.build.partitions=default_8MB -deneyapmini.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 -deneyapmini.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) -deneyapmini.menu.PartitionScheme.minimal.build.partitions=minimal -deneyapmini.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) -deneyapmini.menu.PartitionScheme.no_ota.build.partitions=no_ota -deneyapmini.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -deneyapmini.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) -deneyapmini.menu.PartitionScheme.noota_3g.build.partitions=noota_3g -deneyapmini.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 -deneyapmini.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) -deneyapmini.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat -deneyapmini.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 -deneyapmini.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) -deneyapmini.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat -deneyapmini.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 -deneyapmini.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) -deneyapmini.menu.PartitionScheme.huge_app.build.partitions=huge_app -deneyapmini.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -deneyapmini.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) -deneyapmini.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -deneyapmini.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -deneyapmini.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) -deneyapmini.menu.PartitionScheme.fatflash.build.partitions=ffat -deneyapmini.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 -deneyapmini.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) -deneyapmini.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB -deneyapmini.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 - -deneyapmini.menu.CPUFreq.240=240MHz (WiFi) -deneyapmini.menu.CPUFreq.240.build.f_cpu=240000000L -deneyapmini.menu.CPUFreq.160=160MHz (WiFi) -deneyapmini.menu.CPUFreq.160.build.f_cpu=160000000L -deneyapmini.menu.CPUFreq.80=80MHz (WiFi) -deneyapmini.menu.CPUFreq.80.build.f_cpu=80000000L -deneyapmini.menu.CPUFreq.40=40MHz -deneyapmini.menu.CPUFreq.40.build.f_cpu=40000000L -deneyapmini.menu.CPUFreq.20=20MHz -deneyapmini.menu.CPUFreq.20.build.f_cpu=20000000L -deneyapmini.menu.CPUFreq.10=10MHz -deneyapmini.menu.CPUFreq.10.build.f_cpu=10000000L - -deneyapmini.menu.FlashMode.qio=QIO -deneyapmini.menu.FlashMode.qio.build.flash_mode=dio -deneyapmini.menu.FlashMode.qio.build.boot=qio -deneyapmini.menu.FlashMode.dio=DIO -deneyapmini.menu.FlashMode.dio.build.flash_mode=dio -deneyapmini.menu.FlashMode.dio.build.boot=dio -deneyapmini.menu.FlashMode.qout=QOUT -deneyapmini.menu.FlashMode.qout.build.flash_mode=dout -deneyapmini.menu.FlashMode.qout.build.boot=qout -deneyapmini.menu.FlashMode.dout=DOUT -deneyapmini.menu.FlashMode.dout.build.flash_mode=dout -deneyapmini.menu.FlashMode.dout.build.boot=dout +atmegazero_esp32s2.menu.CPUFreq.40.build.f_cpu=40000000L +atmegazero_esp32s2.menu.CPUFreq.20=20MHz +atmegazero_esp32s2.menu.CPUFreq.20.build.f_cpu=20000000L +atmegazero_esp32s2.menu.CPUFreq.10=10MHz +atmegazero_esp32s2.menu.CPUFreq.10.build.f_cpu=10000000L -deneyapmini.menu.FlashFreq.80=80MHz -deneyapmini.menu.FlashFreq.80.build.flash_freq=80m -deneyapmini.menu.FlashFreq.40=40MHz -deneyapmini.menu.FlashFreq.40.build.flash_freq=40m +atmegazero_esp32s2.menu.FlashMode.qio=QIO +atmegazero_esp32s2.menu.FlashMode.qio.build.flash_mode=dio +atmegazero_esp32s2.menu.FlashMode.qio.build.boot=qio +atmegazero_esp32s2.menu.FlashMode.dio=DIO +atmegazero_esp32s2.menu.FlashMode.dio.build.flash_mode=dio +atmegazero_esp32s2.menu.FlashMode.dio.build.boot=dio +atmegazero_esp32s2.menu.FlashMode.qout=QOUT +atmegazero_esp32s2.menu.FlashMode.qout.build.flash_mode=dout +atmegazero_esp32s2.menu.FlashMode.qout.build.boot=qout +atmegazero_esp32s2.menu.FlashMode.dout=DOUT +atmegazero_esp32s2.menu.FlashMode.dout.build.flash_mode=dout +atmegazero_esp32s2.menu.FlashMode.dout.build.boot=dout -deneyapmini.menu.FlashSize.4M=4MB (32Mb) -deneyapmini.menu.FlashSize.4M.build.flash_size=4MB -deneyapmini.menu.FlashSize.8M=8MB (64Mb) -deneyapmini.menu.FlashSize.8M.build.flash_size=8MB -deneyapmini.menu.FlashSize.8M.build.partitions=default_8MB -deneyapmini.menu.FlashSize.2M=2MB (16Mb) -deneyapmini.menu.FlashSize.2M.build.flash_size=2MB -deneyapmini.menu.FlashSize.2M.build.partitions=minimal -deneyapmini.menu.FlashSize.16M=16MB (128Mb) -deneyapmini.menu.FlashSize.16M.build.flash_size=16MB +atmegazero_esp32s2.menu.FlashFreq.80=80MHz +atmegazero_esp32s2.menu.FlashFreq.80.build.flash_freq=80m +atmegazero_esp32s2.menu.FlashFreq.40=40MHz +atmegazero_esp32s2.menu.FlashFreq.40.build.flash_freq=40m -deneyapmini.menu.UploadMode.default=Internal USB -deneyapmini.menu.UploadMode.default.upload.use_1200bps_touch=true -deneyapmini.menu.UploadMode.default.upload.wait_for_upload_port=true -deneyapmini.menu.UploadMode.default.upload.mode=default_reset -deneyapmini.menu.UploadMode.cdc=UART0 -deneyapmini.menu.UploadMode.cdc.upload.use_1200bps_touch=false -deneyapmini.menu.UploadMode.cdc.upload.wait_for_upload_port=false -deneyapmini.menu.UploadMode.cdc.upload.mode=default_reset +atmegazero_esp32s2.menu.FlashSize.4M=4MB (32Mb) +atmegazero_esp32s2.menu.FlashSize.4M.build.flash_size=4MB +atmegazero_esp32s2.menu.FlashSize.8M=8MB (64Mb) +atmegazero_esp32s2.menu.FlashSize.8M.build.flash_size=8MB +atmegazero_esp32s2.menu.FlashSize.8M.build.partitions=default_8MB +atmegazero_esp32s2.menu.FlashSize.2M=2MB (16Mb) +atmegazero_esp32s2.menu.FlashSize.2M.build.flash_size=2MB +atmegazero_esp32s2.menu.FlashSize.2M.build.partitions=minimal +atmegazero_esp32s2.menu.FlashSize.16M=16MB (128Mb) +atmegazero_esp32s2.menu.FlashSize.16M.build.flash_size=16MB -deneyapmini.menu.UploadSpeed.921600=921600 -deneyapmini.menu.UploadSpeed.921600.upload.speed=921600 -deneyapmini.menu.UploadSpeed.115200=115200 -deneyapmini.menu.UploadSpeed.115200.upload.speed=115200 -deneyapmini.menu.UploadSpeed.256000.windows=256000 -deneyapmini.menu.UploadSpeed.256000.upload.speed=256000 -deneyapmini.menu.UploadSpeed.230400.windows.upload.speed=256000 -deneyapmini.menu.UploadSpeed.230400=230400 -deneyapmini.menu.UploadSpeed.230400.upload.speed=230400 -deneyapmini.menu.UploadSpeed.460800.linux=460800 -deneyapmini.menu.UploadSpeed.460800.macosx=460800 -deneyapmini.menu.UploadSpeed.460800.upload.speed=460800 -deneyapmini.menu.UploadSpeed.512000.windows=512000 -deneyapmini.menu.UploadSpeed.512000.upload.speed=512000 +atmegazero_esp32s2.menu.UploadSpeed.921600=921600 +atmegazero_esp32s2.menu.UploadSpeed.921600.upload.speed=921600 +atmegazero_esp32s2.menu.UploadSpeed.115200=115200 +atmegazero_esp32s2.menu.UploadSpeed.115200.upload.speed=115200 +atmegazero_esp32s2.menu.UploadSpeed.256000.windows=256000 +atmegazero_esp32s2.menu.UploadSpeed.256000.upload.speed=256000 +atmegazero_esp32s2.menu.UploadSpeed.230400.windows.upload.speed=256000 +atmegazero_esp32s2.menu.UploadSpeed.230400=230400 +atmegazero_esp32s2.menu.UploadSpeed.230400.upload.speed=230400 +atmegazero_esp32s2.menu.UploadSpeed.460800.linux=460800 +atmegazero_esp32s2.menu.UploadSpeed.460800.macosx=460800 +atmegazero_esp32s2.menu.UploadSpeed.460800.upload.speed=460800 +atmegazero_esp32s2.menu.UploadSpeed.512000.windows=512000 +atmegazero_esp32s2.menu.UploadSpeed.512000.upload.speed=512000 -deneyapmini.menu.DebugLevel.none=None -deneyapmini.menu.DebugLevel.none.build.code_debug=0 -deneyapmini.menu.DebugLevel.error=Error -deneyapmini.menu.DebugLevel.error.build.code_debug=1 -deneyapmini.menu.DebugLevel.warn=Warn -deneyapmini.menu.DebugLevel.warn.build.code_debug=2 -deneyapmini.menu.DebugLevel.info=Info -deneyapmini.menu.DebugLevel.info.build.code_debug=3 -deneyapmini.menu.DebugLevel.debug=Debug -deneyapmini.menu.DebugLevel.debug.build.code_debug=4 -deneyapmini.menu.DebugLevel.verbose=Verbose -deneyapmini.menu.DebugLevel.verbose.build.code_debug=5 +atmegazero_esp32s2.menu.DebugLevel.none=None +atmegazero_esp32s2.menu.DebugLevel.none.build.code_debug=0 +atmegazero_esp32s2.menu.DebugLevel.error=Error +atmegazero_esp32s2.menu.DebugLevel.error.build.code_debug=1 +atmegazero_esp32s2.menu.DebugLevel.warn=Warn +atmegazero_esp32s2.menu.DebugLevel.warn.build.code_debug=2 +atmegazero_esp32s2.menu.DebugLevel.info=Info +atmegazero_esp32s2.menu.DebugLevel.info.build.code_debug=3 +atmegazero_esp32s2.menu.DebugLevel.debug=Debug +atmegazero_esp32s2.menu.DebugLevel.debug.build.code_debug=4 +atmegazero_esp32s2.menu.DebugLevel.verbose=Verbose +atmegazero_esp32s2.menu.DebugLevel.verbose.build.code_debug=5 -deneyapmini.menu.EraseFlash.none=Disabled -deneyapmini.menu.EraseFlash.none.upload.erase_cmd= -deneyapmini.menu.EraseFlash.all=Enabled -deneyapmini.menu.EraseFlash.all.upload.erase_cmd=-e +atmegazero_esp32s2.menu.EraseFlash.none=Disabled +atmegazero_esp32s2.menu.EraseFlash.none.upload.erase_cmd= +atmegazero_esp32s2.menu.EraseFlash.all=Enabled +atmegazero_esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## @@ -15880,6 +17103,213 @@ franzininho_wifi_msc_esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +tamc_termod_s3.name=TAMC Termod S3 +tamc_termod_s3.vid.0=0x303a +tamc_termod_s3.pid.0=0x1001 + +tamc_termod_s3.bootloader.tool=esptool_py +tamc_termod_s3.bootloader.tool.default=esptool_py + +tamc_termod_s3.upload.tool=esptool_py +tamc_termod_s3.upload.tool.default=esptool_py +tamc_termod_s3.upload.tool.network=esp_ota + +tamc_termod_s3.upload.maximum_size=1310720 +tamc_termod_s3.upload.maximum_data_size=327680 +tamc_termod_s3.upload.flags= +tamc_termod_s3.upload.extra_flags= +tamc_termod_s3.upload.use_1200bps_touch=false +tamc_termod_s3.upload.wait_for_upload_port=false + +tamc_termod_s3.serial.disableDTR=false +tamc_termod_s3.serial.disableRTS=false + +tamc_termod_s3.build.tarch=xtensa +tamc_termod_s3.build.bootloader_addr=0x0 +tamc_termod_s3.build.target=esp32s3 +tamc_termod_s3.build.mcu=esp32s3 +tamc_termod_s3.build.core=esp32 +tamc_termod_s3.build.variant=tamc_termod_s3 +tamc_termod_s3.build.board=TAMC_TERMOD_S3 + +tamc_termod_s3.build.usb_mode=1 +tamc_termod_s3.build.cdc_on_boot=1 +tamc_termod_s3.build.msc_on_boot=0 +tamc_termod_s3.build.dfu_on_boot=0 +tamc_termod_s3.build.f_cpu=240000000L +tamc_termod_s3.build.flash_size=8MB +tamc_termod_s3.build.flash_freq=80m +tamc_termod_s3.build.flash_mode=dio +tamc_termod_s3.build.boot=qio +tamc_termod_s3.build.boot_freq=80m +tamc_termod_s3.build.partitions=default +tamc_termod_s3.build.defines= +tamc_termod_s3.build.loop_core= +tamc_termod_s3.build.event_core= +tamc_termod_s3.build.psram_type=qspi +tamc_termod_s3.build.memory_type={build.boot}_{build.psram_type} + +tamc_termod_s3.menu.PSRAM.enabled=QSPI PSRAM +tamc_termod_s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +tamc_termod_s3.menu.PSRAM.enabled.build.psram_type=qspi +tamc_termod_s3.menu.PSRAM.disabled=Disabled +tamc_termod_s3.menu.PSRAM.disabled.build.defines= +tamc_termod_s3.menu.PSRAM.disabled.build.psram_type=qspi +tamc_termod_s3.menu.PSRAM.opi=OPI PSRAM +tamc_termod_s3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +tamc_termod_s3.menu.PSRAM.opi.build.psram_type=opi + +tamc_termod_s3.menu.FlashMode.qio=QIO 80MHz +tamc_termod_s3.menu.FlashMode.qio.build.flash_mode=dio +tamc_termod_s3.menu.FlashMode.qio.build.boot=qio +tamc_termod_s3.menu.FlashMode.qio.build.boot_freq=80m +tamc_termod_s3.menu.FlashMode.qio.build.flash_freq=80m +tamc_termod_s3.menu.FlashMode.qio120=QIO 120MHz +tamc_termod_s3.menu.FlashMode.qio120.build.flash_mode=dio +tamc_termod_s3.menu.FlashMode.qio120.build.boot=qio +tamc_termod_s3.menu.FlashMode.qio120.build.boot_freq=120m +tamc_termod_s3.menu.FlashMode.qio120.build.flash_freq=80m +tamc_termod_s3.menu.FlashMode.dio=DIO 80MHz +tamc_termod_s3.menu.FlashMode.dio.build.flash_mode=dio +tamc_termod_s3.menu.FlashMode.dio.build.boot=dio +tamc_termod_s3.menu.FlashMode.dio.build.boot_freq=80m +tamc_termod_s3.menu.FlashMode.dio.build.flash_freq=80m +tamc_termod_s3.menu.FlashMode.opi=OPI 80MHz +tamc_termod_s3.menu.FlashMode.opi.build.flash_mode=dout +tamc_termod_s3.menu.FlashMode.opi.build.boot=opi +tamc_termod_s3.menu.FlashMode.opi.build.boot_freq=80m +tamc_termod_s3.menu.FlashMode.opi.build.flash_freq=80m + +tamc_termod_s3.menu.FlashSize.4M=4MB (32Mb) +tamc_termod_s3.menu.FlashSize.4M.build.flash_size=4MB +tamc_termod_s3.menu.FlashSize.8M=8MB (64Mb) +tamc_termod_s3.menu.FlashSize.8M.build.flash_size=8MB +tamc_termod_s3.menu.FlashSize.8M.build.partitions=default_8MB +tamc_termod_s3.menu.FlashSize.16M=16MB (128Mb) +tamc_termod_s3.menu.FlashSize.16M.build.flash_size=16MB + +tamc_termod_s3.menu.LoopCore.1=Core 1 +tamc_termod_s3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +tamc_termod_s3.menu.LoopCore.0=Core 0 +tamc_termod_s3.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +tamc_termod_s3.menu.EventsCore.1=Core 1 +tamc_termod_s3.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +tamc_termod_s3.menu.EventsCore.0=Core 0 +tamc_termod_s3.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +tamc_termod_s3.menu.USBMode.hwcdc=Hardware CDC and JTAG +tamc_termod_s3.menu.USBMode.hwcdc.build.usb_mode=1 +tamc_termod_s3.menu.USBMode.default=USB-OTG (TinyUSB) +tamc_termod_s3.menu.USBMode.default.build.usb_mode=0 + +tamc_termod_s3.menu.CDCOnBoot.cdc=Enabled +tamc_termod_s3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +tamc_termod_s3.menu.CDCOnBoot.default=Disabled +tamc_termod_s3.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +tamc_termod_s3.menu.MSCOnBoot.default=Disabled +tamc_termod_s3.menu.MSCOnBoot.default.build.msc_on_boot=0 +tamc_termod_s3.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +tamc_termod_s3.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +tamc_termod_s3.menu.DFUOnBoot.default=Disabled +tamc_termod_s3.menu.DFUOnBoot.default.build.dfu_on_boot=0 +tamc_termod_s3.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +tamc_termod_s3.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +tamc_termod_s3.menu.UploadMode.default=UART0 / Hardware CDC +tamc_termod_s3.menu.UploadMode.default.upload.use_1200bps_touch=false +tamc_termod_s3.menu.UploadMode.default.upload.wait_for_upload_port=false +tamc_termod_s3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +tamc_termod_s3.menu.UploadMode.cdc.upload.use_1200bps_touch=true +tamc_termod_s3.menu.UploadMode.cdc.upload.wait_for_upload_port=true + +tamc_termod_s3.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +tamc_termod_s3.menu.PartitionScheme.default.build.partitions=default +tamc_termod_s3.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +tamc_termod_s3.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +tamc_termod_s3.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +tamc_termod_s3.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +tamc_termod_s3.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +tamc_termod_s3.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +tamc_termod_s3.menu.PartitionScheme.minimal.build.partitions=minimal +tamc_termod_s3.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +tamc_termod_s3.menu.PartitionScheme.no_ota.build.partitions=no_ota +tamc_termod_s3.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +tamc_termod_s3.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +tamc_termod_s3.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +tamc_termod_s3.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +tamc_termod_s3.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +tamc_termod_s3.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +tamc_termod_s3.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +tamc_termod_s3.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +tamc_termod_s3.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +tamc_termod_s3.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +tamc_termod_s3.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +tamc_termod_s3.menu.PartitionScheme.huge_app.build.partitions=huge_app +tamc_termod_s3.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +tamc_termod_s3.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +tamc_termod_s3.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +tamc_termod_s3.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +tamc_termod_s3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +tamc_termod_s3.menu.PartitionScheme.fatflash.build.partitions=ffat +tamc_termod_s3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +tamc_termod_s3.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) +tamc_termod_s3.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +tamc_termod_s3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +tamc_termod_s3.menu.PartitionScheme.rainmaker=RainMaker +tamc_termod_s3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +tamc_termod_s3.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +tamc_termod_s3.menu.CPUFreq.240=240MHz (WiFi) +tamc_termod_s3.menu.CPUFreq.240.build.f_cpu=240000000L +tamc_termod_s3.menu.CPUFreq.160=160MHz (WiFi) +tamc_termod_s3.menu.CPUFreq.160.build.f_cpu=160000000L +tamc_termod_s3.menu.CPUFreq.80=80MHz (WiFi) +tamc_termod_s3.menu.CPUFreq.80.build.f_cpu=80000000L +tamc_termod_s3.menu.CPUFreq.40=40MHz +tamc_termod_s3.menu.CPUFreq.40.build.f_cpu=40000000L +tamc_termod_s3.menu.CPUFreq.20=20MHz +tamc_termod_s3.menu.CPUFreq.20.build.f_cpu=20000000L +tamc_termod_s3.menu.CPUFreq.10=10MHz +tamc_termod_s3.menu.CPUFreq.10.build.f_cpu=10000000L + +tamc_termod_s3.menu.UploadSpeed.921600=921600 +tamc_termod_s3.menu.UploadSpeed.921600.upload.speed=921600 +tamc_termod_s3.menu.UploadSpeed.115200=115200 +tamc_termod_s3.menu.UploadSpeed.115200.upload.speed=115200 +tamc_termod_s3.menu.UploadSpeed.256000.windows=256000 +tamc_termod_s3.menu.UploadSpeed.256000.upload.speed=256000 +tamc_termod_s3.menu.UploadSpeed.230400.windows.upload.speed=256000 +tamc_termod_s3.menu.UploadSpeed.230400=230400 +tamc_termod_s3.menu.UploadSpeed.230400.upload.speed=230400 +tamc_termod_s3.menu.UploadSpeed.460800.linux=460800 +tamc_termod_s3.menu.UploadSpeed.460800.macosx=460800 +tamc_termod_s3.menu.UploadSpeed.460800.upload.speed=460800 +tamc_termod_s3.menu.UploadSpeed.512000.windows=512000 +tamc_termod_s3.menu.UploadSpeed.512000.upload.speed=512000 + +tamc_termod_s3.menu.DebugLevel.none=None +tamc_termod_s3.menu.DebugLevel.none.build.code_debug=0 +tamc_termod_s3.menu.DebugLevel.error=Error +tamc_termod_s3.menu.DebugLevel.error.build.code_debug=1 +tamc_termod_s3.menu.DebugLevel.warn=Warn +tamc_termod_s3.menu.DebugLevel.warn.build.code_debug=2 +tamc_termod_s3.menu.DebugLevel.info=Info +tamc_termod_s3.menu.DebugLevel.info.build.code_debug=3 +tamc_termod_s3.menu.DebugLevel.debug=Debug +tamc_termod_s3.menu.DebugLevel.debug.build.code_debug=4 +tamc_termod_s3.menu.DebugLevel.verbose=Verbose +tamc_termod_s3.menu.DebugLevel.verbose.build.code_debug=5 + +tamc_termod_s3.menu.EraseFlash.none=Disabled +tamc_termod_s3.menu.EraseFlash.none.upload.erase_cmd= +tamc_termod_s3.menu.EraseFlash.all=Enabled +tamc_termod_s3.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## + dpu_esp32.name=DPU ESP32 dpu_esp32.bootloader.tool=esptool_py @@ -16350,149 +17780,13 @@ watchy.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## -deneyapkart1A.name=Deneyap Kart 1A - -deneyapkart1A.bootloader.tool=esptool_py -deneyapkart1A.bootloader.tool.default=esptool_py - -deneyapkart1A.upload.tool=esptool_py -deneyapkart1A.upload.tool.default=esptool_py -deneyapkart1A.upload.tool.network=esp_ota - -deneyapkart1A.upload.maximum_size=1310720 -deneyapkart1A.upload.maximum_data_size=327680 -deneyapkart1A.upload.wait_for_upload_port=true -deneyapkart1A.upload.flags= -deneyapkart1A.upload.extra_flags= - -deneyapkart1A.serial.disableDTR=true -deneyapkart1A.serial.disableRTS=true - -deneyapkart1A.build.tarch=xtensa -deneyapkart1A.build.bootloader_addr=0x1000 -deneyapkart1A.build.target=esp32 -deneyapkart1A.build.mcu=esp32 -deneyapkart1A.build.core=esp32 -deneyapkart1A.build.variant=deneyapkart1A -deneyapkart1A.build.board=DYDK1A - -deneyapkart1A.build.f_cpu=240000000L -deneyapkart1A.build.flash_size=4MB -deneyapkart1A.build.flash_freq=40m -deneyapkart1A.build.flash_mode=dio -deneyapkart1A.build.boot=dio -deneyapkart1A.build.partitions=default -deneyapkart1A.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -deneyapkart1A.build.extra_libs= - -deneyapkart1A.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -deneyapkart1A.menu.PartitionScheme.default.build.partitions=default -deneyapkart1A.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) -deneyapkart1A.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -deneyapkart1A.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) -deneyapkart1A.menu.PartitionScheme.default_8MB.build.partitions=default_8MB -deneyapkart1A.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 -deneyapkart1A.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) -deneyapkart1A.menu.PartitionScheme.minimal.build.partitions=minimal -deneyapkart1A.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) -deneyapkart1A.menu.PartitionScheme.no_ota.build.partitions=no_ota -deneyapkart1A.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -deneyapkart1A.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) -deneyapkart1A.menu.PartitionScheme.noota_3g.build.partitions=noota_3g -deneyapkart1A.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 -deneyapkart1A.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) -deneyapkart1A.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat -deneyapkart1A.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 -deneyapkart1A.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) -deneyapkart1A.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat -deneyapkart1A.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 -deneyapkart1A.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) -deneyapkart1A.menu.PartitionScheme.huge_app.build.partitions=huge_app -deneyapkart1A.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -deneyapkart1A.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) -deneyapkart1A.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -deneyapkart1A.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -deneyapkart1A.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS) -deneyapkart1A.menu.PartitionScheme.fatflash.build.partitions=ffat -deneyapkart1A.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 -deneyapkart1A.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS) -deneyapkart1A.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB -deneyapkart1A.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 -deneyapkart1A.menu.PartitionScheme.rainmaker=RainMaker -deneyapkart1A.menu.PartitionScheme.rainmaker.build.partitions=rainmaker -deneyapkart1A.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 - -deneyapkart1A.menu.CPUFreq.240=240MHz (WiFi/BT) -deneyapkart1A.menu.CPUFreq.240.build.f_cpu=240000000L -deneyapkart1A.menu.CPUFreq.160=160MHz (WiFi/BT) -deneyapkart1A.menu.CPUFreq.160.build.f_cpu=160000000L -deneyapkart1A.menu.CPUFreq.80=80MHz (WiFi/BT) -deneyapkart1A.menu.CPUFreq.80.build.f_cpu=80000000L -deneyapkart1A.menu.CPUFreq.40=40MHz -deneyapkart1A.menu.CPUFreq.40.build.f_cpu=40000000L -deneyapkart1A.menu.CPUFreq.20=20MHz -deneyapkart1A.menu.CPUFreq.20.build.f_cpu=20000000L -deneyapkart1A.menu.CPUFreq.10=10MHz -deneyapkart1A.menu.CPUFreq.10.build.f_cpu=10000000L - -deneyapkart1A.menu.FlashMode.qio=QIO -deneyapkart1A.menu.FlashMode.qio.build.flash_mode=dio -deneyapkart1A.menu.FlashMode.qio.build.boot=qio -deneyapkart1A.menu.FlashMode.dio=DIO -deneyapkart1A.menu.FlashMode.dio.build.flash_mode=dio -deneyapkart1A.menu.FlashMode.dio.build.boot=dio -deneyapkart1A.menu.FlashMode.qout=QOUT -deneyapkart1A.menu.FlashMode.qout.build.flash_mode=dout -deneyapkart1A.menu.FlashMode.qout.build.boot=qout -deneyapkart1A.menu.FlashMode.dout=DOUT -deneyapkart1A.menu.FlashMode.dout.build.flash_mode=dout -deneyapkart1A.menu.FlashMode.dout.build.boot=dout - -deneyapkart1A.menu.FlashFreq.80=80MHz -deneyapkart1A.menu.FlashFreq.80.build.flash_freq=80m -deneyapkart1A.menu.FlashFreq.40=40MHz -deneyapkart1A.menu.FlashFreq.40.build.flash_freq=40m - -deneyapkart1A.menu.UploadSpeed.921600=921600 -deneyapkart1A.menu.UploadSpeed.921600.upload.speed=921600 -deneyapkart1A.menu.UploadSpeed.115200=115200 -deneyapkart1A.menu.UploadSpeed.115200.upload.speed=115200 -deneyapkart1A.menu.UploadSpeed.256000.windows=256000 -deneyapkart1A.menu.UploadSpeed.256000.upload.speed=256000 -deneyapkart1A.menu.UploadSpeed.230400.windows.upload.speed=256000 -deneyapkart1A.menu.UploadSpeed.230400=230400 -deneyapkart1A.menu.UploadSpeed.230400.upload.speed=230400 -deneyapkart1A.menu.UploadSpeed.460800.linux=460800 -deneyapkart1A.menu.UploadSpeed.460800.macosx=460800 -deneyapkart1A.menu.UploadSpeed.460800.upload.speed=460800 -deneyapkart1A.menu.UploadSpeed.512000.windows=512000 -deneyapkart1A.menu.UploadSpeed.512000.upload.speed=512000 - -deneyapkart1A.menu.DebugLevel.none=None -deneyapkart1A.menu.DebugLevel.none.build.code_debug=0 -deneyapkart1A.menu.DebugLevel.error=Error -deneyapkart1A.menu.DebugLevel.error.build.code_debug=1 -deneyapkart1A.menu.DebugLevel.warn=Warn -deneyapkart1A.menu.DebugLevel.warn.build.code_debug=2 -deneyapkart1A.menu.DebugLevel.info=Info -deneyapkart1A.menu.DebugLevel.info.build.code_debug=3 -deneyapkart1A.menu.DebugLevel.debug=Debug -deneyapkart1A.menu.DebugLevel.debug.build.code_debug=4 -deneyapkart1A.menu.DebugLevel.verbose=Verbose -deneyapkart1A.menu.DebugLevel.verbose.build.code_debug=5 - -deneyapkart1A.menu.EraseFlash.none=Disabled -deneyapkart1A.menu.EraseFlash.none.upload.erase_cmd= -deneyapkart1A.menu.EraseFlash.all=Enabled -deneyapkart1A.menu.EraseFlash.all.upload.erase_cmd=-e - -############################################################## - AirM2M_CORE_ESP32C3.name=AirM2M_CORE_ESP32C3 AirM2M_CORE_ESP32C3.vid.0=0x303a AirM2M_CORE_ESP32C3.pid.0=0x1001 AirM2M_CORE_ESP32C3.upload.tool=esptool_py +AirM2M_CORE_ESP32C3.upload.tool.default=esptool_py +AirM2M_CORE_ESP32C3.upload.tool.network=esp_ota AirM2M_CORE_ESP32C3.upload.maximum_size=1310720 AirM2M_CORE_ESP32C3.upload.maximum_data_size=327680 AirM2M_CORE_ESP32C3.upload.flags= @@ -16587,6 +17881,11 @@ AirM2M_CORE_ESP32C3.menu.DebugLevel.debug.build.code_debug=4 AirM2M_CORE_ESP32C3.menu.DebugLevel.verbose=Verbose AirM2M_CORE_ESP32C3.menu.DebugLevel.verbose.build.code_debug=5 +AirM2M_CORE_ESP32C3.menu.EraseFlash.none=Disabled +AirM2M_CORE_ESP32C3.menu.EraseFlash.none.upload.erase_cmd= +AirM2M_CORE_ESP32C3.menu.EraseFlash.all=Enabled +AirM2M_CORE_ESP32C3.menu.EraseFlash.all.upload.erase_cmd=-e + ############################################################# @@ -16939,7 +18238,7 @@ aw2eth.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## -department_of_alchemy_minimain_esp32s2.name=Deparment of Alchemy MiniMain ESP32-S2 +department_of_alchemy_minimain_esp32s2.name=Department of Alchemy MiniMain ESP32-S2 department_of_alchemy_minimain_esp32s2.vid.0=0x303A department_of_alchemy_minimain_esp32s2.pid.0=0x80FF @@ -17867,7 +19166,7 @@ unphone9.build.partitions=default_8MB unphone9.build.defines=-DBOARD_HAS_PSRAM -DUNPHONE_SPIN=9 unphone9.build.loop_core=-DARDUINO_RUNNING_CORE=1 unphone9.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 -unphone9.build.flash_type=qspi +unphone9.build.flash_type=qio unphone9.build.psram_type=qspi unphone9.build.memory_type={build.flash_type}_{build.psram_type} @@ -17978,3 +19277,178 @@ unphone9.menu.EraseFlash.all=Enabled unphone9.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################### +# Cytron Maker Feather AIoT S3 + +cytron_maker_feather_aiot_s3.name=Cytron Maker Feather AIoT S3 +cytron_maker_feather_aiot_s3.vid.0=0x303a +cytron_maker_feather_aiot_s3.pid.0=0x80f8 + +cytron_maker_feather_aiot_s3.bootloader.tool=esptool_py +cytron_maker_feather_aiot_s3.bootloader.tool.default=esptool_py + +cytron_maker_feather_aiot_s3.upload.tool=esptool_py +cytron_maker_feather_aiot_s3.upload.tool.default=esptool_py +cytron_maker_feather_aiot_s3.upload.tool.network=esp_ota + +cytron_maker_feather_aiot_s3.upload.maximum_size=1310720 +cytron_maker_feather_aiot_s3.upload.maximum_data_size=327680 +cytron_maker_feather_aiot_s3.upload.flags= +cytron_maker_feather_aiot_s3.upload.extra_flags= +cytron_maker_feather_aiot_s3.upload.use_1200bps_touch=true +cytron_maker_feather_aiot_s3.upload.wait_for_upload_port=true + +cytron_maker_feather_aiot_s3.serial.disableDTR=false +cytron_maker_feather_aiot_s3.serial.disableRTS=false + +cytron_maker_feather_aiot_s3.build.tarch=xtensa +cytron_maker_feather_aiot_s3.build.bootloader_addr=0x0 +cytron_maker_feather_aiot_s3.build.target=esp32s3 +cytron_maker_feather_aiot_s3.build.mcu=esp32s3 +cytron_maker_feather_aiot_s3.build.core=esp32 +cytron_maker_feather_aiot_s3.build.variant=cytron_maker_feather_aiot_s3 +cytron_maker_feather_aiot_s3.build.board=CYTRON_MAKER_FEATHER_AIOT_S3 + +cytron_maker_feather_aiot_s3.build.usb_mode=0 +cytron_maker_feather_aiot_s3.build.cdc_on_boot=1 +cytron_maker_feather_aiot_s3.build.msc_on_boot=0 +cytron_maker_feather_aiot_s3.build.dfu_on_boot=0 +cytron_maker_feather_aiot_s3.build.f_cpu=240000000L +cytron_maker_feather_aiot_s3.build.flash_size=8MB +cytron_maker_feather_aiot_s3.build.flash_freq=80m +cytron_maker_feather_aiot_s3.build.flash_mode=dio +cytron_maker_feather_aiot_s3.build.boot=qio +cytron_maker_feather_aiot_s3.build.partitions=default +cytron_maker_feather_aiot_s3.build.defines= +cytron_maker_feather_aiot_s3.build.loop_core= +cytron_maker_feather_aiot_s3.build.event_core= +cytron_maker_feather_aiot_s3.build.flash_type=qio +cytron_maker_feather_aiot_s3.build.psram_type=opi +cytron_maker_feather_aiot_s3.build.memory_type={build.flash_type}_{build.psram_type} + +cytron_maker_feather_aiot_s3.menu.LoopCore.1=Core 1 +cytron_maker_feather_aiot_s3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +cytron_maker_feather_aiot_s3.menu.LoopCore.0=Core 0 +cytron_maker_feather_aiot_s3.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +cytron_maker_feather_aiot_s3.menu.EventsCore.1=Core 1 +cytron_maker_feather_aiot_s3.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +cytron_maker_feather_aiot_s3.menu.EventsCore.0=Core 0 +cytron_maker_feather_aiot_s3.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + +cytron_maker_feather_aiot_s3.menu.USBMode.default=USB-OTG (TinyUSB) +cytron_maker_feather_aiot_s3.menu.USBMode.default.build.usb_mode=0 +cytron_maker_feather_aiot_s3.menu.USBMode.hwcdc=Hardware CDC and JTAG +cytron_maker_feather_aiot_s3.menu.USBMode.hwcdc.build.usb_mode=1 + +cytron_maker_feather_aiot_s3.menu.CDCOnBoot.cdc=Enabled +cytron_maker_feather_aiot_s3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +cytron_maker_feather_aiot_s3.menu.CDCOnBoot.default=Disabled +cytron_maker_feather_aiot_s3.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +cytron_maker_feather_aiot_s3.menu.MSCOnBoot.default=Disabled +cytron_maker_feather_aiot_s3.menu.MSCOnBoot.default.build.msc_on_boot=0 +cytron_maker_feather_aiot_s3.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode) +cytron_maker_feather_aiot_s3.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +cytron_maker_feather_aiot_s3.menu.DFUOnBoot.default=Disabled +cytron_maker_feather_aiot_s3.menu.DFUOnBoot.default.build.dfu_on_boot=0 +cytron_maker_feather_aiot_s3.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode) +cytron_maker_feather_aiot_s3.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +cytron_maker_feather_aiot_s3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) +cytron_maker_feather_aiot_s3.menu.UploadMode.cdc.upload.use_1200bps_touch=true +cytron_maker_feather_aiot_s3.menu.UploadMode.cdc.upload.wait_for_upload_port=true +cytron_maker_feather_aiot_s3.menu.UploadMode.default=UART0 / Hardware CDC +cytron_maker_feather_aiot_s3.menu.UploadMode.default.upload.use_1200bps_touch=false +cytron_maker_feather_aiot_s3.menu.UploadMode.default.upload.wait_for_upload_port=false + +cytron_maker_feather_aiot_s3.menu.PSRAM.opi=OPI PSRAM +cytron_maker_feather_aiot_s3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +cytron_maker_feather_aiot_s3.menu.PSRAM.opi.build.psram_type=opi +cytron_maker_feather_aiot_s3.menu.PSRAM.enabled=QSPI PSRAM +cytron_maker_feather_aiot_s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +cytron_maker_feather_aiot_s3.menu.PSRAM.enabled.build.psram_type=qspi +cytron_maker_feather_aiot_s3.menu.PSRAM.disabled=Disabled +cytron_maker_feather_aiot_s3.menu.PSRAM.disabled.build.defines= +cytron_maker_feather_aiot_s3.menu.PSRAM.disabled.build.psram_type=qspi + +cytron_maker_feather_aiot_s3.menu.PartitionScheme.tinyuf2=TinyUF2 8MB (2MB APP/3.7MB FFAT) +cytron_maker_feather_aiot_s3.menu.PartitionScheme.tinyuf2.build.custom_bootloader=bootloader-tinyuf2 +cytron_maker_feather_aiot_s3.menu.PartitionScheme.tinyuf2.build.custom_partitions=partitions-8MB-tinyuf2 +cytron_maker_feather_aiot_s3.menu.PartitionScheme.tinyuf2.upload.maximum_size=2097152 +cytron_maker_feather_aiot_s3.menu.PartitionScheme.tinyuf2.upload.extra_flags=0x410000 "{runtime.platform.path}/variants/{build.variant}/tinyuf2.bin" +cytron_maker_feather_aiot_s3.menu.PartitionScheme.default_8MB=Default (3MB APP/1.5MB SPIFFS) +cytron_maker_feather_aiot_s3.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +cytron_maker_feather_aiot_s3.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 + +cytron_maker_feather_aiot_s3.menu.CPUFreq.240=240MHz (WiFi) +cytron_maker_feather_aiot_s3.menu.CPUFreq.240.build.f_cpu=240000000L +cytron_maker_feather_aiot_s3.menu.CPUFreq.160=160MHz (WiFi) +cytron_maker_feather_aiot_s3.menu.CPUFreq.160.build.f_cpu=160000000L +cytron_maker_feather_aiot_s3.menu.CPUFreq.80=80MHz (WiFi) +cytron_maker_feather_aiot_s3.menu.CPUFreq.80.build.f_cpu=80000000L +cytron_maker_feather_aiot_s3.menu.CPUFreq.40=40MHz +cytron_maker_feather_aiot_s3.menu.CPUFreq.40.build.f_cpu=40000000L +cytron_maker_feather_aiot_s3.menu.CPUFreq.20=20MHz +cytron_maker_feather_aiot_s3.menu.CPUFreq.20.build.f_cpu=20000000L +cytron_maker_feather_aiot_s3.menu.CPUFreq.10=10MHz +cytron_maker_feather_aiot_s3.menu.CPUFreq.10.build.f_cpu=10000000L + +cytron_maker_feather_aiot_s3.menu.FlashMode.qio=QIO 80MHz +cytron_maker_feather_aiot_s3.menu.FlashMode.qio.build.flash_mode=dio +cytron_maker_feather_aiot_s3.menu.FlashMode.qio.build.boot=qio +cytron_maker_feather_aiot_s3.menu.FlashMode.qio.build.boot_freq=80m +cytron_maker_feather_aiot_s3.menu.FlashMode.qio.build.flash_freq=80m +cytron_maker_feather_aiot_s3.menu.FlashMode.qio120=QIO 120MHz +cytron_maker_feather_aiot_s3.menu.FlashMode.qio120.build.flash_mode=dio +cytron_maker_feather_aiot_s3.menu.FlashMode.qio120.build.boot=qio +cytron_maker_feather_aiot_s3.menu.FlashMode.qio120.build.boot_freq=120m +cytron_maker_feather_aiot_s3.menu.FlashMode.qio120.build.flash_freq=80m +cytron_maker_feather_aiot_s3.menu.FlashMode.dio=DIO 80MHz +cytron_maker_feather_aiot_s3.menu.FlashMode.dio.build.flash_mode=dio +cytron_maker_feather_aiot_s3.menu.FlashMode.dio.build.boot=dio +cytron_maker_feather_aiot_s3.menu.FlashMode.dio.build.boot_freq=80m +cytron_maker_feather_aiot_s3.menu.FlashMode.dio.build.flash_freq=80m +cytron_maker_feather_aiot_s3.menu.FlashMode.opi=OPI 80MHz +cytron_maker_feather_aiot_s3.menu.FlashMode.opi.build.flash_mode=dout +cytron_maker_feather_aiot_s3.menu.FlashMode.opi.build.boot=opi +cytron_maker_feather_aiot_s3.menu.FlashMode.opi.build.boot_freq=80m +cytron_maker_feather_aiot_s3.menu.FlashMode.opi.build.flash_freq=80m + +cytron_maker_feather_aiot_s3.menu.FlashSize.8M=8MB (64Mb) +cytron_maker_feather_aiot_s3.menu.FlashSize.8M.build.flash_size=8MB + +cytron_maker_feather_aiot_s3.menu.UploadSpeed.921600=921600 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.921600.upload.speed=921600 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.115200=115200 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.115200.upload.speed=115200 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.256000.windows=256000 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.256000.upload.speed=256000 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.230400.windows.upload.speed=256000 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.230400=230400 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.230400.upload.speed=230400 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.460800.linux=460800 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.460800.macosx=460800 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.460800.upload.speed=460800 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.512000.windows=512000 +cytron_maker_feather_aiot_s3.menu.UploadSpeed.512000.upload.speed=512000 + +cytron_maker_feather_aiot_s3.menu.DebugLevel.none=None +cytron_maker_feather_aiot_s3.menu.DebugLevel.none.build.code_debug=0 +cytron_maker_feather_aiot_s3.menu.DebugLevel.error=Error +cytron_maker_feather_aiot_s3.menu.DebugLevel.error.build.code_debug=1 +cytron_maker_feather_aiot_s3.menu.DebugLevel.warn=Warn +cytron_maker_feather_aiot_s3.menu.DebugLevel.warn.build.code_debug=2 +cytron_maker_feather_aiot_s3.menu.DebugLevel.info=Info +cytron_maker_feather_aiot_s3.menu.DebugLevel.info.build.code_debug=3 +cytron_maker_feather_aiot_s3.menu.DebugLevel.debug=Debug +cytron_maker_feather_aiot_s3.menu.DebugLevel.debug.build.code_debug=4 +cytron_maker_feather_aiot_s3.menu.DebugLevel.verbose=Verbose +cytron_maker_feather_aiot_s3.menu.DebugLevel.verbose.build.code_debug=5 + +cytron_maker_feather_aiot_s3.menu.EraseFlash.none=Disabled +cytron_maker_feather_aiot_s3.menu.EraseFlash.none.upload.erase_cmd= +cytron_maker_feather_aiot_s3.menu.EraseFlash.all=Enabled +cytron_maker_feather_aiot_s3.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index d2f641c5882..8b0aa220d98 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -79,8 +79,9 @@ #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x)) -#define sei() -#define cli() +// ESP32xx runs FreeRTOS... disabling interrupts can lead to issues, such as Watchdog Timeout +#define sei() portENABLE_INTERRUPTS() +#define cli() portDISABLE_INTERRUPTS() #define interrupts() sei() #define noInterrupts() cli() diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp index 6cca85ac64c..4825b0d931c 100644 --- a/cores/esp32/Esp.cpp +++ b/cores/esp32/Esp.cpp @@ -30,6 +30,7 @@ extern "C" { } #include +#include "soc/spi_reg.h" #include "esp_system.h" #ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ #if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 @@ -55,6 +56,14 @@ extern "C" { #define ESP_FLASH_IMAGE_BASE 0x1000 #endif +// REG_SPI_BASE is not defined for S3/C3 ?? + +#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 + #ifndef REG_SPI_BASE + #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) + #endif // REG_SPI_BASE +#endif // TARGET + /** * User-defined Literals * usage: @@ -192,7 +201,7 @@ static uint32_t sketchSize(sketchSize_t response) { return data.image_len; } } - + uint32_t EspClass::getSketchSize () { return sketchSize(SKETCH_SIZE_TOTAL); } @@ -305,13 +314,17 @@ const char * EspClass::getSdkVersion(void) return esp_get_idf_version(); } +uint32_t ESP_getFlashChipId(void) +{ + uint32_t id = g_rom_flashchip.device_id; + id = ((id & 0xff) << 16) | ((id >> 16) & 0xff) | (id & 0xff00); + return id; +} + uint32_t EspClass::getFlashChipSize(void) { - esp_image_header_t fhdr; - if(flashRead(ESP_FLASH_IMAGE_BASE, (uint32_t*)&fhdr, sizeof(esp_image_header_t)) && fhdr.magic != ESP_IMAGE_HEADER_MAGIC) { - return 0; - } - return magicFlashChipSize(fhdr.spi_size); + uint32_t id = (ESP_getFlashChipId() >> 16) & 0xFF; + return 2 << (id - 1); } uint32_t EspClass::getFlashChipSpeed(void) @@ -325,11 +338,26 @@ uint32_t EspClass::getFlashChipSpeed(void) FlashMode_t EspClass::getFlashChipMode(void) { - esp_image_header_t fhdr; - if(flashRead(ESP_FLASH_IMAGE_BASE, (uint32_t*)&fhdr, sizeof(esp_image_header_t)) && fhdr.magic != ESP_IMAGE_HEADER_MAGIC) { - return FM_UNKNOWN; - } - return magicFlashChipMode(fhdr.spi_mode); + #if CONFIG_IDF_TARGET_ESP32S2 + uint32_t spi_ctrl = REG_READ(PERIPHS_SPI_FLASH_CTRL); + #else + uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0)); + #endif + /* Not all of the following constants are already defined in older versions of spi_reg.h, so do it manually for now*/ + if (spi_ctrl & BIT(24)) { //SPI_FREAD_QIO + return (FM_QIO); + } else if (spi_ctrl & BIT(20)) { //SPI_FREAD_QUAD + return (FM_QOUT); + } else if (spi_ctrl & BIT(23)) { //SPI_FREAD_DIO + return (FM_DIO); + } else if (spi_ctrl & BIT(14)) { // SPI_FREAD_DUAL + return (FM_DOUT); + } else if (spi_ctrl & BIT(13)) { //SPI_FASTRD_MODE + return (FM_FAST_READ); + } else { + return (FM_SLOW_READ); + } + return (FM_DOUT); } uint32_t EspClass::magicFlashChipSize(uint8_t byte) diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 87a190ba18c..049c24a74d5 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -140,11 +140,15 @@ _txBufferSize(0), _onReceiveCB(NULL), _onReceiveErrorCB(NULL), _onReceiveTimeout(true), -_rxTimeout(10), +_rxTimeout(2), _eventTask(NULL) #if !CONFIG_DISABLE_HAL_LOCKS ,_lock(NULL) #endif +,_rxPin(-1) +,_txPin(-1) +,_ctsPin(-1) +,_rtsPin(-1) { #if !CONFIG_DISABLE_HAL_LOCKS if(_lock == NULL){ @@ -212,6 +216,18 @@ void HardwareSerial::onReceive(OnReceiveCb function, bool onlyOnTimeout) HSERIAL_MUTEX_UNLOCK(); } +// This function allow the user to define how many bytes will trigger an Interrupt that will copy RX FIFO to the internal RX Ringbuffer +// ISR will also move data from FIFO to RX Ringbuffer after a RX Timeout defined in HardwareSerial::setRxTimeout(uint8_t symbols_timeout) +// A low value of FIFO Full bytes will consume more CPU time within the ISR +// A high value of FIFO Full bytes will make the application wait longer to have byte available for the Stkech in a streaming scenario +// Both RX FIFO Full and RX Timeout may affect when onReceive() will be called +void HardwareSerial::setRxFIFOFull(uint8_t fifoBytes) +{ + HSERIAL_MUTEX_LOCK(); + uartSetRxFIFOFull(_uart, fifoBytes); // Set new timeout + HSERIAL_MUTEX_UNLOCK(); +} + // timout is calculates in time to receive UART symbols at the UART baudrate. // the estimation is about 11 bits per symbol (SERIAL_8N1) void HardwareSerial::setRxTimeout(uint8_t symbols_timeout) @@ -223,7 +239,7 @@ void HardwareSerial::setRxTimeout(uint8_t symbols_timeout) _rxTimeout = symbols_timeout; if (!symbols_timeout) _onReceiveTimeout = false; // only when RX timeout is disabled, we also must disable this flag - if(_uart != NULL) uart_set_rx_timeout(_uart_nr, _rxTimeout); // Set new timeout + uartSetRxTimeout(_uart, _rxTimeout); // Set new timeout HSERIAL_MUTEX_UNLOCK(); } @@ -250,6 +266,7 @@ void HardwareSerial::_uartEventTask(void *args) for(;;) { //Waiting for UART event. if(xQueueReceive(uartEventQueue, (void * )&event, (portTickType)portMAX_DELAY)) { + hardwareSerial_error_t currentErr = UART_NO_ERROR; switch(event.type) { case UART_DATA: if(uart->_onReceiveCB && uart->available() > 0 && @@ -258,28 +275,32 @@ void HardwareSerial::_uartEventTask(void *args) break; case UART_FIFO_OVF: log_w("UART%d FIFO Overflow. Consider adding Hardware Flow Control to your Application.", uart->_uart_nr); - if(uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(UART_FIFO_OVF_ERROR); + currentErr = UART_FIFO_OVF_ERROR; break; case UART_BUFFER_FULL: log_w("UART%d Buffer Full. Consider increasing your buffer size of your Application.", uart->_uart_nr); - if(uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(UART_BUFFER_FULL_ERROR); + currentErr = UART_BUFFER_FULL_ERROR; break; case UART_BREAK: log_w("UART%d RX break.", uart->_uart_nr); - if(uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(UART_BREAK_ERROR); + currentErr = UART_BREAK_ERROR; break; case UART_PARITY_ERR: log_w("UART%d parity error.", uart->_uart_nr); - if(uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(UART_PARITY_ERROR); + currentErr = UART_PARITY_ERROR; break; case UART_FRAME_ERR: log_w("UART%d frame error.", uart->_uart_nr); - if(uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(UART_FRAME_ERROR); + currentErr = UART_FRAME_ERROR; break; default: log_w("UART%d unknown event type %d.", uart->_uart_nr, event.type); break; } + if (currentErr != UART_NO_ERROR) { + if(uart->_onReceiveErrorCB) uart->_onReceiveErrorCB(currentErr); + if(uart->_onReceiveCB && uart->available() > 0) uart->_onReceiveCB(); // forces User Callback too + } } } } @@ -366,10 +387,9 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in } // Set UART RX timeout - if (_uart != NULL) { - uart_set_rx_timeout(_uart_nr, _rxTimeout); - } - + uartSetRxTimeout(_uart, _rxTimeout); + _rxPin = rxPin; + _txPin = txPin; HSERIAL_MUTEX_UNLOCK(); } @@ -388,6 +408,8 @@ void HardwareSerial::end(bool fullyTerminate) if (uartGetDebug() == _uart_nr) { uartSetDebug(0); } + uartDetachPins(_uart, _rxPin, _txPin, _ctsPin, _rtsPin); + _rxPin = _txPin = _ctsPin = _rtsPin = -1; } delay(10); uartEnd(_uart); @@ -492,10 +514,19 @@ void HardwareSerial::setRxInvert(bool invert) void HardwareSerial::setPins(int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) { if(_uart == NULL) { - log_e("setPins() shall be called after begin() - nothing done"); + log_e("setPins() shall be called after begin() - nothing done\n"); return; } - uartSetPins(_uart, rxPin, txPin, ctsPin, rtsPin); + + // uartSetPins() checks if pins are valid for each function and for the SoC + if (uartSetPins(_uart, rxPin, txPin, ctsPin, rtsPin)) { + _txPin = _txPin >= 0 ? txPin : _txPin; + _rxPin = _rxPin >= 0 ? rxPin : _rxPin; + _rtsPin = _rtsPin >= 0 ? rtsPin : _rtsPin; + _ctsPin = _ctsPin >= 0 ? ctsPin : _ctsPin; + } else { + log_e("Error when setting Serial port Pins. Invalid Pin.\n"); + } } // Enables or disables Hardware Flow Control using RTS and/or CTS pins (must use setAllPins() before) diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index b7aafb68520..0c673c1483f 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -57,6 +57,7 @@ #include "freertos/semphr.h" typedef enum { + UART_NO_ERROR, UART_BREAK_ERROR, UART_BUFFER_FULL_ERROR, UART_FIFO_OVF_ERROR, @@ -81,6 +82,12 @@ class HardwareSerial: public Stream // For a baudrate of 9600, SERIAL_8N1 (10 bit symbol) and symbols_timeout = 3, the timeout would be 3 / (9600 / 10) = 3.125 ms void setRxTimeout(uint8_t symbols_timeout); + // setRxFIFOFull(uint8_t fifoBytes) will set the number of bytes that will trigger UART_INTR_RXFIFO_FULL interrupt and fill up RxRingBuffer + // This affects some functions such as Serial::available() and Serial.read() because, in a UART flow of receiving data, Serial internal + // RxRingBuffer will be filled only after these number of bytes arrive or a RX Timeout happens. + // This parameter can be set to 1 in order to receive byte by byte, but it will also consume more CPU time as the ISR will be activates often. + void setRxFIFOFull(uint8_t fifoBytes); + // onReceive will setup a callback that will be called whenever an UART interruption occurs (UART_INTR_RXFIFO_FULL or UART_INTR_RXFIFO_TOUT) // UART_INTR_RXFIFO_FULL interrupt triggers at UART_FULL_THRESH_DEFAULT bytes received (defined as 120 bytes by default in IDF) // UART_INTR_RXFIFO_TOUT interrupt triggers at UART_TOUT_THRESH_DEFAULT symbols passed without any reception (defined as 10 symbos by default in IDF) @@ -91,7 +98,7 @@ class HardwareSerial: public Stream // false -- The callback will be called when FIFO reaches 120 bytes and also on RX Timeout. // The stream of incommig bytes will be "split" into blocks of 120 bytes on each callback. // This option avoid any sort of Rx Overflow, but leaves the UART packet reassembling work to the Application. - void onReceive(OnReceiveCb function, bool onlyOnTimeout = true); + void onReceive(OnReceiveCb function, bool onlyOnTimeout = false); // onReceive will be called on error events (see hardwareSerial_error_t) void onReceiveError(OnReceiveErrorCb function); @@ -169,6 +176,7 @@ class HardwareSerial: public Stream #if !CONFIG_DISABLE_HAL_LOCKS SemaphoreHandle_t _lock; #endif + int8_t _rxPin, _txPin, _ctsPin, _rtsPin; void _createEventTask(void *args); void _destroyEventTask(void); diff --git a/cores/esp32/IPAddress.cpp b/cores/esp32/IPAddress.cpp index 0575363f254..6766b4a26d2 100644 --- a/cores/esp32/IPAddress.cpp +++ b/cores/esp32/IPAddress.cpp @@ -20,78 +20,225 @@ #include #include #include +#include -IPAddress::IPAddress() +IPAddress::IPAddress() : IPAddress(IPv4) {} + +IPAddress::IPAddress(IPType ip_type) { - _address.dword = 0; + _type = ip_type; + memset(_address.bytes, 0, sizeof(_address.bytes)); } IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) { - _address.bytes[0] = first_octet; - _address.bytes[1] = second_octet; - _address.bytes[2] = third_octet; - _address.bytes[3] = fourth_octet; + _type = IPv4; + memset(_address.bytes, 0, sizeof(_address.bytes)); + _address.bytes[IPADDRESS_V4_BYTES_INDEX] = first_octet; + _address.bytes[IPADDRESS_V4_BYTES_INDEX + 1] = second_octet; + _address.bytes[IPADDRESS_V4_BYTES_INDEX + 2] = third_octet; + _address.bytes[IPADDRESS_V4_BYTES_INDEX + 3] = fourth_octet; +} + +IPAddress::IPAddress(uint8_t o1, uint8_t o2, uint8_t o3, uint8_t o4, uint8_t o5, uint8_t o6, uint8_t o7, uint8_t o8, uint8_t o9, uint8_t o10, uint8_t o11, uint8_t o12, uint8_t o13, uint8_t o14, uint8_t o15, uint8_t o16) { + _type = IPv6; + _address.bytes[0] = o1; + _address.bytes[1] = o2; + _address.bytes[2] = o3; + _address.bytes[3] = o4; + _address.bytes[4] = o5; + _address.bytes[5] = o6; + _address.bytes[6] = o7; + _address.bytes[7] = o8; + _address.bytes[8] = o9; + _address.bytes[9] = o10; + _address.bytes[10] = o11; + _address.bytes[11] = o12; + _address.bytes[12] = o13; + _address.bytes[13] = o14; + _address.bytes[14] = o15; + _address.bytes[15] = o16; } IPAddress::IPAddress(uint32_t address) { - _address.dword = address; + // IPv4 only + _type = IPv4; + memset(_address.bytes, 0, sizeof(_address.bytes)); + _address.dword[IPADDRESS_V4_DWORD_INDEX] = address; + + // NOTE on conversion/comparison and uint32_t: + // These conversions are host platform dependent. + // There is a defined integer representation of IPv4 addresses, + // based on network byte order (will be the value on big endian systems), + // e.g. http://2398766798 is the same as http://142.250.70.206, + // However on little endian systems the octets 0x83, 0xFA, 0x46, 0xCE, + // in that order, will form the integer (uint32_t) 3460758158 . } -IPAddress::IPAddress(const uint8_t *address) +IPAddress::IPAddress(const uint8_t *address) : IPAddress(IPv4, address) {} + +IPAddress::IPAddress(IPType ip_type, const uint8_t *address) { - memcpy(_address.bytes, address, sizeof(_address.bytes)); + _type = ip_type; + if (ip_type == IPv4) { + memset(_address.bytes, 0, sizeof(_address.bytes)); + memcpy(&_address.bytes[IPADDRESS_V4_BYTES_INDEX], address, sizeof(uint32_t)); + } else { + memcpy(_address.bytes, address, sizeof(_address.bytes)); + } } IPAddress& IPAddress::operator=(const uint8_t *address) { - memcpy(_address.bytes, address, sizeof(_address.bytes)); + // IPv4 only conversion from byte pointer + _type = IPv4; + memset(_address.bytes, 0, sizeof(_address.bytes)); + memcpy(&_address.bytes[IPADDRESS_V4_BYTES_INDEX], address, sizeof(uint32_t)); return *this; } IPAddress& IPAddress::operator=(uint32_t address) { - _address.dword = address; + // IPv4 conversion + // See note on conversion/comparison and uint32_t + _type = IPv4; + memset(_address.bytes, 0, sizeof(_address.bytes)); + _address.dword[IPADDRESS_V4_DWORD_INDEX] = address; return *this; } +bool IPAddress::operator==(const IPAddress& addr) const +{ + return (addr._type == _type) + && (memcmp(addr._address.bytes, _address.bytes, sizeof(_address.bytes)) == 0); +} + bool IPAddress::operator==(const uint8_t* addr) const { - return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; + // IPv4 only comparison to byte pointer + // Can't support IPv6 as we know our type, but not the length of the pointer + return _type == IPv4 && memcmp(addr, &_address.bytes[IPADDRESS_V4_BYTES_INDEX], sizeof(uint32_t)) == 0; +} + +uint8_t IPAddress::operator[](int index) const { + if (_type == IPv4) { + return _address.bytes[IPADDRESS_V4_BYTES_INDEX + index]; + } + return _address.bytes[index]; +} + +uint8_t& IPAddress::operator[](int index) { + if (_type == IPv4) { + return _address.bytes[IPADDRESS_V4_BYTES_INDEX + index]; + } + return _address.bytes[index]; } size_t IPAddress::printTo(Print& p) const { size_t n = 0; - for(int i = 0; i < 3; i++) { - n += p.print(_address.bytes[i], DEC); + + if (_type == IPv6) { + // IPv6 IETF canonical format: compress left-most longest run of two or more zero fields, lower case + int8_t longest_start = -1; + int8_t longest_length = 1; + int8_t current_start = -1; + int8_t current_length = 0; + for (int8_t f = 0; f < 8; f++) { + if (_address.bytes[f * 2] == 0 && _address.bytes[f * 2 + 1] == 0) { + if (current_start == -1) { + current_start = f; + current_length = 1; + } else { + current_length++; + } + if (current_length > longest_length) { + longest_start = current_start; + longest_length = current_length; + } + } else { + current_start = -1; + } + } + for (int f = 0; f < 8; f++) { + if (f < longest_start || f >= longest_start + longest_length) { + uint8_t c1 = _address.bytes[f * 2] >> 4; + uint8_t c2 = _address.bytes[f * 2] & 0xf; + uint8_t c3 = _address.bytes[f * 2 + 1] >> 4; + uint8_t c4 = _address.bytes[f * 2 + 1] & 0xf; + if (c1 > 0) { + n += p.print((char)(c1 < 10 ? '0' + c1 : 'a' + c1 - 10)); + } + if (c1 > 0 || c2 > 0) { + n += p.print((char)(c2 < 10 ? '0' + c2 : 'a' + c2 - 10)); + } + if (c1 > 0 || c2 > 0 || c3 > 0) { + n += p.print((char)(c3 < 10 ? '0' + c3 : 'a' + c3 - 10)); + } + n += p.print((char)(c4 < 10 ? '0' + c4 : 'a' + c4 - 10)); + if (f < 7) { + n += p.print(':'); + } + } else if (f == longest_start) { + if (longest_start == 0) { + n += p.print(':'); + } + n += p.print(':'); + } + } + return n; + } + + // IPv4 + for (int i =0; i < 3; i++) + { + n += p.print(_address.bytes[IPADDRESS_V4_BYTES_INDEX + i], DEC); n += p.print('.'); } - n += p.print(_address.bytes[3], DEC); + n += p.print(_address.bytes[IPADDRESS_V4_BYTES_INDEX + 3], DEC); return n; } String IPAddress::toString() const { + if (_type == IPv6) + { + StreamString s; + s.reserve(40); + printTo(s); + return s; + } + + // IPv4 char szRet[16]; sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]); return String(szRet); } bool IPAddress::fromString(const char *address) +{ + if (!fromString4(address)) + { + return fromString6(address); + } + return true; +} + +bool IPAddress::fromString4(const char *address) { // TODO: add support for "a", "a.b", "a.b.c" formats - uint16_t acc = 0; // Accumulator + int16_t acc = -1; // Accumulator uint8_t dots = 0; + memset(_address.bytes, 0, sizeof(_address.bytes)); while (*address) { char c = *address++; if (c >= '0' && c <= '9') { - acc = acc * 10 + (c - '0'); + acc = (acc < 0) ? (c - '0') : acc * 10 + (c - '0'); if (acc > 255) { // Value out of [0..255] range return false; @@ -100,11 +247,15 @@ bool IPAddress::fromString(const char *address) else if (c == '.') { if (dots == 3) { - // Too much dots (there must be 3 dots) + // Too many dots (there must be 3 dots) return false; } - _address.bytes[dots++] = acc; - acc = 0; + if (acc < 0) { + /* No value between dots, e.g. '1..' */ + return false; + } + _address.bytes[IPADDRESS_V4_BYTES_INDEX + dots++] = acc; + acc = -1; } else { @@ -117,7 +268,80 @@ bool IPAddress::fromString(const char *address) // Too few dots (there must be 3 dots) return false; } - _address.bytes[3] = acc; + if (acc < 0) { + /* No value between dots, e.g. '1..' */ + return false; + } + _address.bytes[IPADDRESS_V4_BYTES_INDEX + 3] = acc; + _type = IPv4; + return true; +} + +bool IPAddress::fromString6(const char *address) { + uint32_t acc = 0; // Accumulator + int colons = 0, double_colons = -1; + + while (*address) + { + char c = tolower(*address++); + if (isalnum(c) && c <= 'f') { + if (c >= 'a') + c -= 'a' - '0' - 10; + acc = acc * 16 + (c - '0'); + if (acc > 0xffff) + // Value out of range + return false; + } + else if (c == ':') { + if (*address == ':') { + if (double_colons >= 0) { + // :: allowed once + return false; + } + if (*address != '\0' && *(address + 1) == ':') { + // ::: not allowed + return false; + } + // remember location + double_colons = colons + !!acc; + address++; + } else if (*address == '\0') { + // can't end with a single colon + return false; + } + if (colons == 7) + // too many separators + return false; + _address.bytes[colons * 2] = acc >> 8; + _address.bytes[colons * 2 + 1] = acc & 0xff; + colons++; + acc = 0; + } + else + // Invalid char + return false; + } + + if (double_colons == -1 && colons != 7) { + // Too few separators + return false; + } + if (double_colons > -1 && colons > 6) { + // Too many segments (double colon must be at least one zero field) + return false; + } + _address.bytes[colons * 2] = acc >> 8; + _address.bytes[colons * 2 + 1] = acc & 0xff; + colons++; + + if (double_colons != -1) { + for (int i = colons * 2 - double_colons * 2 - 1; i >= 0; i--) + _address.bytes[16 - colons * 2 + double_colons * 2 + i] = _address.bytes[double_colons * 2 + i]; + for (int i = double_colons * 2; i < 16 - colons * 2 + double_colons * 2; i++) + _address.bytes[i] = 0; + } + + _type = IPv6; return true; } diff --git a/cores/esp32/IPAddress.h b/cores/esp32/IPAddress.h index 3bedd4f8749..a86bc392978 100644 --- a/cores/esp32/IPAddress.h +++ b/cores/esp32/IPAddress.h @@ -26,13 +26,23 @@ // A class to make it easier to handle and pass around IP addresses +#define IPADDRESS_V4_BYTES_INDEX 12 +#define IPADDRESS_V4_DWORD_INDEX 3 + +enum IPType +{ + IPv4, + IPv6 +}; + class IPAddress: public Printable { private: union { - uint8_t bytes[4]; // IPv4 address - uint32_t dword; + uint8_t bytes[16]; + uint32_t dword[4]; } _address; + IPType _type; // Access the raw byte array containing the address. Because this returns a pointer // to the internal structure rather than a copy of the address this function should only @@ -40,41 +50,36 @@ class IPAddress: public Printable // stored. uint8_t* raw_address() { - return _address.bytes; + return _type == IPv4 ? &_address.bytes[IPADDRESS_V4_BYTES_INDEX] : _address.bytes; } public: // Constructors IPAddress(); + IPAddress(IPType ip_type); IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); + IPAddress(uint8_t o1, uint8_t o2, uint8_t o3, uint8_t o4, uint8_t o5, uint8_t o6, uint8_t o7, uint8_t o8, uint8_t o9, uint8_t o10, uint8_t o11, uint8_t o12, uint8_t o13, uint8_t o14, uint8_t o15, uint8_t o16); IPAddress(uint32_t address); IPAddress(const uint8_t *address); + IPAddress(IPType ip_type, const uint8_t *address); virtual ~IPAddress() {} bool fromString(const char *address); bool fromString(const String &address) { return fromString(address.c_str()); } - // Overloaded cast operator to allow IPAddress objects to be used where a pointer - // to a four-byte uint8_t array is expected + // Overloaded cast operator to allow IPAddress objects to be used where a + // uint32_t is expected operator uint32_t() const { - return _address.dword; - } - bool operator==(const IPAddress& addr) const - { - return _address.dword == addr._address.dword; + return _type == IPv4 ? _address.dword[IPADDRESS_V4_DWORD_INDEX] : 0; } + + bool operator==(const IPAddress& addr) const; bool operator==(const uint8_t* addr) const; // Overloaded index operator to allow getting and setting individual octets of the address - uint8_t operator[](int index) const - { - return _address.bytes[index]; - } - uint8_t& operator[](int index) - { - return _address.bytes[index]; - } + uint8_t operator[](int index) const; + uint8_t& operator[](int index); // Overloaded copy operators to allow initialisation of IPAddress objects from other types IPAddress& operator=(const uint8_t *address); @@ -83,14 +88,21 @@ class IPAddress: public Printable virtual size_t printTo(Print& p) const; String toString() const; + IPType type() { return _type; } + friend class EthernetClass; friend class UDP; friend class Client; friend class Server; friend class DhcpClass; friend class DNSClient; + +protected: + bool fromString4(const char *address); + bool fromString6(const char *address); }; // changed to extern because const declaration creates copies in BSS of INADDR_NONE for each CPP unit that includes it extern IPAddress INADDR_NONE; +extern IPAddress IN6ADDR_ANY; #endif diff --git a/cores/esp32/esp32-hal-cpu.c b/cores/esp32/esp32-hal-cpu.c index 2939449c944..5ece7fb60ab 100644 --- a/cores/esp32/esp32-hal-cpu.c +++ b/cores/esp32/esp32-hal-cpu.c @@ -211,7 +211,7 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ capb = calculateApb(&cconf); //New APB apb = calculateApb(&conf); - log_d("%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL)?"PLL":((conf.source == RTC_CPU_FREQ_SRC_APLL)?"APLL":((conf.source == RTC_CPU_FREQ_SRC_XTAL)?"XTAL":"8M")), conf.source_freq_mhz, conf.div, conf.freq_mhz, apb); + //Call peripheral functions before the APB change if(apb_change_callbacks){ triggerApbChangeCallback(APB_BEFORE_CHANGE, capb, apb); @@ -241,6 +241,7 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){ if(apb_change_callbacks){ triggerApbChangeCallback(APB_AFTER_CHANGE, capb, apb); } + log_d("%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL)?"PLL":((conf.source == RTC_CPU_FREQ_SRC_APLL)?"APLL":((conf.source == RTC_CPU_FREQ_SRC_XTAL)?"XTAL":"8M")), conf.source_freq_mhz, conf.div, conf.freq_mhz, apb); return true; } diff --git a/cores/esp32/esp32-hal-ledc.c b/cores/esp32/esp32-hal-ledc.c index 014b08125f6..4b58c1d9a91 100644 --- a/cores/esp32/esp32-hal-ledc.c +++ b/cores/esp32/esp32-hal-ledc.c @@ -166,14 +166,15 @@ void ledcAttachPin(uint8_t pin, uint8_t chan) return; } uint8_t group=(chan/8), channel=(chan%8), timer=((chan/2)%4); - + uint32_t duty = ledc_get_duty(group,channel); + ledc_channel_config_t ledc_channel = { .speed_mode = group, .channel = channel, .timer_sel = timer, .intr_type = LEDC_INTR_DISABLE, .gpio_num = pin, - .duty = 0, + .duty = duty, .hpoint = 0 }; ledc_channel_config(&ledc_channel); @@ -211,6 +212,8 @@ uint32_t ledcChangeFrequency(uint8_t chan, uint32_t freq, uint8_t bit_num) static int8_t pin_to_channel[SOC_GPIO_PIN_COUNT] = { 0 }; static int cnt_channel = LEDC_CHANNELS; +static uint8_t analog_resolution = 8; +static int analog_frequency = 1000; void analogWrite(uint8_t pin, int value) { // Use ledc hardware for internal pins if (pin < SOC_GPIO_PIN_COUNT) { @@ -220,8 +223,8 @@ void analogWrite(uint8_t pin, int value) { return; } pin_to_channel[pin] = cnt_channel--; + ledcSetup(cnt_channel, analog_frequency, analog_resolution); ledcAttachPin(pin, cnt_channel); - ledcSetup(cnt_channel, 1000, 8); } ledcWrite(pin_to_channel[pin] - 1, value); } @@ -230,3 +233,25 @@ void analogWrite(uint8_t pin, int value) { int8_t analogGetChannel(uint8_t pin) { return pin_to_channel[pin] - 1; } + +void analogWriteFrequency(uint32_t freq) { + if (cnt_channel != LEDC_CHANNELS) { + for (int channel = LEDC_CHANNELS - 1; channel >= cnt_channel; channel--) { + ledcChangeFrequency(channel, freq, analog_resolution); + } + } + analog_frequency = freq; +} + +void analogWriteResolution(uint8_t bits) { + if(bits > LEDC_MAX_BIT_WIDTH) { + log_w("analogWrite resolution width too big! Setting to maximum %u bits)", LEDC_MAX_BIT_WIDTH); + bits = LEDC_MAX_BIT_WIDTH; + } + if (cnt_channel != LEDC_CHANNELS) { + for (int channel = LEDC_CHANNELS - 1; channel >= cnt_channel; channel--) { + ledcChangeFrequency(channel, analog_frequency, bits); + } + } + analog_resolution = bits; +} diff --git a/cores/esp32/esp32-hal-touch.c b/cores/esp32/esp32-hal-touch.c index 7360e77a67d..476df60850c 100644 --- a/cores/esp32/esp32-hal-touch.c +++ b/cores/esp32/esp32-hal-touch.c @@ -186,6 +186,7 @@ static touch_value_t __touchRead(uint8_t pin) { int8_t pad = digitalPinToTouchChannel(pin); if(pad < 0){ + log_e(" No touch pad on selected pin!"); return 0; } @@ -202,6 +203,7 @@ static void __touchConfigInterrupt(uint8_t pin, void (*userFunc)(void), void *Ar { int8_t pad = digitalPinToTouchChannel(pin); if(pad < 0){ + log_e(" No touch pad on selected pin!"); return; } @@ -264,6 +266,27 @@ bool touchInterruptGetLastStatus(uint8_t pin) { } #endif +void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold) +{ + int8_t pad = digitalPinToTouchChannel(pin); + if(pad < 0){ + log_e(" No touch pad on selected pin!"); + return; + } + __touchInit(); + __touchChannelInit(pad); + + #if SOC_TOUCH_VERSION_1 // Only for ESP32 SoC + touch_pad_set_thresh(pad, threshold); + + #elif SOC_TOUCH_VERSION_2 + touch_pad_sleep_channel_enable(pad, true); + touch_pad_sleep_set_threshold(pad, threshold); + + #endif + esp_sleep_enable_touchpad_wakeup(); +} + extern touch_value_t touchRead(uint8_t) __attribute__ ((weak, alias("__touchRead"))); extern void touchAttachInterrupt(uint8_t, voidFuncPtr, touch_value_t) __attribute__ ((weak, alias("__touchAttachInterrupt"))); extern void touchAttachInterruptArg(uint8_t, voidArgFuncPtr, void *, touch_value_t) __attribute__ ((weak, alias("__touchAttachArgsInterrupt"))); diff --git a/cores/esp32/esp32-hal-touch.h b/cores/esp32/esp32-hal-touch.h index a8cda191c31..235b8f86d63 100644 --- a/cores/esp32/esp32-hal-touch.h +++ b/cores/esp32/esp32-hal-touch.h @@ -49,7 +49,8 @@ typedef uint32_t touch_value_t; void touchSetCycles(uint16_t measure, uint16_t sleep); /* - * Read touch pad (values close to 0 mean touch detected) + * Read touch pad (for ESP32 values close to 0 mean touch detected / + * for ESP32-S2/S3 higher values mean touch detected) * You can use this method to chose a good threshold value * to use as value for touchAttachInterrupt * */ @@ -88,6 +89,11 @@ void touchInterruptSetThresholdDirection(bool mustbeLower); bool touchInterruptGetLastStatus(uint8_t pin); #endif +/* + * Setup touch pad wake up from deep sleep with given threshold. + **/ +void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold); + #endif // SOC_TOUCH_SENSOR_NUM > 0 #ifdef __cplusplus diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 0b445cbc47e..e4b24a112f5 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -23,6 +23,9 @@ #include "soc/soc_caps.h" #include "soc/uart_struct.h" +#include "hal/gpio_hal.h" +#include "esp_rom_gpio.h" + static int s_uart_debug_nr = 0; struct uart_struct_t { @@ -69,6 +72,40 @@ static uart_t _uart_bus_array[] = { #endif +// IDF UART has no detach function. As consequence, after ending a UART, the previous pins continue +// to work as RX/TX. It can be verified by changing the UART pins and writing to the UART. Output can +// be seen in the previous pins and new pins as well. +// Valid pin UART_PIN_NO_CHANGE is defined to (-1) +// Negative Pin Number will keep it unmodified, thus this function can detach individual pins +void uartDetachPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) +{ + if(uart == NULL) { + return; + } + + UART_MUTEX_LOCK(); + if (txPin >= 0) { + gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[txPin], PIN_FUNC_GPIO); + esp_rom_gpio_connect_out_signal(txPin, SIG_GPIO_OUT_IDX, false, false); + } + + if (rxPin >= 0) { + gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[rxPin], PIN_FUNC_GPIO); + esp_rom_gpio_connect_in_signal(GPIO_FUNC_IN_LOW, UART_PERIPH_SIGNAL(uart->num, SOC_UART_RX_PIN_IDX), false); + } + + if (rtsPin >= 0) { + gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[rtsPin], PIN_FUNC_GPIO); + esp_rom_gpio_connect_out_signal(rtsPin, SIG_GPIO_OUT_IDX, false, false); + } + + if (ctsPin >= 0) { + gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[ctsPin], PIN_FUNC_GPIO); + esp_rom_gpio_connect_in_signal(GPIO_FUNC_IN_LOW, UART_PERIPH_SIGNAL(uart->num, SOC_UART_CTS_PIN_IDX), false); + } + UART_MUTEX_UNLOCK(); +} + // solves issue https://github.com/espressif/arduino-esp32/issues/6032 // baudrate must be multiplied when CPU Frequency is lower than APB 80MHz uint32_t _get_effective_baudrate(uint32_t baudrate) @@ -108,15 +145,16 @@ bool uartIsDriverInstalled(uart_t* uart) // Valid pin UART_PIN_NO_CHANGE is defined to (-1) // Negative Pin Number will keep it unmodified, thus this function can set individual pins -void uartSetPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) +bool uartSetPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) { if(uart == NULL) { - return; + return false; } UART_MUTEX_LOCK(); // IDF uart_set_pin() will issue necessary Error Message and take care of all GPIO Number validation. - uart_set_pin(uart->num, txPin, rxPin, rtsPin, ctsPin); + bool retCode = uart_set_pin(uart->num, txPin, rxPin, rtsPin, ctsPin) == ESP_OK; UART_MUTEX_UNLOCK(); + return retCode; } // @@ -162,7 +200,6 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx uart_config.rx_flow_ctrl_thresh = rxfifo_full_thrhd; uart_config.source_clk = UART_SCLK_APB; - ESP_ERROR_CHECK(uart_driver_install(uart_nr, rx_buffer_size, tx_buffer_size, 20, &(uart->uart_event_queue), 0)); ESP_ERROR_CHECK(uart_param_config(uart_nr, &uart_config)); ESP_ERROR_CHECK(uart_set_pin(uart_nr, txPin, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE)); @@ -172,13 +209,56 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx // invert signal for both Rx and Tx ESP_ERROR_CHECK(uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV)); } - + UART_MUTEX_UNLOCK(); uartFlush(uart); return uart; } +// This code is under testing - for now just keep it here +void uartSetFastReading(uart_t* uart) +{ + if(uart == NULL) { + return; + } + + UART_MUTEX_LOCK(); + // override default RX IDF Driver Interrupt - no BREAK, PARITY or OVERFLOW + uart_intr_config_t uart_intr = { + .intr_enable_mask = UART_INTR_RXFIFO_FULL | UART_INTR_RXFIFO_TOUT, // only these IRQs - no BREAK, PARITY or OVERFLOW + .rx_timeout_thresh = 1, + .txfifo_empty_intr_thresh = 10, + .rxfifo_full_thresh = 2, + }; + + ESP_ERROR_CHECK(uart_intr_config(uart->num, &uart_intr)); + UART_MUTEX_UNLOCK(); +} + + +void uartSetRxTimeout(uart_t* uart, uint8_t numSymbTimeout) +{ + if(uart == NULL) { + return; + } + + UART_MUTEX_LOCK(); + uart_set_rx_timeout(uart->num, numSymbTimeout); + UART_MUTEX_UNLOCK(); +} + +void uartSetRxFIFOFull(uart_t* uart, uint8_t numBytesFIFOFull) +{ + if(uart == NULL) { + return; + } + + UART_MUTEX_LOCK(); + uart_set_rx_full_threshold(uart->num, numBytesFIFOFull); + UART_MUTEX_UNLOCK(); +} + void uartEnd(uart_t* uart) { if(uart == NULL) { diff --git a/cores/esp32/esp32-hal-uart.h b/cores/esp32/esp32-hal-uart.h index ec7912c3d7a..ffb0a3f027a 100644 --- a/cores/esp32/esp32-hal-uart.h +++ b/cores/esp32/esp32-hal-uart.h @@ -82,14 +82,18 @@ void uartSetBaudRate(uart_t* uart, uint32_t baud_rate); uint32_t uartGetBaudRate(uart_t* uart); void uartSetRxInvert(uart_t* uart, bool invert); +void uartSetRxTimeout(uart_t* uart, uint8_t numSymbTimeout); +void uartSetRxFIFOFull(uart_t* uart, uint8_t numBytesFIFOFull); +void uartSetFastReading(uart_t* uart); void uartSetDebug(uart_t* uart); int uartGetDebug(); bool uartIsDriverInstalled(uart_t* uart); -// Negative Pin Number will keep it unmodified, thus this function can set individual pins -void uartSetPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); +// Negative Pin Number will keep it unmodified, thus this function can set/reset individual pins +bool uartSetPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); +void uartDetachPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); // Enables or disables HW Flow Control function -- needs also to set CTS and/or RTS pins void uartSetHwFlowCtrlMode(uart_t *uart, uint8_t mode, uint8_t threshold); diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h index 59dca98cbb9..51ecea405df 100644 --- a/cores/esp32/esp32-hal.h +++ b/cores/esp32/esp32-hal.h @@ -93,6 +93,8 @@ void yield(void); void analogWrite(uint8_t pin, int value); int8_t analogGetChannel(uint8_t pin); +void analogWriteFrequency(uint32_t freq); +void analogWriteResolution(uint8_t bits); //returns chip temperature in Celsius float temperatureRead(); diff --git a/cores/esp32/esp_arduino_version.h b/cores/esp32/esp_arduino_version.h index 3ebfcf56ea5..3f6bb11d42b 100644 --- a/cores/esp32/esp_arduino_version.h +++ b/cores/esp32/esp_arduino_version.h @@ -23,7 +23,7 @@ extern "C" { /** Minor version number (x.X.x) */ #define ESP_ARDUINO_VERSION_MINOR 0 /** Patch version number (x.x.X) */ -#define ESP_ARDUINO_VERSION_PATCH 4 +#define ESP_ARDUINO_VERSION_PATCH 5 /** * Macro to convert ARDUINO version number into an integer diff --git a/docs/source/api/rainmaker.rst b/docs/source/api/rainmaker.rst index 64395a2ebc7..1b157a790b7 100644 --- a/docs/source/api/rainmaker.rst +++ b/docs/source/api/rainmaker.rst @@ -1,3 +1,643 @@ -######### -RainMaker -######### +############# +ESP Rainmaker +############# + +About +----- + +This library allows to work with ESP RainMaker. + +ESP RainMaker is an end-to-end solution offered by Espressif to enable remote control and monitoring for ESP32-S2 and ESP32 based products without any configuration required in the Cloud. The primary components of this solution are: + +- Claiming Service (to get the Cloud connectivity credentials) +- RainMaker library (i.e. this library, to develop the firmware) +- RainMaker Cloud (backend, offering remote connectivity) +- RainMaker Phone App/CLI (Client utilities for remote access) + +The key features of ESP RainMaker are: + +1. Ability to define own devices and parameters, of any type, in the firmware. +2. Zero configuration required on the Cloud. +3. Phone apps that dynamically render the UI as per the device information. + +Additional information about ESP RainMaker can be found `here `__. + + +ESP RainMaker Agent API +----------------------- + +RMaker.initNode +*************** + +This initializes the ESP RainMaker agent, wifi and creates the node. + +You can also set the configuration of the node using the following API + +``RMaker.setTimeSync(bool val)`` + +**NOTE**: If you want to set the configuration for the node then these configuration API must be called before `RMaker.initNode()`. + +.. code-block:: arduino + + Node initNode(const char *name, const char *type); + +* ``name`` Name of the node +* ``type`` Type of the node + +This function will return object of Node. + +RMaker.start +************ + +It starts the ESP RainMaker agent. + +**NOTE**: + +1. ESP RainMaker agent should be initialized before this call. +2. Once ESP RainMaker agent starts, compulsorily call WiFi.beginProvision() API. + +.. code-block:: arduino + + esp_err_t start(); + +This function will return `ESP_OK` on success or `Error` in case of failure. + +RMaker.stop +*********** + +It stops the ESP RainMaker agent which was started using `RMaker.start()`. + +.. code-block:: arduino + + esp_err_t stop() + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure. + +RMaker.deinitNode +***************** + +It deinitializes the ESP RainMaker agent and the node created using `RMaker.initNode()`. + +.. code-block:: arduino + + esp_err_t deinitNode(Node node) + +* ``node`` : Node object created using `RMaker.initNode()` + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +RMaker.enableOTA +**************** + +It enables OTA as per the ESP RainMaker Specification. For more details refer ESP RainMaker documentation. check `here `__. + +.. code-block:: arduino + + esp_err_t enableOTA(ota_type_t type); + +* ``type`` : The OTA workflow type. + - OTA_USING_PARAMS + - OTA_USING_TOPICS + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +RMaker.enableSchedule +********************* + +This API enables the scheduling service for the node. For more information, check `here `__. + +.. code-block:: arduino + + esp_err_t enableSchedule(); + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +RMaker.enableScenes +******************* + +This API enables the Scenes service for the node. It should be called after `RMaker.initNode()` and before `RMaker.start()`. +For more information, check `here `__. + +.. code-block:: arduino + + esp_err_t enableScenes() + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +RMaker.setTimeZone +****************** + +This API set's the timezone as a user friendly location string. Check +`here `__ for a list of valid values. + +**NOTE** : default value is "Asia/Shanghai". + +This API comes into picture only when working with scheduling. + +.. code-block:: arduino + + esp_err_t setTimeZone(const char *tz); + +* ``tz`` : Valid values as specified in documentation. + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +ESP RainMaker Node API +----------------------- + +`Node` class expose API's for node. + +**NOTE** : my_node is the object of Node class. + +my_node.getNodeID +***************** + +It returns the unique node_id assigned to the node. This node_id is usually the MAC address of the board. + +.. code-block:: arduino + + char * getNodeID() + +* ``tz`` : Valid values as specified in documentation. + +This function will return + +1. `char *` : Pointer to a NULL terminated node_id string. + +my_node.getNodeInfo +******************* + +It returns pointer to the node_info_t as configured during node initialisation. + +.. code-block:: arduino + + node_info_t * getNodeInfo(); + +This function will return + +1. `node_info_t` : Pointer to the structure node_info_t on success. +2. `NULL` : On failure. + +**ESP RainMaker node info** + +It has following data member + +1. char * name +2. char * type +3. char * fw_version +4. char * model + +my_node.addNodeAttr +******************* + +It adds a new attribute as the metadata to the node. + +**NOTE** : Only string values are allowed. + +.. code-block:: arduino + + esp_err_t addNodeAttr(const char *attr_name, const char *val); + +* ``attr_name`` : Name of the attribute +* ``val`` : Value of the attribute + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_node.addDevice +***************** + +It adds a device to the node. + +**NOTE** : + +- This is the mandatory API to register device to node. +- Single Node can have multiple devices. +- Device name should be unique for each device. + +.. code-block:: arduino + + esp_err_t addDevice(Device device); + +* ``device`` : Device object + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_node.removeDevice +******************** + +It removes a device from the node. + +.. code-block:: arduino + + esp_err_t removeDevice(Device device); + +* ``device`` : Device object + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +ESP RainMaker Device API +----------------------------- + +`Device` class expose API's for virtual devices on the node. +Parameterized constructor is defined which creates the virtual device on the node. Using Device class object you can create your own device. + +**NOTE** : my_device is the object of Device class + +.. code-block:: arduino + + Device my_device(const char *dev_name, const char *dev_type, void *priv_data); + +* ``dev_name`` : Unique device name +* ``dev_type`` : Optional device type. It can be kept NULL. + * Standard Device Types + * ESP_RMAKER_DEVICE_SWITCH + * ESP_RMAKER_DEVICE_LIGHTBULB + * ESP_RMAKER_DEVICE_FAN + * ESP_RMAKER_DEVICE_TEMP_SENSOR +* ``priv_data`` : Private data associated with the device. This will be passed to the callbacks. + +**NOTE** : This created device should be added to the node using ``my_node.addDevice(my_device);`` + +- Sample example + +.. code-block:: arduino + + Device my_device("Switch"); + Device my_device("Switch1", NULL, NULL); + +- Here, dev_name is compulsory, rest are optional. +- Node can have multiple device, each device should have unique device name. + +**Standard Devices** + +- Classes are defined for the standard devices. +- Creating object of these class creates the standard device with default parameters to it. +- Class for standard devices + * Switch + * LightBulb + * TemperatureSensor + * Fan + +.. code-block:: arduino + + Switch my_switch(const char *dev_name, void *priv_data, bool power); + +* ``dev_name`` : Unique device name by default it is "switch" for switch device. +* ``priv_data`` : Private data associated with the device. This will be passed to the callbacks. +* ``power`` : It is the value that can be set for primary parameter. + +Sample example for standard device. + +.. code-block:: arduino + + Switch switch1; + Switch switch2("switch2", NULL, true); + +- `"switch2"` : Name for standard device. +- `NULL` : Private data for the device, which will be used in callback. +- `true` : Default value for the primary param, in case of switch it is power. + +**NOTE**: No parameter are compulsory for standard devices. However if you are creating two objects of same standard class then in that case you will have to set the device name, if not then both device will have same name which is set by default, hence device will not get create. *Device name should be unique for each device.* + +my_device.getDeviceName +*********************** + +It returns the name of the Device. + +.. code-block:: arduino + + const char * getDeviceName(); + +* ``device`` : Device object + +This function will return + +- `char *`: Returns Device name. + +**NOTE**: Each device on the node should have unique device name. + +my_device.addDeviceAttr +*********************** + +It adds attribute to the device. Device attributes are reported only once after a boot-up as part of the node configuration. Eg. Serial Number + +.. code-block:: arduino + + esp_err_t addDeviceAttr(const char *attr_name, const char *val); + +* ``attr_name`` : Name of the attribute +* ``val`` : Value of the attribute + +This funtion will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_device.deleteDevice +********************** + +It deletes the device created using parameterized constructor. + +This device should be first removed from the node using `my_node.removeDevice(my_device)`. + +.. code-block:: arduino + + esp_err_t deleteDevice(); + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_device.addXParam +******************* + +It adds standard parameter to the device. + +**NOTE**: X is the default name by which parameter is referred, you can specify your own name to each parameter. + +- Eg. `my_device.addPowerParam(true)` here power parameter is referred with name Power. +- Eg. `my_device.addHueParam(12)` here hue parameter is referred with name Hue. + +You can specify your own name to each parameter + +- Eg. `my_device.addNameParam("NickName")` here name parameter is referred with name NickName. +- Eg. `my_device.addPowerParam(true, "FanPower")` here power parameter is referred with name FanPower. + +**Standard Parameters** + +* These are the standard parameters. + * Name : ESP_RMAKER_DEF_NAME_PARAM + * Power : ESP_RMAKER_DEF_POWER_NAME + * Brightness : ESP_RMAKER_DEF_BRIGHTNESS_NAME + * Hue : ESP_RMAKER_DEF_HUE_NAME + * Saturation : ESP_RMAKER_DEF_SATURATION_NAME + * Intensity : ESP_RMAKER_DEF_INTENSITY_NAME + * CCT : ESP_RMAKER_DEF_CCT_NAME + * Direction : ESP_RMAKER_DEF_DIRECTION_NAME + * Speed : ESP_RMAKER_DEF_SPEED_NAME + * Temperature : ESP_RMAKER_DEF_TEMPERATURE_NAME + +.. code-block:: arduino + + esp_err_t addNameParam(const char *param_name = ESP_RMAKER_DEF_NAME_PARAM); + esp_err_t addPowerParam(bool val, const char *param_name = ESP_RMAKER_DEF_POWER_NAME); + esp_err_t addBrightnessParam(int val, const char *param_name = ESP_RMAKER_DEF_BRIGHTNESS_NAME); + esp_err_t addHueParam(int val, const char *param_name = ESP_RMAKER_DEF_HUE_NAME); + esp_err_t addSaturationParam(int val, const char *param_name = ESP_RMAKER_DEF_SATURATION_NAME); + esp_err_t addIntensityParam(int val, const char *param_name = ESP_RMAKER_DEF_INTENSITY_NAME); + esp_err_t addCCTParam(int val, const char *param_name = ESP_RMAKER_DEF_CCT_NAME); + esp_err_t addDirectionParam(int val, const char *param_name = ESP_RMAKER_DEF_DIRECTION_NAME); + esp_err_t addSpeedParam(int val, const char *param_name = ESP_RMAKER_DEF_SPEED_NAME); + esp_err_t addTempratureParam(float val, const char *param_name = ESP_RMAKER_DEF_TEMPERATURE_NAME); + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +**NOTE** : Care should be taken while accessing name of parameter. Above mentioned are the two ways using which default name of parameters can be accessed. Either LHS or RHS. + +my_device.assignPrimaryParam +**************************** + +It assigns a parameter (already added using addXParam() or addParam()) as a primary parameter, which can be used by clients (phone apps specifically) to give prominence to it. + +.. code-block:: arduino + + esp_err_t assignPrimaryParam(param_handle_t *param); + +* ``param`` : Handle of the parameter. It is obtained using `my_device.getParamByName()`. + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_device.getParamByName +************************ + +.. code-block:: arduino + + param_handle_t * getParamByName(const char *param_name); + +* ``param_name`` : It is the name of the parameter which was added using addXparam() or addParam(). + +This function will return object of the parameter. + +my_device.addParam +****************** + +It allows user to add custom parameter to the device created using `Param` class. + +.. code-block:: arduino + + esp_err_t addParam(Param parameter); + +* ``parameter`` : Object of Param + +This function will return + +1.`ESP_OK` : On success +2. Error in case of failure + +**NOTE**: Param class exposes API's to create the custom parameter. + +my_device.updateAndReportParam +****************************** + +It updates the parameter assosicated with particular device on ESP RainMaker cloud. + +.. code-block:: arduino + + esp_err_t updateAndReportParam(const char *param_name, value); + +* ``param_name`` : Name of the parameter +* ``value`` : Value to be updated. It can be int, bool, char * , float. + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_device.addCb +*************** + +It registers read and write callback for the device which will be invoked as per requests received from the cloud (or other paths as may be added in future). + +.. code-block:: arduino + + void addCb(deviceWriteCb write_cb, deviceReadCb read_cb); + +* ``write_cb`` : Function with signature + func_name(Device \*device, Param \*param, const param_val_t val, void \*priv_data, write_ctx_t \*ctx); +* ``read_cb`` : Function with signature + func_name(Device \*device, Param \*param, void \*priv_data, read_ctx_t \*ctx); + +**Parameters** + +**param_val_t val** + +Value can be accessed as below + +1. `bool` : val.val.b +2. `integer` : val.val.i +3. `float` : val.val.f +4. `char *` : val.val.s + +ESP RainMaker Param API +----------------------- + +`Param` class expose API's for creating custom parameters for the devices and report and update values associated with parameter to the ESP RainMaker cloud. Parameterized constructor is defined which creates custom parameter. + +**NOTE** : `my_param` is the object of Param class. + +.. code-block:: arduino + + Param my_param(const char *param_name, const char *param_type, param_val_t val, uint8_t properties); + +* ``param_name`` : Name of the parameter +* ``param_type`` : Type of the parameter. It is optional can be kept NULL. +* ``val`` : Define the default value for the parameter. It should be defined using `value(int ival)` , `value(bool bval)` , `value(float fval)` , `value(char *sval)`. +* ``properties`` : Properties of the parameter, which will be a logical OR of flags. + * Flags + * PROP_FLAG_WRITE + * PROP_FLAG_READ + * PROP_FLAG_TIME_SERIES + * PROP_FLAG_PERSIST + +Sample example : + +.. code-block:: arduino + + Param my_param(const char *param_name, const char *param_type, param_val_t val, uint8_t properties); + Param my_param("bright", NULL, value(30), PROP_FLAG_READ | PROP_FLAG_WRITE | PROP_FLAG_PERSIST); + +**NOTE** : Parameter created using Param class should be added to the device using `my_device.addParam(my_param);` + +my_param.addUIType +****************** + +Add a UI type to the parameter. This will be used by the Phone apps (or other clients) to render appropriate UI for the given parameter. Please refer the RainMaker documentation +`here `__ for supported UI Types. + +.. code-block:: arduino + + esp_err_t addUIType(const char *ui_type); + +* ``ui_type`` : String describing the UI Type. + * Standard UI Types + * ESP_RMAKER_UI_TOGGLE + * ESP_RMAKER_UI_SLIDER + * ESP_RMAKER_UI_DROPDOWN + * ESP_RMAKER_UI_TEXT + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +my_param.addBounds +****************** + +Add bounds for an integer/float parameter. This can be used to add bounds (min/max values) for a given integer/float parameter. Eg. brightness will have bounds as 0 and 100 if it is a percentage. + +.. code-block:: arduino + + esp_err_t addBounds(param_val_t min, param_val_t max, param_val_t step); + +* ``min`` : Minimum value +* ``max`` : Maximum value +* ``step`` : step Minimum stepping + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +`Sample example : my_param.addBounds(value(0), value(100), value(5));` + +my_param.updateAndReport +************************ + +It updates the parameter and report it to ESP RainMaker cloud. This is called in callback. + +.. code-block:: arduino + + esp_err_t updateAndReport(param_val_t val); + +* ``val`` : New value of the parameter + +This function will return + +1. `ESP_OK` : On success +2. Error in case of failure + +**NOTE**: + +- This API should always be called inside device write callback, if you aimed at updating n reporting parameter values, changed via RainMaker Client (Phone App), to the ESP RainMaker cloud. +- If not called then paramter values will not be updated to the ESP RainMaker cloud. + +printQR +******* + +This API displays QR code, which is used in provisioning. + +.. code-block:: arduino + + printQR(const char *serv_name, const char *pop, const char *transport); + +* ``name`` : Service name used in provisioning API. +* ``pop`` : Proof of posession used in provisioning API. +* ``transport`` : + 1. `softap` : In case of provisioning using SOFTAP. + 2. `ble` : In case of provisioning using BLE. + +RMakerFactoryReset +****************** + +Reset the device to factory defaults. + +.. code-block:: arduino + + RMakerFactoryReset(int seconds); + +* ``seconds`` : Time in seconds after which the chip should reboot after doing a factory reset. + +RMakerWiFiReset +*************** + +Reset Wi-Fi credentials. + +.. code-block:: arduino + + RMakerWiFiReset(int seconds); + +* ``seconds`` : Time in seconds after which the chip should reboot after doing a Wi-Fi reset. diff --git a/docs/source/api/touch.rst b/docs/source/api/touch.rst new file mode 100644 index 00000000000..9dd23a8d017 --- /dev/null +++ b/docs/source/api/touch.rst @@ -0,0 +1,142 @@ +##### +TOUCH +##### + +About +----- + +Touch sensor is a peripheral, that has an internal oscilator circuit and it measures charge/discharge frequency over a fixed period of time on respective GPIO pins. +Therefore these touch sensors are also known as capacitive sensors. For example, if you touch any of these pins, finger electrical charge will change this number of cycles, +by changing the RC circuit attached to the touch sensor. The TouchRead() will return the number of cycles (charges/discharges) in a certain time (meas). +The change of this count will be used to validate if a touch has happened or not. These pins can be easily integrated into capacitive pads, and replace mechanical buttons. + +.. note:: Touch peripheral is not present in every SoC. Refer to datasheet of each chip for more info. + +Arduino-ESP32 TOUCH API +----------------------- + +TOUCH common API +**************** + +touchRead +^^^^^^^^^ + +This function gets the touch sensor data. Each touch sensor has a counter to count the number of charge/discharge cycles. When the pad is ‘touched’, +the value in the counter will change because of the larger equivalent capacitance. The change of the data determines if the pad has been touched or not. + +.. code-block:: arduino + + touch_value_t touchRead(uint8_t pin); + +* ``pin`` GPIO pin to read TOUCH value + +This function will return touch pad value as uint16_t (ESP32) or uint32_t (ESP32-S2/S3). + +touchSetCycles +^^^^^^^^^^^^^^ + +This function is used to set cycles that measurement operation takes. The result from touchRead, threshold and detection accuracy depend on these values. +The defaults are setting touchRead to take ~0.5ms. + +.. code-block:: arduino + + void touchSetCycles(uint16_t measure, uint16_t sleep); + +* ``measure`` Sets the time that it takes to measure touch sensor value +* ``sleep`` Sets waiting time before next measure cycle + +touchAttachInterrupt +^^^^^^^^^^^^^^^^^^^^ + +This function is used to attach interrupt to the touch pad. The function will be called if a touch sensor value falls below the given +threshold for ESP32 or rises above the given threshold for ESP32-S2/S3. To determine a proper threshold value between touched and untouched state, +use touchRead() function. + +.. code-block:: arduino + + void touchAttachInterrupt(uint8_t pin, void (*userFunc)(void), touch_value_t threshold); + +* ``pin`` GPIO TOUCH pad pin +* ``userFunc`` Function to be called when interrupt is triggered +* ``threshold`` Sets the threshold when to call interrupt + +touchAttachInterruptArg +^^^^^^^^^^^^^^^^^^^^^^^ + +This function is used to attach interrupt to the touch pad. In the function called by ISR you have the given arguments available. + +.. code-block:: arduino + + void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void*), void *arg, touch_value_t threshold); + +* ``pin`` GPIO TOUCH pad pin +* ``userFunc`` Function to be called when interrupt is triggered +* ``arg`` Sets arguments to the interrupt +* ``threshold`` Sets the threshold when to call interrupt + +touchDetachInterrupt +^^^^^^^^^^^^^^^^^^^^ + +This function is used to detach interrupt from the touch pad. + +.. code-block:: arduino + + void touchDetachInterrupt(uint8_t pin); + +* ``pin`` GPIO TOUCH pad pin. + +touchSleepWakeUpEnable +^^^^^^^^^^^^^^^^^^^^^^ + +This function is used to setup touch pad as the wake up source from the deep sleep. + +.. note:: ESP32-S2 and ESP32-S3 only support one sleep wake up touch pad. + +.. code-block:: arduino + + void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold); + +* ``pin`` GPIO TOUCH pad pin +* ``threshold`` Sets the threshold when to wake up + +TOUCH API specific for ESP32 chip (TOUCH_V1) +******************************************** + +touchInterruptSetThresholdDirection +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This function is used to tell the driver if it shall activate the interrupt if the sensor is lower or higher than +the threshold value. Default is lower. + +.. code-block:: arduino + + void touchInterruptSetThresholdDirection(bool mustbeLower); + +TOUCH API specific for ESP32S2 and ESP32S3 chip (TOUCH_V2) +********************************************************** + +touchInterruptGetLastStatus +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This function is used get the lastest ISR status for the touch pad. + +.. code-block:: arduino + + bool touchInterruptGetLastStatus(uint8_t pin); + +This function returns true if the touch pad has been and continues pressed or false otherwise. + +Example Applications +******************** + +Example of reading the touch sensor. + +.. literalinclude:: ../../../libraries/ESP32/examples/Touch/TouchRead/TouchRead.ino + :language: arduino + +A usage example for the touch interrupts. + +.. literalinclude:: ../../../libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino + :language: arduino + +More examples can be found in our repository -> `Touch examples `_. \ No newline at end of file diff --git a/docs/source/boards/boards.rst b/docs/source/boards/boards.rst index b0376f9c398..344e9c1c9da 100644 --- a/docs/source/boards/boards.rst +++ b/docs/source/boards/boards.rst @@ -8,7 +8,7 @@ Development Boards You will need a development board or a custom board with the ESP32 (see Supported SoC's) to start playing. There is a bunch of different types and models widely available on the Internet. You need to choose one that covers all your requirements. -To help you on this selection, we point out some facts about choosing the proper boardsto help you to save money and time. +To help you on this selection, we point out some facts about choosing the proper boards to help you to save money and time. **One ESP32 to rule them all!** @@ -112,4 +112,4 @@ Resources .. |board_lolin_d32_pro| raw:: html - LOLIN D32 Pro \ No newline at end of file + LOLIN D32 Pro diff --git a/docs/source/esp-idf_component.rst b/docs/source/esp-idf_component.rst index e2049b4e2bf..fe27d52110f 100644 --- a/docs/source/esp-idf_component.rst +++ b/docs/source/esp-idf_component.rst @@ -37,6 +37,23 @@ Installation cd ../.. && \ idf.py menuconfig +.. note:: If you use Arduino with ESP-IDF often, you can place the arduino folder into global components folder. + +If you're targeting the ESP32-S2 or ESP32-S3 and you want to use USBHID classes such as ``USBHID``, ``USBHIDConsumerControl``, ``USBHIDGamepad``, ``USBHIDKeyboard``, ``USBHIDMouse``, ``USBHIDSystemControl``, or ``USBHIDVendor``: + +1. Clone these nested repos somewhere: + +.. code-block:: bash + + git clone https://github.com/espressif/esp32-arduino-lib-builder.git esp32-arduino-lib-builder && \ + git clone https://github.com/hathach/tinyusb.git esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb + +2. In the project folder, edit ``CMakeLists.txt`` and add the following before the ``project()`` line: + +.. code-block:: bash + + set(EXTRA_COMPONENT_DIRS ) + Configuration ------------- diff --git a/docs/source/faq.rst b/docs/source/faq.rst index e6872912424..97520b35673 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -11,3 +11,7 @@ To use the arduino-esp32 core with a modified sdkconfig option, you need to use Note that modifying ``sdkconfig`` or ``sdkconfig.h`` files found in the arduino-esp32 project tree **does not** result in changes to these options. This is because ESP-IDF libraries are included into the arduino-esp32 project tree as pre-built libraries. +How to compile libs with different debug level? +----------------------------------------------- + +The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index e69373ea499..0b4280d4b91 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -40,7 +40,7 @@ SoC Stable Development Datasheet ESP32 Yes Yes `ESP32`_ ESP32-S2 Yes Yes `ESP32-S2`_ ESP32-C3 Yes Yes `ESP32-C3`_ -ESP32-S3 No Yes `ESP32-S3`_ +ESP32-S3 Yes Yes `ESP32-S3`_ ======== ====== =========== =================================== See `Boards `_ for more details about ESP32 development boards. diff --git a/docs/source/guides/core_debug.rst b/docs/source/guides/core_debug.rst new file mode 100644 index 00000000000..1f39567e2f5 --- /dev/null +++ b/docs/source/guides/core_debug.rst @@ -0,0 +1,38 @@ +################################## +Compile Arduino libs with ESP_LOGx +################################## + +There are 2 primary approaches and both of them involve editing file ``configs/defconfig.common``. +Edit the file directly and then build. +Later you can ``git restore configs/defconfig.common`` to go back. +Copy the file ``cp configs/defconfig.common configs/defconfig.debug`` and edit the debug version. + +``vim configs/defconfig.common`` or ``vim configs/defconfig.debug`` + +Edit **line 44** containing by default ``CONFIG_LOG_DEFAULT_LEVEL_ERROR=y`` to one of the following lines depending on your desired log level: + +.. code-block:: bash + + CONFIG_LOG_DEFAULT_LEVEL_NONE=y # No output + CONFIG_LOG_DEFAULT_LEVEL_ERROR=y # Errors - default + CONFIG_LOG_DEFAULT_LEVEL_WARN=y # Warnings + CONFIG_LOG_DEFAULT_LEVEL_INFO=y # Info + CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y # Debug + CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y # Verbose + +Then simply build the libs for all SoCs or one specific SoC. Note that building for all SoCs takes a lot of time, so if you are working only with specific SoC(s), build only for those. + +.. note:: + If you have copied the ``defconfig`` file and the debug settings are in file ``configs/defconfig.debug`` add flag ``debug`` to compilation command. + Example : ``./build.sh debug`` + + - **Option 1**: Build for all SoCs: ``./build.sh`` + - **Option 2**: Build for one SoC: ``./build.sh -t ``. The exact text to choose the SoC: + + - ``esp32`` + - ``esp32s2`` + - ``esp32c3`` + - ``esp32s3`` + - Example: ``./build.sh -t esp32`` + - A wrong format or non-existing SoC will result in the error sed: can't read sdkconfig: No such file or directory + diff --git a/docs/source/libraries.rst b/docs/source/libraries.rst index d9febb08a1a..8c5357150a3 100644 --- a/docs/source/libraries.rst +++ b/docs/source/libraries.rst @@ -9,53 +9,53 @@ Supported Peripherals Currently, the Arduino ESP32 supports the following peripherals with Arduino APIs. -+---------------+---------------+---------------+---------------+-------------------------------+ -| Peripheral | ESP32 | ESP32-S2 | ESP32-C3 | Comments | -+===============+===============+===============+===============+===============================+ -| ADC | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Bluetooth | Yes | Not Supported | Not Supported | Bluetooth Classic | -+---------------+---------------+---------------+---------------+-------------------------------+ -| BLE | Yes | Not Supported | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| DAC | Yes | Yes | Not Supported | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Ethernet | Yes | Not Supported | Not Supported | (*) | -+---------------+---------------+---------------+---------------+-------------------------------+ -| GPIO | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Hall Sensor | Yes | Not Supported | Not Supported | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| I2C | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| I2S | Yes | No | No | WIP | -+---------------+---------------+---------------+---------------+-------------------------------+ -| LEDC | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Motor PWM | No | Not Supported | Not Supported | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Pulse Counter | No | No | No | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| RMT | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| SDIO | No | No | No | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| SPI | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Timer | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Temp. Sensor | Not Supported | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Touch | Yes | Yes | Not Supported | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| TWAI | No | No | No | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| UART | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ -| USB | Not Supported | Yes | Yes | ESP32-C3 only CDC/JTAG | -+---------------+---------------+---------------+---------------+-------------------------------+ -| Wi-Fi | Yes | Yes | Yes | | -+---------------+---------------+---------------+---------------+-------------------------------+ ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Peripheral | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 | | Comments | ++===============+===============+===============+===============+===============+=====+========================+ +| ADC | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Bluetooth | Yes | Not Supported | Not Supported | Not Supported | | Bluetooth Classic | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| BLE | Yes | Not Supported | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| DAC | Yes | Yes | Not Supported | Not Supported | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Ethernet | Yes | Not Supported | Not Supported | Not Supported | | (*) | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| GPIO | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Hall Sensor | Yes | Not Supported | Not Supported | Not Supported | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| I2C | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| I2S | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| LEDC | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Motor PWM | No | Not Supported | Not Supported | Not Supported | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Pulse Counter | No | No | No | No | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| RMT | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| SDIO | No | No | No | No | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| SDMMC | Yes | Not Supported | Not Supported | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Timer | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Temp. Sensor | Not Supported | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Touch | Yes | Yes | Not Supported | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| TWAI | No | No | No | No | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| UART | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| USB | Not Supported | Yes | Yes | Yes | | ESP32-C3 only CDC/JTAG | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ +| Wi-Fi | Yes | Yes | Yes | Yes | | | ++---------------+---------------+---------------+---------------+---------------+-----+------------------------+ Notes ^^^^^ diff --git a/libraries/BLE/src/BLERemoteCharacteristic.cpp b/libraries/BLE/src/BLERemoteCharacteristic.cpp index dbf7e736a74..825ca33c73b 100644 --- a/libraries/BLE/src/BLERemoteCharacteristic.cpp +++ b/libraries/BLE/src/BLERemoteCharacteristic.cpp @@ -247,6 +247,8 @@ void BLERemoteCharacteristic::gattClientEventHandler(esp_gattc_cb_event_t event, break; case ESP_GATTC_DISCONNECT_EVT: + // Cleanup semaphores to avoid deadlocks. + m_semaphoreReadCharEvt.give(1); m_semaphoreWriteCharEvt.give(1); break; diff --git a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32c3 similarity index 100% rename from tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h rename to libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32c3 diff --git a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32s2 similarity index 100% rename from tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h rename to libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32s2 diff --git a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32s3 similarity index 100% rename from tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h rename to libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/.skip.esp32s3 diff --git a/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino new file mode 100644 index 00000000000..77a886209df --- /dev/null +++ b/libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino @@ -0,0 +1,165 @@ +/* + This example smothly blinks GPIO_2 using different frequencies changed after Deep Sleep Time + The PWM and control of blink frequency is done by ULP exclusively + This is an example about how to program the ULP using Arduino + It also demonstrates use of RTM MEMORY to persist data and states +*/ + +#include +#include "esp32/ulp.h" +#include "driver/rtc_io.h" + +// RTC Memory used for ULP internal variable and Sketch interfacing +#define RTC_dutyMeter 0 +#define RTC_dir 4 +#define RTC_fadeDelay 12 +// *fadeCycleDelay is used to pass values to ULP and change its behaviour +uint32_t *fadeCycleDelay = &RTC_SLOW_MEM[RTC_fadeDelay]; +#define ULP_START_OFFSET 32 + +// For ESP32 Arduino, it is usually at offeset 512, defined in sdkconfig +RTC_DATA_ATTR uint32_t ULP_Started = 0; // 0 or 1 + +//Time-to-Sleep +#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */ +#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in microseconds); multiplied by above conversion to achieve seconds*/ + + +void ulp_setup() { + if (ULP_Started) { + return; + } + *fadeCycleDelay = 5; // 5..200 works fine for a full Fade In + Out cycle + ULP_Started = 1; + + // GPIO2 initialization (set to output and initial value is 0) + const gpio_num_t MeterPWMPin = GPIO_NUM_2; + rtc_gpio_init(MeterPWMPin); + rtc_gpio_set_direction(MeterPWMPin, RTC_GPIO_MODE_OUTPUT_ONLY); + rtc_gpio_set_level(MeterPWMPin, 0); + + // if LED is connected to GPIO2 (specify by +RTC_GPIO_OUT_DATA_S : ESP32 is 14, S2/S3 is 10) + const uint32_t MeterPWMBit = rtc_io_number_get(MeterPWMPin) + RTC_GPIO_OUT_DATA_S; + + enum labels { + INIFINITE_LOOP, + RUN_PWM, + NEXT_PWM_CYCLE, + PWM_ON, + PWM_OFF, + END_PWM_CYCLE, + POSITIVE_DIR, + DEC_DUTY, + INC_DUTY, + }; + + // Define ULP program + const ulp_insn_t ulp_prog[] = { + // Initial Value setup + I_MOVI(R0, 0), // R0 = 0 + I_ST(R0, R0, RTC_dutyMeter), // RTC_SLOW_MEM[RTC_dutyMeter] = 0 + I_MOVI(R1, 1), // R1 = 1 + I_ST(R1, R0, RTC_dir), // RTC_SLOW_MEM[RTC_dir] = 1 + + M_LABEL(INIFINITE_LOOP), // while(1) { + + // run certain PWM Duty for about (RTC_fadeDelay x 100) microseconds + I_MOVI(R3, 0), // R3 = 0 + I_LD(R3, R3, RTC_fadeDelay), // R3 = RTC_SLOW_MEM[RTC_fadeDelay] + M_LABEL(RUN_PWM), // do { // repeat RTC_fadeDelay times: + + // execute about 10KHz PWM on GPIO2 using as duty cycle = RTC_SLOW_MEM[RTC_dutyMeter] + I_MOVI(R0, 0), // R0 = 0 + I_LD(R0, R0, RTC_dutyMeter), // R0 = RTC_SLOW_MEM[RTC_dutyMeter] + M_BL(NEXT_PWM_CYCLE, 1), // if (R0 > 0) turn on LED + I_WR_REG(RTC_GPIO_OUT_W1TS_REG, MeterPWMBit, MeterPWMBit, 1), // W1TS set bit to clear GPIO - GPIO2 on + M_LABEL(PWM_ON), // while (R0 > 0) // repeat RTC_dutyMeter times: + M_BL(NEXT_PWM_CYCLE, 1), // { + //I_DELAY(8), // // 8 is about 1 microsecond based on 8MHz + I_SUBI(R0, R0, 1), // R0 = R0 - 1 + M_BX(PWM_ON), // } + M_LABEL(NEXT_PWM_CYCLE), // // toggle GPIO_2 + I_MOVI(R0, 0), // R0 = 0 + I_LD(R0, R0, RTC_dutyMeter), // R0 = RTC_SLOW_MEM[RTC_dutyMeter] + I_MOVI(R1, 100), // R1 = 100 + I_SUBR(R0, R1, R0), // R0 = 100 - dutyMeter + M_BL(END_PWM_CYCLE, 1), // if (R0 > 0) turn off LED + I_WR_REG(RTC_GPIO_OUT_W1TC_REG, MeterPWMBit, MeterPWMBit, 1), // W1TC set bit to clear GPIO - GPIO2 off + M_LABEL(PWM_OFF), // while (R0 > 0) // repeat (100 - RTC_dutyMeter) times: + M_BL(END_PWM_CYCLE, 1), // { + //I_DELAY(8), // // 8 is about 1us: ULP fetch+execution time + I_SUBI(R0, R0, 1), // R0 = R0 - 1 + M_BX(PWM_OFF), // } + M_LABEL(END_PWM_CYCLE), // + + I_SUBI(R3, R3, 1), // R3 = R3 - 1 // RTC_fadeDelay + I_MOVR(R0, R3), // R0 = R3 // only R0 can be used to compare and branch + M_BGE(RUN_PWM, 1), // } while (R3 > 0) // ESP32 repeatinf RTC_fadeDelay times + + // increase/decrease DutyMeter to apply Fade In/Out loop + I_MOVI(R1, 0), // R1 = 0 + I_LD(R1, R1, RTC_dutyMeter), // R1 = RTC_SLOW_MEM[RTC_dutyMeter] + I_MOVI(R0, 0), // R0 = 0 + I_LD(R0, R0, RTC_dir), // R0 = RTC_SLOW_MEM[RTC_dir] + + M_BGE(POSITIVE_DIR, 1), // if(dir == 0) { // decrease duty by 2 + // Dir is 0, means decrease Duty by 2 + I_MOVR(R0, R1), // R0 = Duty + M_BGE(DEC_DUTY, 1), // if (duty == 0) { // change direction and increase duty + I_MOVI(R3, 0), // R3 = 0 + I_MOVI(R2, 1), // R2 = 1 + I_ST(R2, R3, RTC_dir), // RTC_SLOW_MEM[RTC_dir] = 1 // increasing direction + M_BX(INC_DUTY), // goto "increase Duty" + M_LABEL(DEC_DUTY), // } "decrease Duty": + I_SUBI(R0, R0, 2), // Duty -= 2 + I_MOVI(R2, 0), // R2 = 0 + I_ST(R0, R2, RTC_dutyMeter), // RTC_SLOW_MEM[RTC_dutyMeter] += 2 + M_BX(INIFINITE_LOOP), // } + + M_LABEL(POSITIVE_DIR), // else { // dir == 1 // increase duty by 2 + // Dir is 1, means increase Duty by 2 + I_MOVR(R0, R1), // R0 = Duty + M_BL(INC_DUTY, 100), // if (duty == 100) { // change direction and decrease duty + I_MOVI(R2, 0), // R2 = 0 + I_ST(R2, R2, RTC_dir), // RTC_SLOW_MEM[RTC_dir] = 0 // decreasing direction + M_BX(DEC_DUTY), // goto "decrease Duty" + M_LABEL(INC_DUTY), // } "increase Duty": + I_ADDI(R0, R0, 2), // Duty += 2 + I_MOVI(R2, 0), // R2 = 0 + I_ST(R0, R2, RTC_dutyMeter), // RTC_SLOW_MEM[RTC_dutyMeter] -= 2 + // } // if (dir == 0) + M_BX(INIFINITE_LOOP), // } // while(1) + }; + // Run ULP program + size_t size = sizeof(ulp_prog) / sizeof(ulp_insn_t); + ulp_process_macros_and_load(ULP_START_OFFSET, ulp_prog, &size); + esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); + ulp_run(ULP_START_OFFSET); +} + + +void setup() { + Serial.begin(115200); + while (!Serial) {} // wait for Serial to start + + ulp_setup(); // it really only runs on the first ESP32 boot + Serial.printf("\nStarted smooth blink with delay %d\n", *fadeCycleDelay); + + // *fadeCycleDelay resides in RTC_SLOW_MEM and persists along deep sleep waking up + // it is used as a delay time parameter for smooth blinking, in the ULP processing code + if (*fadeCycleDelay < 195) { + *fadeCycleDelay += 10; + } else { + *fadeCycleDelay = 5; // 5..200 works fine for a full Fade In + Out cycle + } + Serial.println("Entering in Deep Sleep"); + esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR /*/ 4*/); // time set with variable above + esp_deep_sleep_start(); + // From this point on, no code is executed in DEEP SLEEP mode +} + + +void loop() { + // It never reaches this code because it enters in Deep Sleep mode at the end of setup() +} + diff --git a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino b/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino index 76f48b757a4..94f2dc735a2 100644 --- a/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino +++ b/libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino @@ -5,13 +5,20 @@ This code displays how to use deep sleep with a touch as a wake up source and how to store data in RTC memory to use it over reboots +ESP32 can have multiple touch pads enabled as wakeup source +ESP32-S2 and ESP32-S3 supports only 1 touch pad as wakeup source enabled + This code is under Public Domain License. Author: Pranav Cherukupalli */ -#define Threshold 40 /* Greater the value, more the sensitivity */ +#if CONFIG_IDF_TARGET_ESP32 + #define THRESHOLD 40 /* Greater the value, more the sensitivity */ +#else //ESP32-S2 and ESP32-S3 + default for other chips (to be adjusted) */ + #define THRESHOLD 5000 /* Lower the value, more the sensitivity */ +#endif RTC_DATA_ATTR int bootCount = 0; touch_pad_t touchPin; @@ -42,24 +49,31 @@ has been awaken from sleep void print_wakeup_touchpad(){ touchPin = esp_sleep_get_touchpad_wakeup_status(); - switch(touchPin) - { - case 0 : Serial.println("Touch detected on GPIO 4"); break; - case 1 : Serial.println("Touch detected on GPIO 0"); break; - case 2 : Serial.println("Touch detected on GPIO 2"); break; - case 3 : Serial.println("Touch detected on GPIO 15"); break; - case 4 : Serial.println("Touch detected on GPIO 13"); break; - case 5 : Serial.println("Touch detected on GPIO 12"); break; - case 6 : Serial.println("Touch detected on GPIO 14"); break; - case 7 : Serial.println("Touch detected on GPIO 27"); break; - case 8 : Serial.println("Touch detected on GPIO 33"); break; - case 9 : Serial.println("Touch detected on GPIO 32"); break; - default : Serial.println("Wakeup not by touchpad"); break; - } -} - -void callback(){ - //placeholder callback function + #if CONFIG_IDF_TARGET_ESP32 + switch(touchPin) + { + case 0 : Serial.println("Touch detected on GPIO 4"); break; + case 1 : Serial.println("Touch detected on GPIO 0"); break; + case 2 : Serial.println("Touch detected on GPIO 2"); break; + case 3 : Serial.println("Touch detected on GPIO 15"); break; + case 4 : Serial.println("Touch detected on GPIO 13"); break; + case 5 : Serial.println("Touch detected on GPIO 12"); break; + case 6 : Serial.println("Touch detected on GPIO 14"); break; + case 7 : Serial.println("Touch detected on GPIO 27"); break; + case 8 : Serial.println("Touch detected on GPIO 33"); break; + case 9 : Serial.println("Touch detected on GPIO 32"); break; + default : Serial.println("Wakeup not by touchpad"); break; + } + #else + if(touchPin < TOUCH_PAD_MAX) + { + Serial.printf("Touch detected on GPIO %d\n", touchPin); + } + else + { + Serial.println("Wakeup not by touchpad"); + } + #endif } void setup(){ @@ -74,11 +88,16 @@ void setup(){ print_wakeup_reason(); print_wakeup_touchpad(); - //Setup interrupt on Touch Pad 3 (GPIO15) - touchAttachInterrupt(T3, callback, Threshold); + #if CONFIG_IDF_TARGET_ESP32 + //Setup sleep wakeup on Touch Pad 3 + 7 (GPIO15 + GPIO 27) + touchSleepWakeUpEnable(T3,THRESHOLD); + touchSleepWakeUpEnable(T7,THRESHOLD); + + #else //ESP32-S2 + ESP32-S3 + //Setup sleep wakeup on Touch Pad 3 (GPIO3) + touchSleepWakeUpEnable(T3,THRESHOLD); - //Configure Touchpad as wakeup source - esp_sleep_enable_touchpad_wakeup(); + #endif //Go to sleep now Serial.println("Going to sleep now"); @@ -88,4 +107,4 @@ void setup(){ void loop(){ //This will never be reached -} +} \ No newline at end of file diff --git a/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino b/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino index ea340980a42..b2e6b35506c 100644 --- a/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino +++ b/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino @@ -31,6 +31,7 @@ #include #include +#include // only for esp_wifi_set_channel() // Global copy of slave esp_now_peer_info_t slave; @@ -55,7 +56,7 @@ void InitESPNow() { // Scan for slaves in AP mode void ScanForSlave() { - int8_t scanResults = WiFi.scanNetworks(); + int16_t scanResults = WiFi.scanNetworks(false, false, false, 300, CHANNEL); // Scan only on one channel // reset on each scan bool slaveFound = 0; memset(&slave, 0, sizeof(slave)); @@ -222,9 +223,11 @@ void setup() { Serial.begin(115200); //Set device in STA mode to begin with WiFi.mode(WIFI_STA); + esp_wifi_set_channel(CHANNEL, WIFI_SECOND_CHAN_NONE); Serial.println("ESPNow/Basic/Master Example"); // This is the mac address of the Master in Station Mode Serial.print("STA MAC: "); Serial.println(WiFi.macAddress()); + Serial.print("STA CHANNEL "); Serial.println(WiFi.channel()); // Init ESPNow with a fallback logic InitESPNow(); // Once ESPNow is successfully Init, we will register for Send CB to diff --git a/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino b/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino index d9029e961e3..d2b5b09b10c 100644 --- a/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino +++ b/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino @@ -57,6 +57,7 @@ void configDeviceAP() { Serial.println("AP Config failed."); } else { Serial.println("AP Config Success. Broadcasting with AP: " + String(SSID)); + Serial.print("AP CHANNEL "); Serial.println(WiFi.channel()); } } diff --git a/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino b/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino index 9f9fcdca349..c9ba0eca6aa 100644 --- a/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino +++ b/libraries/ESP32/examples/FreeRTOS/FreeRTOS.ino @@ -67,9 +67,11 @@ void TaskBlink(void *pvParameters) // This is a task. for (;;) // A Task shall never return or exit. { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) - vTaskDelay(100); // one tick delay (15ms) in between reads for stability + // arduino-esp32 has FreeRTOS configured to have a tick-rate of 1000Hz and portTICK_PERIOD_MS + // refers to how many milliseconds the period between each ticks is, ie. 1ms. + vTaskDelay(1000 / portTICK_PERIOD_MS ); // vTaskDelay wants ticks, not milliseconds digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW - vTaskDelay(100); // one tick delay (15ms) in between reads for stability + vTaskDelay(1000 / portTICK_PERIOD_MS); // 1 second delay } } @@ -92,6 +94,6 @@ void TaskAnalogReadA3(void *pvParameters) // This is a task. int sensorValueA3 = analogRead(A3); // print out the value you read: Serial.println(sensorValueA3); - vTaskDelay(10); // one tick delay (15ms) in between reads for stability + vTaskDelay(100 / portTICK_PERIOD_MS); // 100ms delay } } diff --git a/libraries/RainMaker/README.md b/libraries/RainMaker/README.md index 03f5e4c520a..f12bef3c208 100644 --- a/libraries/RainMaker/README.md +++ b/libraries/RainMaker/README.md @@ -309,7 +309,7 @@ esp_err_t addIntensityParam(int val, const char *param_name = ESP_RMAKER_DEF_INT esp_err_t addCCTParam(int val, const char *param_name = ESP_RMAKER_DEF_CCT_NAME); esp_err_t addDirectionParam(int val, const char *param_name = ESP_RMAKER_DEF_DIRECTION_NAME); esp_err_t addSpeedParam(int val, const char *param_name = ESP_RMAKER_DEF_SPEED_NAME); -esp_err_t addTempratureParam(float val, const char *param_name = ESP_RMAKER_DEF_TEMPERATURE_NAME); +esp_err_t addTemperatureParam(float val, const char *param_name = ESP_RMAKER_DEF_TEMPERATURE_NAME); ``` * **Standard Parameters** diff --git a/libraries/RainMaker/examples/RMakerCustom/RMakerCustom.ino b/libraries/RainMaker/examples/RMakerCustom/RMakerCustom.ino index f10f858cad7..74b0c39bd3d 100644 --- a/libraries/RainMaker/examples/RMakerCustom/RMakerCustom.ino +++ b/libraries/RainMaker/examples/RMakerCustom/RMakerCustom.ino @@ -26,7 +26,7 @@ static Device my_device("Dimmer", "custom.device.dimmer", &gpio_dimmer); void sysProvEvent(arduino_event_t *sys_event) { - switch (sys_event->event_id) { + switch (sys_event->event_id) { case ARDUINO_EVENT_PROV_START: #if CONFIG_IDF_TARGET_ESP32S2 Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop); @@ -34,7 +34,7 @@ void sysProvEvent(arduino_event_t *sys_event) #else Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop); printQR(service_name, pop, "ble"); -#endif +#endif break; default:; } @@ -63,7 +63,7 @@ void setup() pinMode(gpio_dimmer, OUTPUT); digitalWrite(gpio_dimmer, DEFAULT_POWER_MODE); - Node my_node; + Node my_node; my_node = RMaker.initNode("ESP RainMaker Node"); //Create custom dimmer device @@ -78,13 +78,13 @@ void setup() my_device.addParam(level_param); my_device.addCb(write_callback); - - //Add custom dimmer device to the node + + //Add custom dimmer device to the node my_node.addDevice(my_device); - //This is optional + //This is optional RMaker.enableOTA(OTA_USING_PARAMS); - //If you want to enable scheduling, set time zone for your region using setTimeZone(). + //If you want to enable scheduling, set time zone for your region using setTimeZone(). //The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html // RMaker.setTimeZone("Asia/Shanghai"); // Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone @@ -92,6 +92,8 @@ void setup() RMaker.enableSchedule(); + RMaker.enableScenes(); + RMaker.start(); WiFi.onEvent(sysProvEvent); diff --git a/libraries/RainMaker/examples/RMakerCustomAirCooler/RMakerCustomAirCooler.ino b/libraries/RainMaker/examples/RMakerCustomAirCooler/RMakerCustomAirCooler.ino index 5b36ecffd06..aa59c060f70 100644 --- a/libraries/RainMaker/examples/RMakerCustomAirCooler/RMakerCustomAirCooler.ino +++ b/libraries/RainMaker/examples/RMakerCustomAirCooler/RMakerCustomAirCooler.ino @@ -43,7 +43,7 @@ static Device my_device("Air Cooler", "my.device.air-cooler", NULL); void sysProvEvent(arduino_event_t *sys_event) { - switch (sys_event->event_id) { + switch (sys_event->event_id) { case ARDUINO_EVENT_PROV_START: #if CONFIG_IDF_TARGET_ESP32S2 Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop); @@ -51,7 +51,7 @@ void sysProvEvent(arduino_event_t *sys_event) #else Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop); printQR(service_name, pop, "ble"); -#endif +#endif break; default:; } @@ -114,7 +114,7 @@ void setup() pinMode(gpio_speed, OUTPUT); analogWrite(gpio_speed, DEFAULT_SPEED); - Node my_node; + Node my_node; my_node = RMaker.initNode("ESP RainMaker Node"); //Create custom air cooler device @@ -138,13 +138,13 @@ void setup() my_device.addParam(mode_param); my_device.addCb(write_callback); - - //Add custom Air Cooler device to the node + + //Add custom Air Cooler device to the node my_node.addDevice(my_device); - //This is optional + //This is optional // RMaker.enableOTA(OTA_USING_PARAMS); - //If you want to enable scheduling, set time zone for your region using setTimeZone(). + //If you want to enable scheduling, set time zone for your region using setTimeZone(). //The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html // RMaker.setTimeZone("Asia/Shanghai"); //Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone @@ -152,6 +152,8 @@ void setup() RMaker.enableSchedule(); + RMaker.enableScenes(); + RMaker.start(); WiFi.onEvent(sysProvEvent); diff --git a/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino b/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino index b571f4f5dac..38b459ffd20 100644 --- a/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino +++ b/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino @@ -31,12 +31,12 @@ LightSwitch switch_ch1 = {gpio_switch1, false}; LightSwitch switch_ch2 = {gpio_switch2, false}; //The framework provides some standard device types like switch, lightbulb, fan, temperature sensor. -static Switch my_switch1("Switch_ch1", &gpio_relay1); -static Switch my_switch2("Switch_ch2", &gpio_relay2); +static Switch my_switch1; +static Switch my_switch2; void sysProvEvent(arduino_event_t *sys_event) { - switch (sys_event->event_id) { + switch (sys_event->event_id) { case ARDUINO_EVENT_PROV_START: #if CONFIG_IDF_TARGET_ESP32 Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop); @@ -44,7 +44,7 @@ void sysProvEvent(arduino_event_t *sys_event) #else Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop); printQR(service_name, pop, "softap"); -#endif +#endif break; case ARDUINO_EVENT_WIFI_STA_CONNECTED: Serial.printf("\nConnected to Wi-Fi!\n"); @@ -60,18 +60,18 @@ void write_callback(Device *device, Param *param, const param_val_t val, void *p const char *param_name = param->getParamName(); if(strcmp(device_name, "Switch_ch1") == 0) { - + Serial.printf("Lightbulb = %s\n", val.val.b? "true" : "false"); - + if(strcmp(param_name, "Power") == 0) { Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false", device_name, param_name); switch_state_ch1 = val.val.b; (switch_state_ch1 == false) ? digitalWrite(gpio_relay1, LOW) : digitalWrite(gpio_relay1, HIGH); param->updateAndReport(val); } - + } else if(strcmp(device_name, "Switch_ch2") == 0) { - + Serial.printf("Switch value = %s\n", val.val.b? "true" : "false"); if(strcmp(param_name, "Power") == 0) { @@ -80,9 +80,9 @@ void write_callback(Device *device, Param *param, const param_val_t val, void *p (switch_state_ch2 == false) ? digitalWrite(gpio_relay2, LOW) : digitalWrite(gpio_relay2, HIGH); param->updateAndReport(val); } - + } - + } void ARDUINO_ISR_ATTR isr(void* arg) { @@ -92,8 +92,9 @@ void ARDUINO_ISR_ATTR isr(void* arg) { void setup() { + uint32_t chipId = 0; - + Serial.begin(115200); // Configure the input GPIOs @@ -102,7 +103,7 @@ void setup() attachInterruptArg(switch_ch1.pin, isr, &switch_ch1, CHANGE); pinMode(switch_ch2.pin, INPUT_PULLUP); attachInterruptArg(switch_ch2.pin, isr, &switch_ch2, CHANGE); - + // Set the Relays GPIOs as output mode pinMode(gpio_relay1, OUTPUT); pinMode(gpio_relay2, OUTPUT); @@ -112,25 +113,30 @@ void setup() digitalWrite(gpio_relay2, DEFAULT_POWER_MODE); digitalWrite(gpio_led, false); - Node my_node; + Node my_node; my_node = RMaker.initNode("Sonoff Dual R3"); + //Initialize switch device + my_switch1 = Switch("Switch_ch1", &gpio_relay1); + my_switch2 = Switch("Switch_ch2", &gpio_relay2); + //Standard switch device my_switch1.addCb(write_callback); my_switch2.addCb(write_callback); - //Add switch device to the node + //Add switch device to the node my_node.addDevice(my_switch1); my_node.addDevice(my_switch2); - //This is optional + //This is optional RMaker.enableOTA(OTA_USING_PARAMS); - //If you want to enable scheduling, set time zone for your region using setTimeZone(). + //If you want to enable scheduling, set time zone for your region using setTimeZone(). //The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html // RMaker.setTimeZone("Asia/Shanghai"); // Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone RMaker.enableTZService(); RMaker.enableSchedule(); + RMaker.enableScenes(); //Service Name for(int i=0; i<17; i=i+8) { diff --git a/libraries/RainMaker/examples/RMakerSwitch/RMakerSwitch.ino b/libraries/RainMaker/examples/RMakerSwitch/RMakerSwitch.ino index 52afe11076e..53d71387b15 100644 --- a/libraries/RainMaker/examples/RMakerSwitch/RMakerSwitch.ino +++ b/libraries/RainMaker/examples/RMakerSwitch/RMakerSwitch.ino @@ -21,11 +21,11 @@ static int gpio_switch = 16; bool switch_state = true; //The framework provides some standard device types like switch, lightbulb, fan, temperaturesensor. -static Switch my_switch("Switch", &gpio_switch); +static Switch my_switch; void sysProvEvent(arduino_event_t *sys_event) { - switch (sys_event->event_id) { + switch (sys_event->event_id) { case ARDUINO_EVENT_PROV_START: #if CONFIG_IDF_TARGET_ESP32S2 Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop); @@ -33,7 +33,7 @@ void sysProvEvent(arduino_event_t *sys_event) #else Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop); printQR(service_name, pop, "ble"); -#endif +#endif break; default:; } @@ -59,18 +59,21 @@ void setup() pinMode(gpio_switch, OUTPUT); digitalWrite(gpio_switch, DEFAULT_POWER_MODE); - Node my_node; + Node my_node; my_node = RMaker.initNode("ESP RainMaker Node"); + //Initialize switch device + my_switch = Switch("Switch", &gpio_switch); + //Standard switch device my_switch.addCb(write_callback); - - //Add switch device to the node + + //Add switch device to the node my_node.addDevice(my_switch); - //This is optional + //This is optional RMaker.enableOTA(OTA_USING_PARAMS); - //If you want to enable scheduling, set time zone for your region using setTimeZone(). + //If you want to enable scheduling, set time zone for your region using setTimeZone(). //The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html // RMaker.setTimeZone("Asia/Shanghai"); // Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone @@ -78,6 +81,8 @@ void setup() RMaker.enableSchedule(); + RMaker.enableScenes(); + RMaker.start(); WiFi.onEvent(sysProvEvent); diff --git a/libraries/RainMaker/src/RMaker.cpp b/libraries/RainMaker/src/RMaker.cpp index 2fda954c1ea..c7e3e921dd5 100644 --- a/libraries/RainMaker/src/RMaker.cpp +++ b/libraries/RainMaker/src/RMaker.cpp @@ -3,9 +3,12 @@ #include "RMaker.h" #include #include +#include bool wifiLowLevelInit(bool persistent); static esp_err_t err; +extern "C" bool verifyRollbackLater() { return true; } + static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) { if (event_base == RMAKER_EVENT) { @@ -25,6 +28,33 @@ static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_ default: log_i("Unhandled RainMaker Event:"); } + } else if (event_base == RMAKER_OTA_EVENT) { + if (event_data == NULL) { + event_data = (void*)""; + } + switch(event_id) { + case RMAKER_OTA_EVENT_STARTING: + log_i("Starting OTA"); + break; + case RMAKER_OTA_EVENT_IN_PROGRESS: + log_i("OTA in progress : %s", (char*)event_data); + break; + case RMAKER_OTA_EVENT_SUCCESSFUL: + log_i("OTA Successful : %s", (char*)event_data); + break; + case RMAKER_OTA_EVENT_FAILED: + log_i("OTA Failed : %s", (char*)event_data); + break; + case RMAKER_OTA_EVENT_DELAYED: + log_i("OTA Delayed : %s", (char*)event_data); + break; + case RMAKER_OTA_EVENT_REJECTED: + log_i("OTA Rejected : %s", (char*)event_data); + break; + default: + log_i("Unhandled OTA Event"); + break; + } } } @@ -39,6 +69,7 @@ Node RMakerClass::initNode(const char *name, const char *type) Node node; esp_rmaker_node_t *rnode = NULL; esp_event_handler_register(RMAKER_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL); + esp_event_handler_register(RMAKER_OTA_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL); rnode = esp_rmaker_node_init(&rainmaker_cfg, name, type); if (!rnode){ log_e("Node init failed"); @@ -50,7 +81,7 @@ Node RMakerClass::initNode(const char *name, const char *type) esp_err_t RMakerClass::start() { - err = esp_rmaker_start(); + err = esp_rmaker_start(); if(err != ESP_OK){ log_e("ESP RainMaker core task failed"); } @@ -104,8 +135,11 @@ esp_err_t RMakerClass::enableTZService() esp_err_t RMakerClass::enableOTA(ota_type_t type, const char *cert) { - esp_rmaker_ota_config_t ota_config; - ota_config.server_cert = cert; + esp_rmaker_ota_config_t ota_config = { + .ota_cb = NULL, + .ota_diag = NULL, + .server_cert = cert, + }; err = esp_rmaker_ota_enable(&ota_config, type); if(err != ESP_OK) { log_e("OTA enable failed"); @@ -113,5 +147,13 @@ esp_err_t RMakerClass::enableOTA(ota_type_t type, const char *cert) return err; } +esp_err_t RMakerClass::enableScenes() +{ + err = esp_rmaker_scenes_enable(); + if (err != ESP_OK) { + log_e("Scenes enable failed"); + } + return err; +} RMakerClass RMaker; #endif diff --git a/libraries/RainMaker/src/RMaker.h b/libraries/RainMaker/src/RMaker.h index dbfbe5c49f5..69930052f6a 100644 --- a/libraries/RainMaker/src/RMaker.h +++ b/libraries/RainMaker/src/RMaker.h @@ -25,9 +25,9 @@ class RMakerClass { private: esp_rmaker_config_t rainmaker_cfg = {false}; - + public: - + void setTimeSync(bool val); Node initNode(const char *name, const char *type = "ESP RainMaker with Arduino"); esp_err_t deinitNode(Node node); @@ -35,6 +35,7 @@ class RMakerClass esp_err_t enableSchedule(); esp_err_t enableTZService(); esp_err_t enableOTA(ota_type_t type, const char *cert = ESP_RMAKER_OTA_DEFAULT_SERVER_CERT); + esp_err_t enableScenes(); esp_err_t start(); esp_err_t stop(); }; diff --git a/libraries/RainMaker/src/RMakerDevice.cpp b/libraries/RainMaker/src/RMakerDevice.cpp index dd1a3ba4ea4..87dcb4c1bff 100644 --- a/libraries/RainMaker/src/RMakerDevice.cpp +++ b/libraries/RainMaker/src/RMakerDevice.cpp @@ -125,7 +125,7 @@ esp_err_t Device::addSpeedParam(int val, const char *param_name) return esp_rmaker_device_add_param(getDeviceHandle(), param); } -esp_err_t Device::addTempratureParam(float val, const char *param_name) +esp_err_t Device::addTemperatureParam(float val, const char *param_name) { param_handle_t *param = esp_rmaker_temperature_param_create(param_name, val); return esp_rmaker_device_add_param(getDeviceHandle(), param); diff --git a/libraries/RainMaker/src/RMakerDevice.h b/libraries/RainMaker/src/RMakerDevice.h index f813359a25a..0c92f79c57f 100644 --- a/libraries/RainMaker/src/RMakerDevice.h +++ b/libraries/RainMaker/src/RMakerDevice.h @@ -71,7 +71,7 @@ class Device esp_err_t addCCTParam(int val, const char *param_name = ESP_RMAKER_DEF_CCT_NAME); esp_err_t addDirectionParam(int val, const char *param_name = ESP_RMAKER_DEF_DIRECTION_NAME); esp_err_t addSpeedParam(int val, const char *param_name = ESP_RMAKER_DEF_SPEED_NAME); - esp_err_t addTempratureParam(float val, const char *param_name = ESP_RMAKER_DEF_TEMPERATURE_NAME); + esp_err_t addTemperatureParam(float val, const char *param_name = ESP_RMAKER_DEF_TEMPERATURE_NAME); //Update Parameter esp_err_t updateAndReportParam(const char *param_name, bool val); diff --git a/libraries/RainMaker/src/RMakerUtils.cpp b/libraries/RainMaker/src/RMakerUtils.cpp index 1d800b72df8..b8af2187c1a 100644 --- a/libraries/RainMaker/src/RMakerUtils.cpp +++ b/libraries/RainMaker/src/RMakerUtils.cpp @@ -1,12 +1,13 @@ #include "RMakerUtils.h" #ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK -void RMakerFactoryReset(int seconds) +#define RESET_DELAY_SEC 2 +void RMakerFactoryReset(int reboot_seconds) { - esp_rmaker_factory_reset(0, seconds); + esp_rmaker_factory_reset(RESET_DELAY_SEC, reboot_seconds); } -void RMakerWiFiReset(int seconds) +void RMakerWiFiReset(int reboot_seconds) { - esp_rmaker_wifi_reset(0, seconds); + esp_rmaker_wifi_reset(RESET_DELAY_SEC, reboot_seconds); } #endif \ No newline at end of file diff --git a/libraries/USB/src/USBHID.cpp b/libraries/USB/src/USBHID.cpp index a5bdb2d6739..521e0803970 100644 --- a/libraries/USB/src/USBHID.cpp +++ b/libraries/USB/src/USBHID.cpp @@ -310,7 +310,21 @@ bool USBHID::ready(void){ return tud_hid_n_ready(0); } -void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len){ +// TinyUSB is in the process of changing the type of the last argument to +// tud_hid_report_complete_cb(), so extract the type from the version of TinyUSB that we're +// compiled with. +template struct ArgType; + +template +struct ArgType { + typedef T1 type1; + typedef T2 type2; + typedef T3 type3; +}; + +typedef ArgType::type3 tud_hid_report_complete_cb_len_t; + +void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, tud_hid_report_complete_cb_len_t len){ if (tinyusb_hid_device_input_sem) { xSemaphoreGive(tinyusb_hid_device_input_sem); } @@ -331,11 +345,16 @@ bool USBHID::SendReport(uint8_t id, const void* data, size_t len, uint32_t timeo if(!res){ log_e("not ready"); } else { + // The semaphore may be given if the last SendReport() timed out waiting for the report to + // be sent. Or, tud_hid_report_complete_cb() may be called an extra time, causing the + // semaphore to be given. In these cases, take the semaphore to clear its state so that + // we can wait for it to be given after calling tud_hid_n_report(). + xSemaphoreTake(tinyusb_hid_device_input_sem, 0); + res = tud_hid_n_report(0, id, data, len); if(!res){ log_e("report %u failed", id); } else { - xSemaphoreTake(tinyusb_hid_device_input_sem, 0); if(xSemaphoreTake(tinyusb_hid_device_input_sem, timeout_ms / portTICK_PERIOD_MS) != pdTRUE){ log_e("report %u wait failed", id); res = false; diff --git a/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino b/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino index 2bde96d9488..4b9b91e82d8 100644 --- a/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino +++ b/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino @@ -62,8 +62,6 @@ void setup() } -int value = 0; - void loop(){ WiFiClient client = server.available(); // listen for incoming clients diff --git a/libraries/WiFi/examples/WiFiTelnetToSerialIPv6/WiFiTelnetToSerialIPv6.ino b/libraries/WiFi/examples/WiFiTelnetToSerialIPv6/WiFiTelnetToSerialIPv6.ino new file mode 100644 index 00000000000..99b1c0c82e9 --- /dev/null +++ b/libraries/WiFi/examples/WiFiTelnetToSerialIPv6/WiFiTelnetToSerialIPv6.ino @@ -0,0 +1,132 @@ +/* + WiFiTelnetToSerial - Example Transparent UART to Telnet Server for ESP32 + + Copyright (c) 2017 Hristo Gochkov. All rights reserved. + This file is part of the ESP32 WiFi library for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include +#include + +WiFiMulti wifiMulti; + +//Even this example state IPv6, it is dual stack and compatible with IPv4 too + +//how many clients should be able to telnet to this ESP32 +#define MAX_SRV_CLIENTS 1 +const char* ssid = "**********"; +const char* password = "**********"; + +WiFiServer server(23); +WiFiClient serverClients[MAX_SRV_CLIENTS]; + +void setup() { + Serial.begin(115200); + Serial.println("\nConnecting"); + + wifiMulti.IPv6(true); + wifiMulti.addAP(ssid, password); + wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2"); + wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3"); + + Serial.println("Connecting Wifi "); + for (int loops = 10; loops > 0; loops--) { + if (wifiMulti.run() == WL_CONNECTED) { + Serial.println(""); + Serial.print("WiFi connected "); + Serial.print("IP address: "); + Serial.println(WiFi.localIP()); + break; + } + else { + Serial.println(loops); + delay(1000); + } + } + if (wifiMulti.run() != WL_CONNECTED) { + Serial.println("WiFi connect failed"); + delay(1000); + ESP.restart(); + } + + //start UART and the server + Serial1.begin(9600); + server.begin(); + server.setNoDelay(true); + + Serial.print("Ready! Use 'telnet "); + Serial.print(WiFi.localIP()); + Serial.println(" 23' to connect"); +} + +void loop() { + uint8_t i; + if (wifiMulti.run() == WL_CONNECTED) { + //check if there are any new clients + if (server.hasClient()){ + for(i = 0; i < MAX_SRV_CLIENTS; i++){ + //find free/disconnected spot + if (!serverClients[i] || !serverClients[i].connected()){ + if(serverClients[i]) serverClients[i].stop(); + serverClients[i] = server.available(); + if (!serverClients[i]) Serial.println("available broken"); + Serial.print("New client: "); + Serial.print(i); Serial.print(' '); + Serial.println(serverClients[i].remoteIP6()); + break; + } + } + if (i >= MAX_SRV_CLIENTS) { + //no free/disconnected spot so reject + server.available().stop(); + } + } + //check clients for data + for(i = 0; i < MAX_SRV_CLIENTS; i++){ + if (serverClients[i] && serverClients[i].connected()){ + if(serverClients[i].available()){ + //get data from the telnet client and push it to the UART + while(serverClients[i].available()) Serial1.write(serverClients[i].read()); + } + } + else { + if (serverClients[i]) { + serverClients[i].stop(); + } + } + } + //check UART for data + if(Serial1.available()){ + size_t len = Serial1.available(); + uint8_t sbuf[len]; + Serial1.readBytes(sbuf, len); + //push UART data to all connected telnet clients + for(i = 0; i < MAX_SRV_CLIENTS; i++){ + if (serverClients[i] && serverClients[i].connected()){ + serverClients[i].write(sbuf, len); + delay(1); + } + } + } + } + else { + Serial.println("WiFi not connected!"); + for(i = 0; i < MAX_SRV_CLIENTS; i++) { + if (serverClients[i]) serverClients[i].stop(); + } + delay(1000); + } +} diff --git a/libraries/WiFi/src/WiFiClient.cpp b/libraries/WiFi/src/WiFiClient.cpp index 6e56e94ac53..cf8cde4a7b2 100644 --- a/libraries/WiFi/src/WiFiClient.cpp +++ b/libraries/WiFi/src/WiFiClient.cpp @@ -23,6 +23,11 @@ #include #include +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((((__const uint32_t *) (a))[0] == 0) \ + && (((__const uint32_t *) (a))[1] == 0) \ + && (((__const uint32_t *) (a))[2] == htonl (0xffff))) + #define WIFI_CLIENT_DEF_CONN_TIMEOUT_MS (3000) #define WIFI_CLIENT_MAX_WRITE_RETRY (10) #define WIFI_CLIENT_SELECT_TIMEOUT_US (1000000) @@ -210,22 +215,34 @@ int WiFiClient::connect(IPAddress ip, uint16_t port) { return connect(ip,port,_timeout); } + int WiFiClient::connect(IPAddress ip, uint16_t port, int32_t timeout) { + struct sockaddr_storage serveraddr; _timeout = timeout; - int sockfd = socket(AF_INET, SOCK_STREAM, 0); + int sockfd = -1; + + if (ip.type() == IPv6) { + struct sockaddr_in6 *tmpaddr = (struct sockaddr_in6 *)&serveraddr; + memset((char *) tmpaddr, 0, sizeof(struct sockaddr_in)); + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + tmpaddr->sin6_family = AF_INET6; + memcpy(tmpaddr->sin6_addr.un.u8_addr, &ip[0], 16); + tmpaddr->sin6_port = htons(port); + } else { + struct sockaddr_in *tmpaddr = (struct sockaddr_in *)&serveraddr; + memset((char *) tmpaddr, 0, sizeof(struct sockaddr_in)); + sockfd = socket(AF_INET, SOCK_STREAM, 0); + tmpaddr->sin_family = AF_INET; + tmpaddr->sin_addr.s_addr = ip; + tmpaddr->sin_port = htons(port); + } if (sockfd < 0) { log_e("socket: %d", errno); return 0; } fcntl( sockfd, F_SETFL, fcntl( sockfd, F_GETFL, 0 ) | O_NONBLOCK ); - uint32_t ip_addr = ip; - struct sockaddr_in serveraddr; - memset((char *) &serveraddr, 0, sizeof(serveraddr)); - serveraddr.sin_family = AF_INET; - memcpy((void *)&serveraddr.sin_addr.s_addr, (const void *)(&ip_addr), 4); - serveraddr.sin_port = htons(port); fd_set fdset; struct timeval tv; FD_ZERO(&fdset); @@ -294,6 +311,19 @@ int WiFiClient::connect(const char *host, uint16_t port) int WiFiClient::connect(const char *host, uint16_t port, int32_t timeout) { + if (WiFiGenericClass::getStatusBits() & WIFI_WANT_IP6_BIT) { + ip_addr_t srv6; + if(!WiFiGenericClass::hostByName6(host, srv6)){ + return 0; + } + if (srv6.type == IPADDR_TYPE_V4) { + IPAddress ip(srv6.u_addr.ip4.addr); + return connect(ip, port, timeout); + } else { + IPAddress ip(IPv6, (uint8_t*)&srv6.u_addr.ip6.addr[0]); + return connect(ip, port, timeout); + } + } IPAddress srv((uint32_t)0); if(!WiFiGenericClass::hostByName(host, srv)){ return 0; @@ -562,8 +592,24 @@ IPAddress WiFiClient::remoteIP(int fd) const struct sockaddr_storage addr; socklen_t len = sizeof addr; getpeername(fd, (struct sockaddr*)&addr, &len); - struct sockaddr_in *s = (struct sockaddr_in *)&addr; - return IPAddress((uint32_t)(s->sin_addr.s_addr)); + + // IPv4 socket, old way + if (((struct sockaddr*)&addr)->sa_family == AF_INET) { + struct sockaddr_in *s = (struct sockaddr_in *)&addr; + return IPAddress((uint32_t)(s->sin_addr.s_addr)); + } + + // IPv6, but it might be IPv4 mapped address + if (((struct sockaddr*)&addr)->sa_family == AF_INET6) { + struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *)&addr; + if (IN6_IS_ADDR_V4MAPPED(saddr6->sin6_addr.un.u32_addr)) { + return IPAddress(IPv4, (uint8_t*)saddr6->sin6_addr.s6_addr+12); + } else { + return IPAddress(IPv6, (uint8_t*)(saddr6->sin6_addr.s6_addr)); + } + } + log_e("WiFiClient::remoteIP Not AF_INET or AF_INET6?"); + return (IPAddress(0,0,0,0)); } uint16_t WiFiClient::remotePort(int fd) const diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp index e64ac631020..3f8a9d797ca 100644 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ b/libraries/WiFi/src/WiFiGeneric.cpp @@ -943,10 +943,13 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event) } else if(event->event_id == ARDUINO_EVENT_WIFI_STA_CONNECTED) { WiFiSTAClass::_setStatus(WL_IDLE_STATUS); setStatusBits(STA_CONNECTED_BIT); - - //esp_netif_create_ip6_linklocal(esp_netifs[ESP_IF_WIFI_STA]); + if (getStatusBits() & WIFI_WANT_IP6_BIT) + esp_netif_create_ip6_linklocal(esp_netifs[ESP_IF_WIFI_STA]); } else if(event->event_id == ARDUINO_EVENT_WIFI_STA_DISCONNECTED) { uint8_t reason = event->event_info.wifi_sta_disconnected.reason; + // Reason 0 causes crash, use reason 1 (UNSPECIFIED) instead + if(!reason) + reason = WIFI_REASON_UNSPECIFIED; log_w("Reason: %u - %s", reason, reason2str(reason)); if(reason == WIFI_REASON_NO_AP_FOUND) { WiFiSTAClass::_setStatus(WL_NO_SSID_AVAIL); @@ -960,26 +963,26 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event) WiFiSTAClass::_setStatus(WL_DISCONNECTED); } clearStatusBits(STA_CONNECTED_BIT | STA_HAS_IP_BIT | STA_HAS_IP6_BIT); - if(first_connect && ((reason == WIFI_REASON_AUTH_EXPIRE) || - (reason >= WIFI_REASON_BEACON_TIMEOUT))) - { - log_d("WiFi Reconnect Running"); - WiFi.disconnect(); - WiFi.begin(); + + bool DoReconnect = false; + if(reason == WIFI_REASON_ASSOC_LEAVE) { //Voluntarily disconnected. Don't reconnect! + } + else if(first_connect) { //Retry once for all failure reasons first_connect = false; + DoReconnect = true; + log_d("WiFi Reconnect Running"); } - else if(WiFi.getAutoReconnect()){ - if((reason == WIFI_REASON_AUTH_EXPIRE) || - (reason >= WIFI_REASON_BEACON_TIMEOUT && reason != WIFI_REASON_AUTH_FAIL)) - { - log_d("WiFi AutoReconnect Running"); - WiFi.disconnect(); - WiFi.begin(); - } + else if(WiFi.getAutoReconnect() && _isReconnectableReason(reason)) { + DoReconnect = true; + log_d("WiFi AutoReconnect Running"); } - else if (reason == WIFI_REASON_ASSOC_FAIL){ + else if(reason == WIFI_REASON_ASSOC_FAIL) { WiFiSTAClass::_setStatus(WL_CONNECT_FAILED); } + if(DoReconnect) { + WiFi.disconnect(); + WiFi.begin(); + } } else if(event->event_id == ARDUINO_EVENT_WIFI_STA_GOT_IP) { #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr); @@ -1063,6 +1066,36 @@ esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event) return ESP_OK; } +bool WiFiGenericClass::_isReconnectableReason(uint8_t reason) { + switch(reason) { + //Timeouts (retry) + case WIFI_REASON_AUTH_EXPIRE: + case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT: + case WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT: + case WIFI_REASON_802_1X_AUTH_FAILED: + case WIFI_REASON_HANDSHAKE_TIMEOUT: + //Transient error (reconnect) + case WIFI_REASON_AUTH_LEAVE: + case WIFI_REASON_ASSOC_EXPIRE: + case WIFI_REASON_ASSOC_TOOMANY: + case WIFI_REASON_NOT_AUTHED: + case WIFI_REASON_NOT_ASSOCED: + case WIFI_REASON_ASSOC_NOT_AUTHED: + case WIFI_REASON_MIC_FAILURE: + case WIFI_REASON_IE_IN_4WAY_DIFFERS: + case WIFI_REASON_INVALID_PMKID: + case WIFI_REASON_BEACON_TIMEOUT: + case WIFI_REASON_NO_AP_FOUND: + case WIFI_REASON_ASSOC_FAIL: + case WIFI_REASON_CONNECTION_FAIL: + case WIFI_REASON_AP_TSF_RESET: + case WIFI_REASON_ROAMING: + return true; + default: + return false; + } +} + /** * Return the current channel associated with the network * @return channel (1-13) @@ -1413,6 +1446,25 @@ static void wifi_dns_found_callback(const char *name, const ip_addr_t *ipaddr, v xEventGroupSetBits(_arduino_event_group, WIFI_DNS_DONE_BIT); } +/** + * IPv6 compatible DNS callback + * @param name + * @param ipaddr + * @param callback_arg + */ +static void wifi_dns6_found_callback(const char *name, const ip_addr_t *ipaddr, void *callback_arg) +{ + struct dns_api_msg *msg = (struct dns_api_msg *)callback_arg; + + if(ipaddr && !msg->result) { + msg->ip_addr = *ipaddr; + msg->result = 1; + } else { + msg->result = -1; + } + xEventGroupSetBits(_arduino_event_group, WIFI_DNS_DONE_BIT); +} + /** * Resolve the given hostname to an IP address. * @param aHostname Name to be resolved @@ -1440,6 +1492,37 @@ int WiFiGenericClass::hostByName(const char* aHostname, IPAddress& aResult) return (uint32_t)aResult != 0; } +/** + * Resolve the given hostname to an IP6 address. + * @param aHostname Name to be resolved + * @param aResult IPv6Address structure to store the returned IP address + * @return 1 if aHostname was successfully converted to an IP address, + * else error code + */ +int WiFiGenericClass::hostByName6(const char* aHostname, ip_addr_t& aResult) +{ + ip_addr_t addr; + struct dns_api_msg arg; + + memset(&arg, 0x0, sizeof(arg)); + waitStatusBits(WIFI_DNS_IDLE_BIT, 16000); + clearStatusBits(WIFI_DNS_IDLE_BIT | WIFI_DNS_DONE_BIT); + + err_t err = dns_gethostbyname_addrtype(aHostname, &addr, &wifi_dns6_found_callback, + &arg, LWIP_DNS_ADDRTYPE_IPV6_IPV4); + if(err == ERR_OK) { + aResult = addr; + } else if(err == ERR_INPROGRESS) { + waitStatusBits(WIFI_DNS_DONE_BIT, 15000); //real internal timeout in lwip library is 14[s] + clearStatusBits(WIFI_DNS_DONE_BIT); + if (arg.result == 1) { + aResult = arg.ip_addr; + } + } + setStatusBits(WIFI_DNS_IDLE_BIT); + return (uint32_t)err == ERR_OK || (err == ERR_INPROGRESS && arg.result == 1); +} + IPAddress WiFiGenericClass::calculateNetworkID(IPAddress ip, IPAddress subnet) { IPAddress networkID; diff --git a/libraries/WiFi/src/WiFiGeneric.h b/libraries/WiFi/src/WiFiGeneric.h index 62642b43dc7..f969cfc7266 100644 --- a/libraries/WiFi/src/WiFiGeneric.h +++ b/libraries/WiFi/src/WiFiGeneric.h @@ -138,6 +138,7 @@ static const int WIFI_SCANNING_BIT = BIT11; static const int WIFI_SCAN_DONE_BIT= BIT12; static const int WIFI_DNS_IDLE_BIT = BIT13; static const int WIFI_DNS_DONE_BIT = BIT14; +static const int WIFI_WANT_IP6_BIT = BIT15; typedef enum { WIFI_RX_ANT0 = 0, @@ -151,6 +152,11 @@ typedef enum { WIFI_TX_ANT_AUTO } wifi_tx_ant_t; +struct dns_api_msg { + ip_addr_t ip_addr; + int result; +}; + class WiFiGenericClass { public: @@ -206,9 +212,13 @@ class WiFiGenericClass static int setStatusBits(int bits); static int clearStatusBits(int bits); - + + private: + static bool _isReconnectableReason(uint8_t reason); + public: static int hostByName(const char *aHostname, IPAddress &aResult); + static int hostByName6(const char *aHostname, ip_addr_t& aResult); static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet); static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet); diff --git a/libraries/WiFi/src/WiFiMulti.cpp b/libraries/WiFi/src/WiFiMulti.cpp index 3d69e481293..9e7f03c6531 100644 --- a/libraries/WiFi/src/WiFiMulti.cpp +++ b/libraries/WiFi/src/WiFiMulti.cpp @@ -30,6 +30,7 @@ WiFiMulti::WiFiMulti() { + ipv6_support = false; } WiFiMulti::~WiFiMulti() @@ -160,6 +161,8 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout) log_i("[WIFI] Connecting BSSID: %02X:%02X:%02X:%02X:%02X:%02X SSID: %s Channel: %d (%d)", bestBSSID[0], bestBSSID[1], bestBSSID[2], bestBSSID[3], bestBSSID[4], bestBSSID[5], bestNetwork.ssid, bestChannel, bestNetworkDb); WiFi.begin(bestNetwork.ssid, bestNetwork.passphrase, bestChannel, bestBSSID); + if (ipv6_support == true) + WiFi.IPv6(true); status = WiFi.status(); auto startTime = millis(); @@ -202,3 +205,7 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout) return status; } + +void WiFiMulti::IPv6(bool state) { + ipv6_support = state; +} diff --git a/libraries/WiFi/src/WiFiMulti.h b/libraries/WiFi/src/WiFiMulti.h index 38ddb5d9f95..bbeb78dc860 100644 --- a/libraries/WiFi/src/WiFiMulti.h +++ b/libraries/WiFi/src/WiFiMulti.h @@ -42,10 +42,12 @@ class WiFiMulti bool addAP(const char* ssid, const char *passphrase = NULL); + void IPv6(bool state); uint8_t run(uint32_t connectTimeout=5000); private: std::vector APlist; + bool ipv6_support; }; #endif /* WIFICLIENTMULTI_H_ */ diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index 7bcafea1d3e..d8075868475 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -732,6 +732,19 @@ bool WiFiSTAClass::enableIpV6() return esp_netif_create_ip6_linklocal(get_esp_interface_netif(ESP_IF_WIFI_STA)) == ESP_OK; } +/** + * Enable IPv6 support on the station interface. + * @return true on success + */ +bool WiFiSTAClass::IPv6(bool state) +{ + if (state) + WiFiGenericClass::setStatusBits(WIFI_WANT_IP6_BIT); + else + WiFiGenericClass::clearStatusBits(WIFI_WANT_IP6_BIT); + return true; +} + /** * Get the station interface IPv6 address. * @return IPv6Address diff --git a/libraries/WiFi/src/WiFiSTA.h b/libraries/WiFi/src/WiFiSTA.h index b8bb855c198..6892c996b30 100644 --- a/libraries/WiFi/src/WiFiSTA.h +++ b/libraries/WiFi/src/WiFiSTA.h @@ -84,6 +84,7 @@ class WiFiSTAClass uint8_t subnetCIDR(); bool enableIpV6(); + bool IPv6(bool state); IPv6Address localIPv6(); // STA WiFi info diff --git a/libraries/WiFi/src/WiFiServer.cpp b/libraries/WiFi/src/WiFiServer.cpp index db21858125b..ad2cb7fb364 100644 --- a/libraries/WiFi/src/WiFiServer.cpp +++ b/libraries/WiFi/src/WiFiServer.cpp @@ -47,8 +47,8 @@ WiFiClient WiFiServer::available(){ _accepted_sockfd = -1; } else { - struct sockaddr_in _client; - int cs = sizeof(struct sockaddr_in); + struct sockaddr_in6 _client; + int cs = sizeof(struct sockaddr_in6); #ifdef ESP_IDF_VERSION_MAJOR client_sock = lwip_accept(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs); #else @@ -76,14 +76,23 @@ void WiFiServer::begin(uint16_t port, int enable){ if(port){ _port = port; } - struct sockaddr_in server; - sockfd = socket(AF_INET , SOCK_STREAM, 0); + struct sockaddr_in6 server; + sockfd = socket(AF_INET6 , SOCK_STREAM, 0); if (sockfd < 0) return; setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int)); - server.sin_family = AF_INET; - server.sin_addr.s_addr = _addr; - server.sin_port = htons(_port); + server.sin6_family = AF_INET6; + if (_addr.type() == IPv4) { + log_e("---------------- IPv4"); + memcpy(server.sin6_addr.s6_addr+11, (uint8_t*)&_addr[0], 4); + server.sin6_addr.s6_addr[10] = 0xFF; + server.sin6_addr.s6_addr[11] = 0xFF; + } else { + log_e("---------------- IPv6"); + memcpy(server.sin6_addr.s6_addr, (uint8_t*)&_addr[0], 16); + } + memset(server.sin6_addr.s6_addr, 0x0, 16); + server.sin6_port = htons(_port); if(bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0) return; if(listen(sockfd , _max_clients) < 0) @@ -106,8 +115,8 @@ bool WiFiServer::hasClient() { if (_accepted_sockfd >= 0) { return true; } - struct sockaddr_in _client; - int cs = sizeof(struct sockaddr_in); + struct sockaddr_in6 _client; + int cs = sizeof(struct sockaddr_in6); #ifdef ESP_IDF_VERSION_MAJOR _accepted_sockfd = lwip_accept(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs); #else diff --git a/libraries/WiFi/src/WiFiServer.h b/libraries/WiFi/src/WiFiServer.h index 346986abad5..d933231bdbb 100644 --- a/libraries/WiFi/src/WiFiServer.h +++ b/libraries/WiFi/src/WiFiServer.h @@ -37,7 +37,6 @@ class WiFiServer : public Server { public: void listenOnLocalhost(){} - // _addr(INADDR_ANY) is the same as _addr() ==> 0.0.0.0 WiFiServer(uint16_t port=80, uint8_t max_clients=4):sockfd(-1),_accepted_sockfd(-1),_addr(),_port(port),_max_clients(max_clients),_listening(false),_noDelay(false) { log_v("WiFiServer::WiFiServer(port=%d, ...)", port); } diff --git a/libraries/WiFiClientSecure/src/ssl_client.cpp b/libraries/WiFiClientSecure/src/ssl_client.cpp index e3e139b8bcc..4333b3043b8 100644 --- a/libraries/WiFiClientSecure/src/ssl_client.cpp +++ b/libraries/WiFiClientSecure/src/ssl_client.cpp @@ -21,7 +21,7 @@ #include "WiFi.h" #if !defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) && !defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) -# warning "Please configure IDF framework to include mbedTLS -> Enable PSK based ciphersuite modes (MBEDTLS_KEY_EXCHANGE_PSK) and activate at least one cipher" +# warning "Please call `idf.py menuconfig` then go to Component config -> mbedTLS -> TLS Key Exchange Methods -> Enable pre-shared-key ciphersuites and then check `Enable PSK based cyphersuite modes`. Save and Quit." #else const char *pers = "esp32-tls"; diff --git a/package.json b/package.json index 9d9c60fc83c..571d518ec56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "framework-arduinoespressif32", - "version": "2.0.4", + "version": "2.0.5", "description": "Arduino Wiring-based Framework for the Espressif ESP32, ESP32-S and ESP32-C series of SoCs", "keywords": [ "framework", diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index 497b26ccf0d..8e1c968ab90 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -343,7 +343,7 @@ }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-3.3-linux.tar.gz", + "url": "https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esptool-4.2.1-linux.tar.gz", "archiveFileName": "esptool-4.2.1-linux.tar.gz", "checksum": "SHA-256:5a45fb77eb6574554ec2f45230d0b350f26f9c24ab3b6c13c4031ebdf72a34ab", "size": "90123" diff --git a/platform.txt b/platform.txt index 93e0497bbaf..d7cecf3f67b 100644 --- a/platform.txt +++ b/platform.txt @@ -1,5 +1,5 @@ name=ESP32 Arduino -version=2.0.4 +version=2.0.5 runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf runtime.tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32s2-elf @@ -27,8 +27,8 @@ compiler.prefix={build.tarch}-{build.target}-elf- # # ESP32 Support Start # -compiler.cpreprocessor.flags.esp32=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.2-1-gce1fde4b3b" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32" "-I{compiler.sdk.path}/include/soc/esp32/include" "-I{compiler.sdk.path}/include/hal/esp32/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32" "-I{compiler.sdk.path}/include/esp_rom/esp32" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/tinycrypt/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/storage" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/btc/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/client/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/server/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/models/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp-sr/esp-tts/esp_tts_chinese/include" "-I{compiler.sdk.path}/include/esp-sr/include/esp32" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" -compiler.c.elf.libs.esp32=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lulp -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp-sr -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lwakenet -lmultinet -lesp_audio_processor -lesp_audio_front_end -lesp-sr -lwakenet -lmultinet -lesp_audio_processor -lesp_audio_front_end -ljson -lspiffs -ldl_lib -lc_speech_features -lhilexin_wn5 -lhilexin_wn5X2 -lhilexin_wn5X3 -lnihaoxiaozhi_wn5 -lnihaoxiaozhi_wn5X2 -lnihaoxiaozhi_wn5X3 -lnihaoxiaoxin_wn5X3 -lcustomized_word_wn5 -lmultinet2_ch -lesp_tts_chinese -lvoice_set_xiaole -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lesp_phy -lphy -lrtc -lesp_phy -lphy -lrtc -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc +compiler.cpreprocessor.flags.esp32=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.3" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32" "-I{compiler.sdk.path}/include/soc/esp32/include" "-I{compiler.sdk.path}/include/hal/esp32/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32" "-I{compiler.sdk.path}/include/esp_rom/esp32" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/tinycrypt/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/storage" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/btc/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/client/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/server/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/models/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp-sr/src/include" "-I{compiler.sdk.path}/include/esp-sr/esp-tts/esp_tts_chinese/include" "-I{compiler.sdk.path}/include/esp-sr/include/esp32" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.c.elf.libs.esp32=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lulp -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp-sr -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lmultinet -lesp_audio_processor -lesp_audio_front_end -lwakenet -lesp-sr -lmultinet -lesp_audio_processor -lesp_audio_front_end -lwakenet -ljson -lspiffs -ldl_lib -lc_speech_features -lwakeword_model -lmultinet2_ch -lesp_tts_chinese -lvoice_set_xiaole -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lesp_phy -lphy -lrtc -lesp_phy -lphy -lrtc -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32=-mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32=-mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -x assembler-with-cpp -MMD -c @@ -42,8 +42,8 @@ build.extra_flags.esp32=-DARDUINO_USB_CDC_ON_BOOT=0 # # ESP32S3 Support Start # -compiler.cpreprocessor.flags.esp32s3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.2-1-gce1fde4b3b" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32s3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s3" "-I{compiler.sdk.path}/include/soc/esp32s3/include" "-I{compiler.sdk.path}/include/hal/esp32s3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32s3" "-I{compiler.sdk.path}/include/esp_rom/esp32s3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s3/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s3/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s3/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32s3/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/tinycrypt/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/storage" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/btc/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/client/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/server/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/models/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/usb/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp-sr/esp-tts/esp_tts_chinese/include" "-I{compiler.sdk.path}/include/esp-sr/include/esp32s3" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" -compiler.c.elf.libs.esp32s3=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lusb -lulp -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp-sr -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lusb -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -larduino_tinyusb -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lwakenet -lhufzip -lesp_audio_front_end -lesp_audio_processor -lmultinet -lesp-sr -lwakenet -lhufzip -lesp_audio_front_end -lesp_audio_processor -lmultinet -ljson -lspiffs -ldl_lib -lc_speech_features -lesp_tts_chinese -lvoice_set_xiaole -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lbtbb -lesp_phy -lphy -lbtbb -lesp_phy -lphy -lbtbb -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc +compiler.cpreprocessor.flags.esp32s3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.3" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32s3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s3" "-I{compiler.sdk.path}/include/soc/esp32s3/include" "-I{compiler.sdk.path}/include/hal/esp32s3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32s3" "-I{compiler.sdk.path}/include/esp_rom/esp32s3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s3/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s3/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s3/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32s3/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/tinycrypt/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/storage" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/btc/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/client/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/server/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/models/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/usb/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp-sr/src/include" "-I{compiler.sdk.path}/include/esp-sr/esp-tts/esp_tts_chinese/include" "-I{compiler.sdk.path}/include/esp-sr/include/esp32s3" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.c.elf.libs.esp32s3=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lusb -lulp -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp-sr -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lusb -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -larduino_tinyusb -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lhufzip -lesp_audio_front_end -lesp_audio_processor -lmultinet -lwakenet -lesp-sr -lhufzip -lesp_audio_front_end -lesp_audio_processor -lmultinet -lwakenet -ljson -lspiffs -ldl_lib -lc_speech_features -lesp-dsp -lesp_tts_chinese -lvoice_set_xiaole -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lbtbb -lesp_phy -lphy -lbtbb -lesp_phy -lphy -lbtbb -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32s3=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32s3=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32s3=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -x assembler-with-cpp -MMD -c @@ -57,8 +57,8 @@ build.extra_flags.esp32s3=-DARDUINO_USB_MODE={build.usb_mode} -DARDUINO_USB_CDC_ # # ESP32S2 Support Start # -compiler.cpreprocessor.flags.esp32s2=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.2-1-gce1fde4b3b" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s2" "-I{compiler.sdk.path}/include/soc/esp32s2/include" "-I{compiler.sdk.path}/include/hal/esp32s2/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32s2" "-I{compiler.sdk.path}/include/esp_rom/esp32s2" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s2/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s2/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s2/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s2/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s2" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s2" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/usb/include" "-I{compiler.sdk.path}/include/touch_element/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp-sr/esp-tts/esp_tts_chinese/include" "-I{compiler.sdk.path}/include/esp-sr/include/esp32" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" -compiler.c.elf.libs.esp32s2=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lusb -ltouch_element -lulp -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp-sr -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lusb -ltouch_element -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lprotobuf-c -lmdns -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -larduino_tinyusb -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -ljson -lspiffs -lesp_tts_chinese -lvoice_set_xiaole -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lesp_phy -lphy -lesp_phy -lphy -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc +compiler.cpreprocessor.flags.esp32s2=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.3" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s2" "-I{compiler.sdk.path}/include/soc/esp32s2/include" "-I{compiler.sdk.path}/include/hal/esp32s2/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32s2" "-I{compiler.sdk.path}/include/esp_rom/esp32s2" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s2/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s2/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s2/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s2/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s2" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s2" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/usb/include" "-I{compiler.sdk.path}/include/touch_element/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp-sr/esp-tts/esp_tts_chinese/include" "-I{compiler.sdk.path}/include/esp-sr/include/esp32" "-I{compiler.sdk.path}/include/esp-sr/src/include" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.c.elf.libs.esp32s2=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lusb -ltouch_element -lulp -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lusb -ltouch_element -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lprotobuf-c -lmdns -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -larduino_tinyusb -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -ljson -lspiffs -lesp_tts_chinese -lvoice_set_xiaole -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lesp_phy -lphy -lesp_phy -lphy -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -x assembler-with-cpp -MMD -c @@ -72,7 +72,7 @@ build.extra_flags.esp32s2=-DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT={build. # # ESP32C3 Support Start # -compiler.cpreprocessor.flags.esp32c3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.2-1-gce1fde4b3b" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/riscv/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32c3" "-I{compiler.sdk.path}/include/soc/esp32c3/include" "-I{compiler.sdk.path}/include/hal/esp32c3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32c3" "-I{compiler.sdk.path}/include/esp_rom/esp32c3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/include/riscv" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/riscv/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32c3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32c3/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32c3/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/riscv" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32c3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/riscv" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32c3/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/tinycrypt/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/storage" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/btc/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/client/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/server/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/models/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32c3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.cpreprocessor.flags.esp32c3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.3" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/riscv/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32c3" "-I{compiler.sdk.path}/include/soc/esp32c3/include" "-I{compiler.sdk.path}/include/hal/esp32c3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32c3" "-I{compiler.sdk.path}/include/esp_rom/esp32c3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/include/riscv" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/riscv/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32c3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32c3/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32c3/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/riscv" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32c3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/riscv" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32c3/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_common/tinycrypt/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_core/storage" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/btc/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/common/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/client/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/mesh_models/server/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/core/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api/models/include" "-I{compiler.sdk.path}/include/bt/esp_ble_mesh/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32c3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/rmaker_common/include" "-I{compiler.sdk.path}/include/json_parser/upstream/include" "-I{compiler.sdk.path}/include/json_parser/upstream" "-I{compiler.sdk.path}/include/json_generator/upstream" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/gpio_button/button/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dl/include" "-I{compiler.sdk.path}/include/esp-dl/include/tool" "-I{compiler.sdk.path}/include/esp-dl/include/typedef" "-I{compiler.sdk.path}/include/esp-dl/include/image" "-I{compiler.sdk.path}/include/esp-dl/include/math" "-I{compiler.sdk.path}/include/esp-dl/include/nn" "-I{compiler.sdk.path}/include/esp-dl/include/layer" "-I{compiler.sdk.path}/include/esp-dl/include/detect" "-I{compiler.sdk.path}/include/esp-dl/include/model_zoo" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" compiler.c.elf.libs.esp32c3=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lspiffs -lwifi_provisioning -lrmaker_common -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lgpio_button -lqrcode -lws2812_led -lesp-dsp -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_rainmaker -lesp_local_ctrl -lesp_https_server -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -ljson -lrmaker_common -lmqtt -ljson_parser -ljson_generator -lesp_schedule -lqrcode -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls_2 -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lbtbb -lesp_phy -lphy -lbtbb -lesp_phy -lphy -lbtbb -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32c3=-march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32c3=-march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c @@ -150,8 +150,10 @@ recipe.hooks.prebuild.2.pattern.windows=cmd /c if not exist "{build.path}\partit recipe.hooks.prebuild.3.pattern.windows=cmd /c if not exist "{build.path}\partitions.csv" COPY "{runtime.platform.path}\tools\partitions\{build.partitions}.csv" "{build.path}\partitions.csv" # Check if custom bootloader exist: source > variant > build.boot -recipe.hooks.prebuild.4.pattern=bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || cp -f "{runtime.platform.path}"/tools/sdk/{build.mcu}/bin/bootloader_{build.boot}_{build.boot_freq}.bin "{build.path}"/{build.project_name}.bootloader.bin )" -recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\bootloader.bin" ( COPY /y "{build.source.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( IF EXIST "{build.variant.path}\{build.custom_bootloader}.bin" ( COPY "{build.variant.path}\{build.custom_bootloader}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( COPY /y "{runtime.platform.path}\tools\sdk\{build.mcu}\bin\bootloader_{build.boot}_{build.boot_freq}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ) +recipe.hooks.prebuild.4.pattern_args=--chip {build.mcu} elf2image --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} -o +recipe.hooks.prebuild.4.pattern=bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || "{tools.esptool_py.path}"/{tools.esptool_py.cmd} {recipe.hooks.prebuild.4.pattern_args} "{build.path}"/{build.project_name}.bootloader.bin "{runtime.platform.path}"/tools/sdk/{build.mcu}/bin/bootloader_{build.boot}_{build.boot_freq}.elf )" +recipe.hooks.prebuild.4.pattern.linux=bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || python3 "{tools.esptool_py.path}"/{tools.esptool_py.cmd} {recipe.hooks.prebuild.4.pattern_args} "{build.path}"/{build.project_name}.bootloader.bin "{runtime.platform.path}"/tools/sdk/{build.mcu}/bin/bootloader_{build.boot}_{build.boot_freq}.elf )" +recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\bootloader.bin" ( COPY /y "{build.source.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( IF EXIST "{build.variant.path}\{build.custom_bootloader}.bin" ( COPY "{build.variant.path}\{build.custom_bootloader}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( "{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.hooks.prebuild.4.pattern_args} "{build.path}\{build.project_name}.bootloader.bin" "{runtime.platform.path}\tools\sdk\{build.mcu}\bin\bootloader_{build.boot}_{build.boot_freq}.elf" ) ) # Check if custom build options exist in the sketch folder recipe.hooks.prebuild.5.pattern=bash -c "[ ! -f "{build.source.path}"/build_opt.h ] || cp -f "{build.source.path}"/build_opt.h "{build.path}"/build_opt.h" @@ -248,9 +250,6 @@ tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{ne ## Upload Sketch Through OTA (Arduino IDE 2.x) ## ------------------------------------------- tools.esp_ota.upload.protocol=network -## Following command does not work currently, because port properties are lost and auth dialog does not permit empty fields -#tools.esp_ota.upload.field.password=Password -#tools.esp_ota.upload.field.password.secret=true -#tools.esp_ota.upload.pattern={cmd} -i "{upload.port.address}" -p "{upload.port.properties.port}" "--auth={upload.field.password}" -f "{build.path}/{build.project_name}.bin" -## So we do basic default OTA on port 3232 and no auth -tools.esp_ota.upload.pattern={cmd} -i "{upload.port.address}" -f "{build.path}/{build.project_name}.bin" +tools.esp_ota.upload.field.password=Password +tools.esp_ota.upload.field.password.secret=true +tools.esp_ota.upload.pattern={cmd} -i {upload.port.address} -p {upload.port.properties.port} --auth={upload.field.password} -f "{build.path}/{build.project_name}.bin" diff --git a/tests/touch/test_touch.py b/tests/touch/test_touch.py new file mode 100644 index 00000000000..dc80b6dfaa4 --- /dev/null +++ b/tests/touch/test_touch.py @@ -0,0 +1,2 @@ +def test_touch(dut): + dut.expect_unity_test_output(timeout=240) diff --git a/tests/touch/touch.ino b/tests/touch/touch.ino new file mode 100644 index 00000000000..d250f179d87 --- /dev/null +++ b/tests/touch/touch.ino @@ -0,0 +1,198 @@ +#include +#include "soc/soc_caps.h" + +#if SOC_TOUCH_SENSOR_NUM > 0 + +#include "driver/touch_pad.h" + +#if CONFIG_IDF_TARGET_ESP32 + +#define TEST_TOUCH_CHANNEL (9) +static touch_pad_t touch_list[TEST_TOUCH_CHANNEL] = { + TOUCH_PAD_NUM0, + //TOUCH_PAD_NUM1 is GPIO0, for download. + TOUCH_PAD_NUM2, + TOUCH_PAD_NUM3, + TOUCH_PAD_NUM4, + TOUCH_PAD_NUM5, + TOUCH_PAD_NUM6, + TOUCH_PAD_NUM7, + TOUCH_PAD_NUM8, + TOUCH_PAD_NUM9 +}; + +uint8_t TOUCH_GPIOS[] = {4,2,15,13,12,14,27,33,32}; + +#define NO_TOUCH_GPIO 25 + +#define RELEASED_VALUE 80 //80+ read value to pass test +#define PRESSED_VALUE 20 //20- read value to pass test +#define INTERRUPT_THRESHOLD 40 + +#else //ESP32S2 and ESP32S3 + +#define TEST_TOUCH_CHANNEL (12) //14 +static touch_pad_t touch_list[TEST_TOUCH_CHANNEL] = { + TOUCH_PAD_NUM1, + TOUCH_PAD_NUM2, + TOUCH_PAD_NUM3, + TOUCH_PAD_NUM4, + TOUCH_PAD_NUM5, + TOUCH_PAD_NUM6, + TOUCH_PAD_NUM7, + TOUCH_PAD_NUM8, + TOUCH_PAD_NUM9, + TOUCH_PAD_NUM10, + TOUCH_PAD_NUM11, + TOUCH_PAD_NUM12 + //TOUCH_PAD_NUM13, //Wrong reading + //TOUCH_PAD_NUM14 +}; + +uint8_t TOUCH_GPIOS[] = {1,2,3,4,5,6,7,8,9,10,11,12/*,13,14*/}; + +#define NO_TOUCH_GPIO 17 + +#if CONFIG_IDF_TARGET_ESP32S2 + #define RELEASED_VALUE 10000 //10000- read value to pass test + #define PRESSED_VALUE 42000 //40000+ read value to pass test + #define INTERRUPT_THRESHOLD 30000 +#elif CONFIG_IDF_TARGET_ESP32S3 + #define RELEASED_VALUE 25000 //25000- read value to pass test + #define PRESSED_VALUE 100000 //150000+ read value to pass test + #define INTERRUPT_THRESHOLD 80000 +#else + #error Test not currently supported on this chip. Please adjust and try again! +#endif + +#endif + +bool touch1detected = false; +bool touch2detected = false; + +void gotTouch1() { + touch1detected = true; +} + +void gotTouch2() { + touch2detected = true; +} + +/* + * Change the slope to get larger value from touch sensor. + */ +static void test_press_fake(touch_pad_t pad_num) { + touch_pad_set_cnt_mode(pad_num, TOUCH_PAD_SLOPE_1, TOUCH_PAD_TIE_OPT_DEFAULT); +} + +/* + * Change the slope to get smaller value from touch sensor. + */ +static void test_release_fake(touch_pad_t pad_num) { + touch_pad_set_cnt_mode(pad_num, TOUCH_PAD_SLOPE_7, TOUCH_PAD_TIE_OPT_DEFAULT); +} + + +/* These functions are intended to be called before and after each test. */ +void setUp(void) { + +} + +void tearDown(void) { + for (int i = 0; i < TEST_TOUCH_CHANNEL; i++) { + test_release_fake(touch_list[i]); + } + delay(100); +} + +/* + * Test Touch read on all available channels - compare values if reading is right + */ +void test_touch_read(void) { + + //TEST RELEASE STATE + for (int i = 0; i < sizeof(TOUCH_GPIOS); i++) { + #ifdef CONFIG_IDF_TARGET_ESP32 + TEST_ASSERT_GREATER_THAN(RELEASED_VALUE, touchRead(TOUCH_GPIOS[i])); + #else + TEST_ASSERT_LESS_THAN(RELEASED_VALUE, touchRead(TOUCH_GPIOS[i])); + #endif + } + + // TEST PRESS STATE + for (int j = 0; j < TEST_TOUCH_CHANNEL; j++) { + test_press_fake(touch_list[j]); + } + delay(100); + + for (int k = 0; k < sizeof(TOUCH_GPIOS); k++) { + #ifdef CONFIG_IDF_TARGET_ESP32 + TEST_ASSERT_LESS_THAN(PRESSED_VALUE,touchRead(TOUCH_GPIOS[k])); + #else + TEST_ASSERT_GREATER_THAN(PRESSED_VALUE, touchRead(TOUCH_GPIOS[k])); + #endif + } +} + +void test_touch_interrtupt(void) { + + touchAttachInterrupt(TOUCH_GPIOS[0], gotTouch1, INTERRUPT_THRESHOLD); + touchAttachInterrupt(TOUCH_GPIOS[1], gotTouch2, INTERRUPT_THRESHOLD); + + test_press_fake(touch_list[0]); + test_press_fake(touch_list[1]); + + delay(300); + + touchDetachInterrupt(TOUCH_GPIOS[0]); + touchDetachInterrupt(TOUCH_GPIOS[1]); + + TEST_ASSERT_TRUE(touch1detected); + TEST_ASSERT_TRUE(touch2detected); +} + +void test_touch_errors(void) { + + TEST_ASSERT_FALSE(touchRead(NO_TOUCH_GPIO)); +} + +void setup() { + Serial.begin(115200); + while (!Serial) { + ; + } + + UNITY_BEGIN(); + RUN_TEST(test_touch_read); + RUN_TEST(test_touch_interrtupt); + RUN_TEST(test_touch_errors); + UNITY_END(); +} + +void loop() { + +} + +#else +//PASS TEST for UNSUPPORTED CHIPS + +void test_pass(void){ + TEST_ASSERT_EQUAL(1, 1); +} + +void setup() { + Serial.begin(115200); + while (!Serial) { + ; + } + + UNITY_BEGIN(); + RUN_TEST(test_pass); + UNITY_END(); +} + +void loop() { + +} + +#endif diff --git a/tools/esptool.py b/tools/esptool.py deleted file mode 100755 index 629f4c1dcba..00000000000 --- a/tools/esptool.py +++ /dev/null @@ -1,5399 +0,0 @@ -#!/usr/bin/env python -# -# SPDX-FileCopyrightText: 2014-2022 Fredrik Ahlberg, Angus Gratton, Espressif Systems (Shanghai) CO LTD, other contributors as noted. -# -# SPDX-License-Identifier: GPL-2.0-or-later - -from __future__ import division, print_function - -import argparse -import base64 -import binascii -import copy -import hashlib -import inspect -import io -import itertools -import os -import re -import shlex -import string -import struct -import sys -import time -import zlib - -try: - import serial -except ImportError: - print("Pyserial is not installed for %s. Check the README for installation instructions." % (sys.executable)) - raise - -# check 'serial' is 'pyserial' and not 'serial' https://github.com/espressif/esptool/issues/269 -try: - if "serialization" in serial.__doc__ and "deserialization" in serial.__doc__: - raise ImportError(""" -esptool.py depends on pyserial, but there is a conflict with a currently installed package named 'serial'. - -You may be able to work around this by 'pip uninstall serial; pip install pyserial' \ -but this may break other installed Python software that depends on 'serial'. - -There is no good fix for this right now, apart from configuring virtualenvs. \ -See https://github.com/espressif/esptool/issues/269#issuecomment-385298196 for discussion of the underlying issue(s).""") -except TypeError: - pass # __doc__ returns None for pyserial - -try: - import serial.tools.list_ports as list_ports -except ImportError: - print("The installed version (%s) of pyserial appears to be too old for esptool.py (Python interpreter %s). " - "Check the README for installation instructions." % (sys.VERSION, sys.executable)) - raise -except Exception: - if sys.platform == "darwin": - # swallow the exception, this is a known issue in pyserial+macOS Big Sur preview ref https://github.com/espressif/esptool/issues/540 - list_ports = None - else: - raise - - -__version__ = "3.3.2-dev" - -MAX_UINT32 = 0xffffffff -MAX_UINT24 = 0xffffff - -DEFAULT_TIMEOUT = 3 # timeout for most flash operations -START_FLASH_TIMEOUT = 20 # timeout for starting flash (may perform erase) -CHIP_ERASE_TIMEOUT = 120 # timeout for full chip erase -MAX_TIMEOUT = CHIP_ERASE_TIMEOUT * 2 # longest any command can run -SYNC_TIMEOUT = 0.1 # timeout for syncing with bootloader -MD5_TIMEOUT_PER_MB = 8 # timeout (per megabyte) for calculating md5sum -ERASE_REGION_TIMEOUT_PER_MB = 30 # timeout (per megabyte) for erasing a region -ERASE_WRITE_TIMEOUT_PER_MB = 40 # timeout (per megabyte) for erasing and writing data -MEM_END_ROM_TIMEOUT = 0.05 # special short timeout for ESP_MEM_END, as it may never respond -DEFAULT_SERIAL_WRITE_TIMEOUT = 10 # timeout for serial port write -DEFAULT_CONNECT_ATTEMPTS = 7 # default number of times to try connection - -SUPPORTED_CHIPS = ['esp8266', 'esp32', 'esp32s2', 'esp32s3beta2', 'esp32s3', 'esp32c3', 'esp32c6beta', 'esp32h2beta1', 'esp32h2beta2', 'esp32c2'] - - -def timeout_per_mb(seconds_per_mb, size_bytes): - """ Scales timeouts which are size-specific """ - result = seconds_per_mb * (size_bytes / 1e6) - if result < DEFAULT_TIMEOUT: - return DEFAULT_TIMEOUT - return result - - -def _chip_to_rom_loader(chip): - return { - 'esp8266': ESP8266ROM, - 'esp32': ESP32ROM, - 'esp32s2': ESP32S2ROM, - 'esp32s3beta2': ESP32S3BETA2ROM, - 'esp32s3': ESP32S3ROM, - 'esp32c3': ESP32C3ROM, - 'esp32c6beta': ESP32C6BETAROM, - 'esp32h2beta1': ESP32H2BETA1ROM, - 'esp32h2beta2': ESP32H2BETA2ROM, - 'esp32c2': ESP32C2ROM, - }[chip] - - -def get_default_connected_device(serial_list, port, connect_attempts, initial_baud, chip='auto', trace=False, - before='default_reset'): - _esp = None - for each_port in reversed(serial_list): - print("Serial port %s" % each_port) - try: - if chip == 'auto': - _esp = ESPLoader.detect_chip(each_port, initial_baud, before, trace, - connect_attempts) - else: - chip_class = _chip_to_rom_loader(chip) - _esp = chip_class(each_port, initial_baud, trace) - _esp.connect(before, connect_attempts) - break - except (FatalError, OSError) as err: - if port is not None: - raise - print("%s failed to connect: %s" % (each_port, err)) - _esp = None - return _esp - - -DETECTED_FLASH_SIZES = {0x12: '256KB', 0x13: '512KB', 0x14: '1MB', - 0x15: '2MB', 0x16: '4MB', 0x17: '8MB', - 0x18: '16MB', 0x19: '32MB', 0x1a: '64MB', 0x21: '128MB'} - - -def check_supported_function(func, check_func): - """ - Decorator implementation that wraps a check around an ESPLoader - bootloader function to check if it's supported. - - This is used to capture the multidimensional differences in - functionality between the ESP8266 & ESP32 (and later chips) ROM loaders, and the - software stub that runs on these. Not possible to do this cleanly - via inheritance alone. - """ - def inner(*args, **kwargs): - obj = args[0] - if check_func(obj): - return func(*args, **kwargs) - else: - raise NotImplementedInROMError(obj, func) - return inner - - -def esp8266_function_only(func): - """ Attribute for a function only supported on ESP8266 """ - return check_supported_function(func, lambda o: o.CHIP_NAME == "ESP8266") - - -def stub_function_only(func): - """ Attribute for a function only supported in the software stub loader """ - return check_supported_function(func, lambda o: o.IS_STUB) - - -def stub_and_esp32_function_only(func): - """ Attribute for a function only supported by software stubs or ESP32 and later chips ROM """ - return check_supported_function(func, lambda o: o.IS_STUB or isinstance(o, ESP32ROM)) - - -def esp32s3_or_newer_function_only(func): - """ Attribute for a function only supported by ESP32S3 and later chips ROM """ - return check_supported_function(func, lambda o: isinstance(o, ESP32S3ROM) or isinstance(o, ESP32C3ROM)) - - -PYTHON2 = sys.version_info[0] < 3 # True if on pre-Python 3 - -# Function to return nth byte of a bitstring -# Different behaviour on Python 2 vs 3 -if PYTHON2: - def byte(bitstr, index): - return ord(bitstr[index]) -else: - def byte(bitstr, index): - return bitstr[index] - -# Provide a 'basestring' class on Python 3 -try: - basestring -except NameError: - basestring = str - - -def print_overwrite(message, last_line=False): - """ Print a message, overwriting the currently printed line. - - If last_line is False, don't append a newline at the end (expecting another subsequent call will overwrite this one.) - - After a sequence of calls with last_line=False, call once with last_line=True. - - If output is not a TTY (for example redirected a pipe), no overwriting happens and this function is the same as print(). - """ - if sys.stdout.isatty(): - print("\r%s" % message, end='\n' if last_line else '') - else: - print(message) - - -def _mask_to_shift(mask): - """ Return the index of the least significant bit in the mask """ - shift = 0 - while mask & 0x1 == 0: - shift += 1 - mask >>= 1 - return shift - - -class ESPLoader(object): - """ Base class providing access to ESP ROM & software stub bootloaders. - Subclasses provide ESP8266 & ESP32 Family specific functionality. - - Don't instantiate this base class directly, either instantiate a subclass or - call ESPLoader.detect_chip() which will interrogate the chip and return the - appropriate subclass instance. - - """ - CHIP_NAME = "Espressif device" - IS_STUB = False - - FPGA_SLOW_BOOT = False - - DEFAULT_PORT = "/dev/ttyUSB0" - - USES_RFC2217 = False - - # Commands supported by ESP8266 ROM bootloader - ESP_FLASH_BEGIN = 0x02 - ESP_FLASH_DATA = 0x03 - ESP_FLASH_END = 0x04 - ESP_MEM_BEGIN = 0x05 - ESP_MEM_END = 0x06 - ESP_MEM_DATA = 0x07 - ESP_SYNC = 0x08 - ESP_WRITE_REG = 0x09 - ESP_READ_REG = 0x0a - - # Some comands supported by ESP32 and later chips ROM bootloader (or -8266 w/ stub) - ESP_SPI_SET_PARAMS = 0x0B - ESP_SPI_ATTACH = 0x0D - ESP_READ_FLASH_SLOW = 0x0e # ROM only, much slower than the stub flash read - ESP_CHANGE_BAUDRATE = 0x0F - ESP_FLASH_DEFL_BEGIN = 0x10 - ESP_FLASH_DEFL_DATA = 0x11 - ESP_FLASH_DEFL_END = 0x12 - ESP_SPI_FLASH_MD5 = 0x13 - - # Commands supported by ESP32-S2 and later chips ROM bootloader only - ESP_GET_SECURITY_INFO = 0x14 - - # Some commands supported by stub only - ESP_ERASE_FLASH = 0xD0 - ESP_ERASE_REGION = 0xD1 - ESP_READ_FLASH = 0xD2 - ESP_RUN_USER_CODE = 0xD3 - - # Flash encryption encrypted data command - ESP_FLASH_ENCRYPT_DATA = 0xD4 - - # Response code(s) sent by ROM - ROM_INVALID_RECV_MSG = 0x05 # response if an invalid message is received - - # Maximum block sized for RAM and Flash writes, respectively. - ESP_RAM_BLOCK = 0x1800 - - FLASH_WRITE_SIZE = 0x400 - - # Default baudrate. The ROM auto-bauds, so we can use more or less whatever we want. - ESP_ROM_BAUD = 115200 - - # First byte of the application image - ESP_IMAGE_MAGIC = 0xe9 - - # Initial state for the checksum routine - ESP_CHECKSUM_MAGIC = 0xef - - # Flash sector size, minimum unit of erase. - FLASH_SECTOR_SIZE = 0x1000 - - UART_DATE_REG_ADDR = 0x60000078 - - CHIP_DETECT_MAGIC_REG_ADDR = 0x40001000 # This ROM address has a different value on each chip model - - UART_CLKDIV_MASK = 0xFFFFF - - # Memory addresses - IROM_MAP_START = 0x40200000 - IROM_MAP_END = 0x40300000 - - # The number of bytes in the UART response that signify command status - STATUS_BYTES_LENGTH = 2 - - # Response to ESP_SYNC might indicate that flasher stub is running instead of the ROM bootloader - sync_stub_detected = False - - # Device PIDs - USB_JTAG_SERIAL_PID = 0x1001 - - # Chip IDs that are no longer supported by esptool - UNSUPPORTED_CHIPS = {6: "ESP32-S3(beta 3)"} - - def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, trace_enabled=False): - """Base constructor for ESPLoader bootloader interaction - - Don't call this constructor, either instantiate ESP8266ROM - or ESP32ROM, or use ESPLoader.detect_chip(). - - This base class has all of the instance methods for bootloader - functionality supported across various chips & stub - loaders. Subclasses replace the functions they don't support - with ones which throw NotImplementedInROMError(). - - """ - self.secure_download_mode = False # flag is set to True if esptool detects the ROM is in Secure Download Mode - self.stub_is_disabled = False # flag is set to True if esptool detects conditions which require the stub to be disabled - - if isinstance(port, basestring): - self._port = serial.serial_for_url(port) - else: - self._port = port - self._slip_reader = slip_reader(self._port, self.trace) - # setting baud rate in a separate step is a workaround for - # CH341 driver on some Linux versions (this opens at 9600 then - # sets), shouldn't matter for other platforms/drivers. See - # https://github.com/espressif/esptool/issues/44#issuecomment-107094446 - self._set_port_baudrate(baud) - self._trace_enabled = trace_enabled - # set write timeout, to prevent esptool blocked at write forever. - try: - self._port.write_timeout = DEFAULT_SERIAL_WRITE_TIMEOUT - except NotImplementedError: - # no write timeout for RFC2217 ports - # need to set the property back to None or it will continue to fail - self._port.write_timeout = None - - @property - def serial_port(self): - return self._port.port - - def _set_port_baudrate(self, baud): - try: - self._port.baudrate = baud - except IOError: - raise FatalError("Failed to set baud rate %d. The driver may not support this rate." % baud) - - @staticmethod - def detect_chip(port=DEFAULT_PORT, baud=ESP_ROM_BAUD, connect_mode='default_reset', trace_enabled=False, - connect_attempts=DEFAULT_CONNECT_ATTEMPTS): - """ Use serial access to detect the chip type. - - First, get_security_info command is sent to detect the ID of the chip - (supported only by ESP32-C3 and later, works even in the Secure Download Mode). - If this fails, we reconnect and fall-back to reading the magic number. - It's mapped at a specific ROM address and has a different value on each chip model. - This way we can use one memory read and compare it to the magic number for each chip type. - - This routine automatically performs ESPLoader.connect() (passing - connect_mode parameter) as part of querying the chip. - """ - inst = None - detect_port = ESPLoader(port, baud, trace_enabled=trace_enabled) - if detect_port.serial_port.startswith("rfc2217:"): - detect_port.USES_RFC2217 = True - detect_port.connect(connect_mode, connect_attempts, detecting=True) - try: - print('Detecting chip type...', end='') - res = detect_port.check_command('get security info', ESPLoader.ESP_GET_SECURITY_INFO, b'') - res = struct.unpack(" self.STATUS_BYTES_LENGTH: - return data[:-self.STATUS_BYTES_LENGTH] - else: # otherwise, just return the 'val' field which comes from the reply header (this is used by read_reg) - return val - - def flush_input(self): - self._port.flushInput() - self._slip_reader = slip_reader(self._port, self.trace) - - def sync(self): - val, _ = self.command(self.ESP_SYNC, b'\x07\x07\x12\x20' + 32 * b'\x55', - timeout=SYNC_TIMEOUT) - - # ROM bootloaders send some non-zero "val" response. The flasher stub sends 0. If we receive 0 then it - # probably indicates that the chip wasn't or couldn't be reseted properly and esptool is talking to the - # flasher stub. - self.sync_stub_detected = val == 0 - - for _ in range(7): - val, _ = self.command() - self.sync_stub_detected &= val == 0 - - def _setDTR(self, state): - self._port.setDTR(state) - - def _setRTS(self, state): - self._port.setRTS(state) - # Work-around for adapters on Windows using the usbser.sys driver: - # generate a dummy change to DTR so that the set-control-line-state - # request is sent with the updated RTS state and the same DTR state - self._port.setDTR(self._port.dtr) - - def _get_pid(self): - if list_ports is None: - print("\nListing all serial ports is currently not available. Can't get device PID.") - return - active_port = self._port.port - - # Pyserial only identifies regular ports, URL handlers are not supported - if not active_port.lower().startswith(("com", "/dev/")): - print("\nDevice PID identification is only supported on COM and /dev/ serial ports.") - return - # Return the real path if the active port is a symlink - if active_port.startswith("/dev/") and os.path.islink(active_port): - active_port = os.path.realpath(active_port) - - # The "cu" (call-up) device has to be used for outgoing communication on MacOS - if sys.platform == "darwin" and "tty" in active_port: - active_port = [active_port, active_port.replace("tty", "cu")] - ports = list_ports.comports() - for p in ports: - if p.device in active_port: - return p.pid - print("\nFailed to get PID of a device on {}, using standard reset sequence.".format(active_port)) - - def bootloader_reset(self, usb_jtag_serial=False, extra_delay=False): - """ Issue a reset-to-bootloader, with USB-JTAG-Serial custom reset sequence option - """ - # RTS = either CH_PD/EN or nRESET (both active low = chip in reset) - # DTR = GPIO0 (active low = boot to flasher) - # - # DTR & RTS are active low signals, - # ie True = pin @ 0V, False = pin @ VCC. - if usb_jtag_serial: - # Custom reset sequence, which is required when the device - # is connecting via its USB-JTAG-Serial peripheral - self._setRTS(False) - self._setDTR(False) # Idle - time.sleep(0.1) - self._setDTR(True) # Set IO0 - self._setRTS(False) - time.sleep(0.1) - self._setRTS(True) # Reset. Note dtr/rts calls inverted so we go through (1,1) instead of (0,0) - self._setDTR(False) - self._setRTS(True) # Extra RTS set for RTS as Windows only propagates DTR on RTS setting - time.sleep(0.1) - self._setDTR(False) - self._setRTS(False) - else: - # This fpga delay is for Espressif internal use - fpga_delay = True if self.FPGA_SLOW_BOOT and os.environ.get("ESPTOOL_ENV_FPGA", "").strip() == "1" else False - delay = 7 if fpga_delay else 0.5 if extra_delay else 0.05 # 0.5 needed for ESP32 rev0 and rev1 - - self._setDTR(False) # IO0=HIGH - self._setRTS(True) # EN=LOW, chip in reset - time.sleep(0.1) - self._setDTR(True) # IO0=LOW - self._setRTS(False) # EN=HIGH, chip out of reset - time.sleep(delay) - self._setDTR(False) # IO0=HIGH, done - - def _connect_attempt(self, mode='default_reset', usb_jtag_serial=False, extra_delay=False): - """ A single connection attempt """ - last_error = None - boot_log_detected = False - download_mode = False - - # If we're doing no_sync, we're likely communicating as a pass through - # with an intermediate device to the ESP32 - if mode == "no_reset_no_sync": - return last_error - - if mode != 'no_reset': - if not self.USES_RFC2217: # Might block on rfc2217 ports - self._port.reset_input_buffer() # Empty serial buffer to isolate boot log - self.bootloader_reset(usb_jtag_serial, extra_delay) - - # Detect the ROM boot log and check actual boot mode (ESP32 and later only) - waiting = self._port.inWaiting() - read_bytes = self._port.read(waiting) - data = re.search(b'boot:(0x[0-9a-fA-F]+)(.*waiting for download)?', read_bytes, re.DOTALL) - if data is not None: - boot_log_detected = True - boot_mode = data.group(1) - download_mode = data.group(2) is not None - - for _ in range(5): - try: - self.flush_input() - self._port.flushOutput() - self.sync() - return None - except FatalError as e: - print('.', end='') - sys.stdout.flush() - time.sleep(0.05) - last_error = e - - if boot_log_detected: - last_error = FatalError("Wrong boot mode detected ({})! The chip needs to be in download mode.".format(boot_mode.decode("utf-8"))) - if download_mode: - last_error = FatalError("Download mode successfully detected, but getting no sync reply: The serial TX path seems to be down.") - return last_error - - def get_memory_region(self, name): - """ Returns a tuple of (start, end) for the memory map entry with the given name, or None if it doesn't exist - """ - try: - return [(start, end) for (start, end, n) in self.MEMORY_MAP if n == name][0] - except IndexError: - return None - - def connect(self, mode='default_reset', attempts=DEFAULT_CONNECT_ATTEMPTS, detecting=False, warnings=True): - """ Try connecting repeatedly until successful, or giving up """ - if warnings and mode in ['no_reset', 'no_reset_no_sync']: - print('WARNING: Pre-connection option "{}" was selected.'.format(mode), - 'Connection may fail if the chip is not in bootloader or flasher stub mode.') - print('Connecting...', end='') - sys.stdout.flush() - last_error = None - - usb_jtag_serial = (mode == 'usb_reset') or (self._get_pid() == self.USB_JTAG_SERIAL_PID) - - try: - for _, extra_delay in zip(range(attempts) if attempts > 0 else itertools.count(), itertools.cycle((False, True))): - last_error = self._connect_attempt(mode=mode, usb_jtag_serial=usb_jtag_serial, extra_delay=extra_delay) - if last_error is None: - break - finally: - print('') # end 'Connecting...' line - - if last_error is not None: - raise FatalError('Failed to connect to {}: {}' - '\nFor troubleshooting steps visit: ' - 'https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html'.format(self.CHIP_NAME, last_error)) - - if not detecting: - try: - # check the date code registers match what we expect to see - chip_magic_value = self.read_reg(ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR) - if chip_magic_value not in self.CHIP_DETECT_MAGIC_VALUE: - actually = None - for cls in [ESP8266ROM, ESP32ROM, ESP32S2ROM, ESP32S3BETA2ROM, ESP32S3ROM, - ESP32C3ROM, ESP32H2BETA1ROM, ESP32H2BETA2ROM, ESP32C2ROM, ESP32C6BETAROM]: - if chip_magic_value in cls.CHIP_DETECT_MAGIC_VALUE: - actually = cls - break - if warnings and actually is None: - print(("WARNING: This chip doesn't appear to be a %s (chip magic value 0x%08x). " - "Probably it is unsupported by this version of esptool.") % (self.CHIP_NAME, chip_magic_value)) - else: - raise FatalError("This chip is %s not %s. Wrong --chip argument?" % (actually.CHIP_NAME, self.CHIP_NAME)) - except UnsupportedCommandError: - self.secure_download_mode = True - self._post_connect() - self.check_chip_id() - - def _post_connect(self): - """ - Additional initialization hook, may be overridden by the chip-specific class. - Gets called after connect, and after auto-detection. - """ - pass - - def read_reg(self, addr, timeout=DEFAULT_TIMEOUT): - """ Read memory address in target """ - # we don't call check_command here because read_reg() function is called - # when detecting chip type, and the way we check for success (STATUS_BYTES_LENGTH) is different - # for different chip types (!) - val, data = self.command(self.ESP_READ_REG, struct.pack(' 0: - # add a dummy write to a date register as an excuse to have a delay - command += struct.pack(' start: - raise FatalError(("Software loader is resident at 0x%08x-0x%08x. " - "Can't load binary at overlapping address range 0x%08x-0x%08x. " - "Either change binary loading address, or use the --no-stub " - "option to disable the software loader.") % (start, end, load_start, load_end)) - - return self.check_command("enter RAM download mode", self.ESP_MEM_BEGIN, - struct.pack(' length: - raise FatalError('Read more than expected') - - digest_frame = self.read() - if len(digest_frame) != 16: - raise FatalError('Expected digest, got: %s' % hexify(digest_frame)) - expected_digest = hexify(digest_frame).upper() - digest = hashlib.md5(data).hexdigest().upper() - if digest != expected_digest: - raise FatalError('Digest mismatch: expected %s, got %s' % (expected_digest, digest)) - return data - - def flash_spi_attach(self, hspi_arg): - """Send SPI attach command to enable the SPI flash pins - - ESP8266 ROM does this when you send flash_begin, ESP32 ROM - has it as a SPI command. - """ - # last 3 bytes in ESP_SPI_ATTACH argument are reserved values - arg = struct.pack(' 0: - self.write_reg(SPI_MOSI_DLEN_REG, mosi_bits - 1) - if miso_bits > 0: - self.write_reg(SPI_MISO_DLEN_REG, miso_bits - 1) - flags = 0 - if dummy_len > 0: - flags |= (dummy_len - 1) - if addr_len > 0: - flags |= (addr_len - 1) << SPI_USR_ADDR_LEN_SHIFT - if flags: - self.write_reg(SPI_USR1_REG, flags) - else: - def set_data_lengths(mosi_bits, miso_bits): - SPI_DATA_LEN_REG = SPI_USR1_REG - SPI_MOSI_BITLEN_S = 17 - SPI_MISO_BITLEN_S = 8 - mosi_mask = 0 if (mosi_bits == 0) else (mosi_bits - 1) - miso_mask = 0 if (miso_bits == 0) else (miso_bits - 1) - flags = (miso_mask << SPI_MISO_BITLEN_S) | (mosi_mask << SPI_MOSI_BITLEN_S) - if dummy_len > 0: - flags |= (dummy_len - 1) - if addr_len > 0: - flags |= (addr_len - 1) << SPI_USR_ADDR_LEN_SHIFT - self.write_reg(SPI_DATA_LEN_REG, flags) - - # SPI peripheral "command" bitmasks for SPI_CMD_REG - SPI_CMD_USR = (1 << 18) - - # shift values - SPI_USR2_COMMAND_LEN_SHIFT = 28 - SPI_USR_ADDR_LEN_SHIFT = 26 - - if read_bits > 32: - raise FatalError("Reading more than 32 bits back from a SPI flash operation is unsupported") - if len(data) > 64: - raise FatalError("Writing more than 64 bytes of data with one SPI command is unsupported") - - data_bits = len(data) * 8 - old_spi_usr = self.read_reg(SPI_USR_REG) - old_spi_usr2 = self.read_reg(SPI_USR2_REG) - flags = SPI_USR_COMMAND - if read_bits > 0: - flags |= SPI_USR_MISO - if data_bits > 0: - flags |= SPI_USR_MOSI - if addr_len > 0: - flags |= SPI_USR_ADDR - if dummy_len > 0: - flags |= SPI_USR_DUMMY - set_data_lengths(data_bits, read_bits) - self.write_reg(SPI_USR_REG, flags) - self.write_reg(SPI_USR2_REG, - (7 << SPI_USR2_COMMAND_LEN_SHIFT) | spiflash_command) - if addr and addr_len > 0: - self.write_reg(SPI_ADDR_REG, addr) - if data_bits == 0: - self.write_reg(SPI_W0_REG, 0) # clear data register before we read it - else: - data = pad_to(data, 4, b'\00') # pad to 32-bit multiple - words = struct.unpack("I" * (len(data) // 4), data) - next_reg = SPI_W0_REG - for word in words: - self.write_reg(next_reg, word) - next_reg += 4 - self.write_reg(SPI_CMD_REG, SPI_CMD_USR) - - def wait_done(): - for _ in range(10): - if (self.read_reg(SPI_CMD_REG) & SPI_CMD_USR) == 0: - return - raise FatalError("SPI command did not complete in time") - wait_done() - - status = self.read_reg(SPI_W0_REG) - # restore some SPI controller registers - self.write_reg(SPI_USR_REG, old_spi_usr) - self.write_reg(SPI_USR2_REG, old_spi_usr2) - return status - - def read_spiflash_sfdp(self, addr, read_bits): - CMD_RDSFDP = 0x5A - return self.run_spiflash_command(CMD_RDSFDP, read_bits=read_bits, addr=addr, addr_len=24, dummy_len=8) - - def read_status(self, num_bytes=2): - """Read up to 24 bits (num_bytes) of SPI flash status register contents - via RDSR, RDSR2, RDSR3 commands - - Not all SPI flash supports all three commands. The upper 1 or 2 - bytes may be 0xFF. - """ - SPIFLASH_RDSR = 0x05 - SPIFLASH_RDSR2 = 0x35 - SPIFLASH_RDSR3 = 0x15 - - status = 0 - shift = 0 - for cmd in [SPIFLASH_RDSR, SPIFLASH_RDSR2, SPIFLASH_RDSR3][0:num_bytes]: - status += self.run_spiflash_command(cmd, read_bits=8) << shift - shift += 8 - return status - - def write_status(self, new_status, num_bytes=2, set_non_volatile=False): - """Write up to 24 bits (num_bytes) of new status register - - num_bytes can be 1, 2 or 3. - - Not all flash supports the additional commands to write the - second and third byte of the status register. When writing 2 - bytes, esptool also sends a 16-byte WRSR command (as some - flash types use this instead of WRSR2.) - - If the set_non_volatile flag is set, non-volatile bits will - be set as well as volatile ones (WREN used instead of WEVSR). - - """ - SPIFLASH_WRSR = 0x01 - SPIFLASH_WRSR2 = 0x31 - SPIFLASH_WRSR3 = 0x11 - SPIFLASH_WEVSR = 0x50 - SPIFLASH_WREN = 0x06 - SPIFLASH_WRDI = 0x04 - - enable_cmd = SPIFLASH_WREN if set_non_volatile else SPIFLASH_WEVSR - - # try using a 16-bit WRSR (not supported by all chips) - # this may be redundant, but shouldn't hurt - if num_bytes == 2: - self.run_spiflash_command(enable_cmd) - self.run_spiflash_command(SPIFLASH_WRSR, struct.pack(">= 8 - - self.run_spiflash_command(SPIFLASH_WRDI) - - def get_crystal_freq(self): - # Figure out the crystal frequency from the UART clock divider - # Returns a normalized value in integer MHz (40 or 26 are the only supported values) - # - # The logic here is: - # - We know that our baud rate and the ESP UART baud rate are roughly the same, or we couldn't communicate - # - We can read the UART clock divider register to know how the ESP derives this from the APB bus frequency - # - Multiplying these two together gives us the bus frequency which is either the crystal frequency (ESP32) - # or double the crystal frequency (ESP8266). See the self.XTAL_CLK_DIVIDER parameter for this factor. - uart_div = self.read_reg(self.UART_CLKDIV_REG) & self.UART_CLKDIV_MASK - est_xtal = (self._port.baudrate * uart_div) / 1e6 / self.XTAL_CLK_DIVIDER - norm_xtal = 40 if est_xtal > 33 else 26 - if abs(norm_xtal - est_xtal) > 1: - print("WARNING: Detected crystal freq %.2fMHz is quite different to normalized freq %dMHz. Unsupported crystal in use?" % (est_xtal, norm_xtal)) - return norm_xtal - - def hard_reset(self): - print('Hard resetting via RTS pin...') - self._setRTS(True) # EN->LOW - time.sleep(0.1) - self._setRTS(False) - - def soft_reset(self, stay_in_bootloader): - if not self.IS_STUB: - if stay_in_bootloader: - return # ROM bootloader is already in bootloader! - else: - # 'run user code' is as close to a soft reset as we can do - self.flash_begin(0, 0) - self.flash_finish(False) - else: - if stay_in_bootloader: - # soft resetting from the stub loader - # will re-load the ROM bootloader - self.flash_begin(0, 0) - self.flash_finish(True) - elif self.CHIP_NAME != "ESP8266": - raise FatalError("Soft resetting is currently only supported on ESP8266") - else: - # running user code from stub loader requires some hacks - # in the stub loader - self.command(self.ESP_RUN_USER_CODE, wait_response=False) - - def check_chip_id(self): - try: - chip_id = self.get_chip_id() - if chip_id != self.IMAGE_CHIP_ID: - print("WARNING: Chip ID {} ({}) doesn't match expected Chip ID {}. esptool may not work correctly." - .format(chip_id, self.UNSUPPORTED_CHIPS.get(chip_id, 'Unknown'), self.IMAGE_CHIP_ID)) - # Try to flash anyways by disabling stub - self.stub_is_disabled = True - except NotImplementedInROMError: - pass - - -class ESP8266ROM(ESPLoader): - """ Access class for ESP8266 ROM bootloader - """ - CHIP_NAME = "ESP8266" - IS_STUB = False - - CHIP_DETECT_MAGIC_VALUE = [0xfff0c101] - - # OTP ROM addresses - ESP_OTP_MAC0 = 0x3ff00050 - ESP_OTP_MAC1 = 0x3ff00054 - ESP_OTP_MAC3 = 0x3ff0005c - - SPI_REG_BASE = 0x60000200 - SPI_USR_OFFS = 0x1c - SPI_USR1_OFFS = 0x20 - SPI_USR2_OFFS = 0x24 - SPI_MOSI_DLEN_OFFS = None - SPI_MISO_DLEN_OFFS = None - SPI_W0_OFFS = 0x40 - - UART_CLKDIV_REG = 0x60000014 - - XTAL_CLK_DIVIDER = 2 - - FLASH_SIZES = { - '512KB': 0x00, - '256KB': 0x10, - '1MB': 0x20, - '2MB': 0x30, - '4MB': 0x40, - '2MB-c1': 0x50, - '4MB-c1': 0x60, - '8MB': 0x80, - '16MB': 0x90, - } - - FLASH_FREQUENCY = { - '80m': 0xf, - '40m': 0x0, - '26m': 0x1, - '20m': 0x2, - } - - BOOTLOADER_FLASH_OFFSET = 0 - - MEMORY_MAP = [[0x3FF00000, 0x3FF00010, "DPORT"], - [0x3FFE8000, 0x40000000, "DRAM"], - [0x40100000, 0x40108000, "IRAM"], - [0x40201010, 0x402E1010, "IROM"]] - - def get_efuses(self): - # Return the 128 bits of ESP8266 efuse as a single Python integer - result = self.read_reg(0x3ff0005c) << 96 - result |= self.read_reg(0x3ff00058) << 64 - result |= self.read_reg(0x3ff00054) << 32 - result |= self.read_reg(0x3ff00050) - return result - - def _get_flash_size(self, efuses): - # rX_Y = EFUSE_DATA_OUTX[Y] - r0_4 = (efuses & (1 << 4)) != 0 - r3_25 = (efuses & (1 << 121)) != 0 - r3_26 = (efuses & (1 << 122)) != 0 - r3_27 = (efuses & (1 << 123)) != 0 - - if r0_4 and not r3_25: - if not r3_27 and not r3_26: - return 1 - elif not r3_27 and r3_26: - return 2 - if not r0_4 and r3_25: - if not r3_27 and not r3_26: - return 2 - elif not r3_27 and r3_26: - return 4 - return -1 - - def get_chip_description(self): - efuses = self.get_efuses() - is_8285 = (efuses & ((1 << 4) | 1 << 80)) != 0 # One or the other efuse bit is set for ESP8285 - if is_8285: - flash_size = self._get_flash_size(efuses) - max_temp = (efuses & (1 << 5)) != 0 # This efuse bit identifies the max flash temperature - chip_name = { - 1: "ESP8285H08" if max_temp else "ESP8285N08", - 2: "ESP8285H16" if max_temp else "ESP8285N16" - }.get(flash_size, "ESP8285") - return chip_name - return "ESP8266EX" - - def get_chip_features(self): - features = ["WiFi"] - if "ESP8285" in self.get_chip_description(): - features += ["Embedded Flash"] - return features - - def flash_spi_attach(self, hspi_arg): - if self.IS_STUB: - super(ESP8266ROM, self).flash_spi_attach(hspi_arg) - else: - # ESP8266 ROM has no flash_spi_attach command in serial protocol, - # but flash_begin will do it - self.flash_begin(0, 0) - - def flash_set_parameters(self, size): - # not implemented in ROM, but OK to silently skip for ROM - if self.IS_STUB: - super(ESP8266ROM, self).flash_set_parameters(size) - - def chip_id(self): - """ Read Chip ID from efuse - the equivalent of the SDK system_get_chip_id() function """ - id0 = self.read_reg(self.ESP_OTP_MAC0) - id1 = self.read_reg(self.ESP_OTP_MAC1) - return (id0 >> 24) | ((id1 & MAX_UINT24) << 8) - - def read_mac(self): - """ Read MAC from OTP ROM """ - mac0 = self.read_reg(self.ESP_OTP_MAC0) - mac1 = self.read_reg(self.ESP_OTP_MAC1) - mac3 = self.read_reg(self.ESP_OTP_MAC3) - if (mac3 != 0): - oui = ((mac3 >> 16) & 0xff, (mac3 >> 8) & 0xff, mac3 & 0xff) - elif ((mac1 >> 16) & 0xff) == 0: - oui = (0x18, 0xfe, 0x34) - elif ((mac1 >> 16) & 0xff) == 1: - oui = (0xac, 0xd0, 0x74) - else: - raise FatalError("Unknown OUI") - return oui + ((mac1 >> 8) & 0xff, mac1 & 0xff, (mac0 >> 24) & 0xff) - - def get_erase_size(self, offset, size): - """ Calculate an erase size given a specific size in bytes. - - Provides a workaround for the bootloader erase bug.""" - - sectors_per_block = 16 - sector_size = self.FLASH_SECTOR_SIZE - num_sectors = (size + sector_size - 1) // sector_size - start_sector = offset // sector_size - - head_sectors = sectors_per_block - (start_sector % sectors_per_block) - if num_sectors < head_sectors: - head_sectors = num_sectors - - if num_sectors < 2 * head_sectors: - return (num_sectors + 1) // 2 * sector_size - else: - return (num_sectors - head_sectors) * sector_size - - def override_vddsdio(self, new_voltage): - raise NotImplementedInROMError("Overriding VDDSDIO setting only applies to ESP32") - - -class ESP8266StubLoader(ESP8266ROM): - """ Access class for ESP8266 stub loader, runs on top of ROM. - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - def get_erase_size(self, offset, size): - return size # stub doesn't have same size bug as ROM loader - - -ESP8266ROM.STUB_CLASS = ESP8266StubLoader - - -class ESP32ROM(ESPLoader): - """Access class for ESP32 ROM bootloader - - """ - CHIP_NAME = "ESP32" - IMAGE_CHIP_ID = 0 - IS_STUB = False - - FPGA_SLOW_BOOT = True - - CHIP_DETECT_MAGIC_VALUE = [0x00f01d83] - - IROM_MAP_START = 0x400d0000 - IROM_MAP_END = 0x40400000 - - DROM_MAP_START = 0x3F400000 - DROM_MAP_END = 0x3F800000 - - # ESP32 uses a 4 byte status reply - STATUS_BYTES_LENGTH = 4 - - SPI_REG_BASE = 0x3ff42000 - SPI_USR_OFFS = 0x1c - SPI_USR1_OFFS = 0x20 - SPI_USR2_OFFS = 0x24 - SPI_MOSI_DLEN_OFFS = 0x28 - SPI_MISO_DLEN_OFFS = 0x2c - EFUSE_RD_REG_BASE = 0x3ff5a000 - - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG = EFUSE_RD_REG_BASE + 0x18 - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT = (1 << 7) # EFUSE_RD_DISABLE_DL_ENCRYPT - - DR_REG_SYSCON_BASE = 0x3ff66000 - - SPI_W0_OFFS = 0x80 - - UART_CLKDIV_REG = 0x3ff40014 - - XTAL_CLK_DIVIDER = 1 - - FLASH_SIZES = { - '1MB': 0x00, - '2MB': 0x10, - '4MB': 0x20, - '8MB': 0x30, - '16MB': 0x40, - '32MB': 0x50, - '64MB': 0x60, - '128MB': 0x70 - } - - FLASH_FREQUENCY = { - '80m': 0xf, - '40m': 0x0, - '26m': 0x1, - '20m': 0x2, - } - - BOOTLOADER_FLASH_OFFSET = 0x1000 - - OVERRIDE_VDDSDIO_CHOICES = ["1.8V", "1.9V", "OFF"] - - MEMORY_MAP = [[0x00000000, 0x00010000, "PADDING"], - [0x3F400000, 0x3F800000, "DROM"], - [0x3F800000, 0x3FC00000, "EXTRAM_DATA"], - [0x3FF80000, 0x3FF82000, "RTC_DRAM"], - [0x3FF90000, 0x40000000, "BYTE_ACCESSIBLE"], - [0x3FFAE000, 0x40000000, "DRAM"], - [0x3FFE0000, 0x3FFFFFFC, "DIRAM_DRAM"], - [0x40000000, 0x40070000, "IROM"], - [0x40070000, 0x40078000, "CACHE_PRO"], - [0x40078000, 0x40080000, "CACHE_APP"], - [0x40080000, 0x400A0000, "IRAM"], - [0x400A0000, 0x400BFFFC, "DIRAM_IRAM"], - [0x400C0000, 0x400C2000, "RTC_IRAM"], - [0x400D0000, 0x40400000, "IROM"], - [0x50000000, 0x50002000, "RTC_DATA"]] - - FLASH_ENCRYPTED_WRITE_ALIGN = 32 - - """ Try to read the BLOCK1 (encryption key) and check if it is valid """ - - def is_flash_encryption_key_valid(self): - - """ Bit 0 of efuse_rd_disable[3:0] is mapped to BLOCK1 - this bit is at position 16 in EFUSE_BLK0_RDATA0_REG """ - word0 = self.read_efuse(0) - rd_disable = (word0 >> 16) & 0x1 - - # reading of BLOCK1 is NOT ALLOWED so we assume valid key is programmed - if rd_disable: - return True - else: - # reading of BLOCK1 is ALLOWED so we will read and verify for non-zero. - # When ESP32 has not generated AES/encryption key in BLOCK1, the contents will be readable and 0. - # If the flash encryption is enabled it is expected to have a valid non-zero key. We break out on - # first occurance of non-zero value - key_word = [0] * 7 - for i in range(len(key_word)): - key_word[i] = self.read_efuse(14 + i) - # key is non-zero so break & return - if key_word[i] != 0: - return True - return False - - def get_flash_crypt_config(self): - """ For flash encryption related commands we need to make sure - user has programmed all the relevant efuse correctly so before - writing encrypted write_flash_encrypt esptool will verify the values - of flash_crypt_config to be non zero if they are not read - protected. If the values are zero a warning will be printed - - bit 3 in efuse_rd_disable[3:0] is mapped to flash_crypt_config - this bit is at position 19 in EFUSE_BLK0_RDATA0_REG """ - word0 = self.read_efuse(0) - rd_disable = (word0 >> 19) & 0x1 - - if rd_disable == 0: - """ we can read the flash_crypt_config efuse value - so go & read it (EFUSE_BLK0_RDATA5_REG[31:28]) """ - word5 = self.read_efuse(5) - word5 = (word5 >> 28) & 0xF - return word5 - else: - # if read of the efuse is disabled we assume it is set correctly - return 0xF - - def get_encrypted_download_disabled(self): - if self.read_reg(self.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG) & self.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT: - return True - else: - return False - - def get_pkg_version(self): - word3 = self.read_efuse(3) - pkg_version = (word3 >> 9) & 0x07 - pkg_version += ((word3 >> 2) & 0x1) << 3 - return pkg_version - - def get_chip_revision(self): - word3 = self.read_efuse(3) - word5 = self.read_efuse(5) - apb_ctl_date = self.read_reg(self.DR_REG_SYSCON_BASE + 0x7C) - - rev_bit0 = (word3 >> 15) & 0x1 - rev_bit1 = (word5 >> 20) & 0x1 - rev_bit2 = (apb_ctl_date >> 31) & 0x1 - if rev_bit0: - if rev_bit1: - if rev_bit2: - return 3 - else: - return 2 - else: - return 1 - return 0 - - def get_chip_description(self): - pkg_version = self.get_pkg_version() - chip_revision = self.get_chip_revision() - rev3 = (chip_revision == 3) - single_core = self.read_efuse(3) & (1 << 0) # CHIP_VER DIS_APP_CPU - - chip_name = { - 0: "ESP32-S0WDQ6" if single_core else "ESP32-D0WDQ6", - 1: "ESP32-S0WD" if single_core else "ESP32-D0WD", - 2: "ESP32-D2WD", - 4: "ESP32-U4WDH", - 5: "ESP32-PICO-V3" if rev3 else "ESP32-PICO-D4", - 6: "ESP32-PICO-V3-02", - 7: "ESP32-D0WDR2-V3", - }.get(pkg_version, "unknown ESP32") - - # ESP32-D0WD-V3, ESP32-D0WDQ6-V3 - if chip_name.startswith("ESP32-D0WD") and rev3: - chip_name += "-V3" - - return "%s (revision %d)" % (chip_name, chip_revision) - - def get_chip_features(self): - features = ["WiFi"] - word3 = self.read_efuse(3) - - # names of variables in this section are lowercase - # versions of EFUSE names as documented in TRM and - # ESP-IDF efuse_reg.h - - chip_ver_dis_bt = word3 & (1 << 1) - if chip_ver_dis_bt == 0: - features += ["BT"] - - chip_ver_dis_app_cpu = word3 & (1 << 0) - if chip_ver_dis_app_cpu: - features += ["Single Core"] - else: - features += ["Dual Core"] - - chip_cpu_freq_rated = word3 & (1 << 13) - if chip_cpu_freq_rated: - chip_cpu_freq_low = word3 & (1 << 12) - if chip_cpu_freq_low: - features += ["160MHz"] - else: - features += ["240MHz"] - - pkg_version = self.get_pkg_version() - if pkg_version in [2, 4, 5, 6]: - features += ["Embedded Flash"] - - if pkg_version == 6: - features += ["Embedded PSRAM"] - - word4 = self.read_efuse(4) - adc_vref = (word4 >> 8) & 0x1F - if adc_vref: - features += ["VRef calibration in efuse"] - - blk3_part_res = word3 >> 14 & 0x1 - if blk3_part_res: - features += ["BLK3 partially reserved"] - - word6 = self.read_efuse(6) - coding_scheme = word6 & 0x3 - features += ["Coding Scheme %s" % { - 0: "None", - 1: "3/4", - 2: "Repeat (UNSUPPORTED)", - 3: "Invalid"}[coding_scheme]] - - return features - - def read_efuse(self, n): - """ Read the nth word of the ESP3x EFUSE region. """ - return self.read_reg(self.EFUSE_RD_REG_BASE + (4 * n)) - - def chip_id(self): - raise NotSupportedError(self, "chip_id") - - def read_mac(self): - """ Read MAC from EFUSE region """ - words = [self.read_efuse(2), self.read_efuse(1)] - bitstring = struct.pack(">II", *words) - bitstring = bitstring[2:8] # trim the 2 byte CRC - try: - return tuple(ord(b) for b in bitstring) - except TypeError: # Python 3, bitstring elements are already bytes - return tuple(bitstring) - - def get_erase_size(self, offset, size): - return size - - def override_vddsdio(self, new_voltage): - new_voltage = new_voltage.upper() - if new_voltage not in self.OVERRIDE_VDDSDIO_CHOICES: - raise FatalError("The only accepted VDDSDIO overrides are '1.8V', '1.9V' and 'OFF'") - RTC_CNTL_SDIO_CONF_REG = 0x3ff48074 - RTC_CNTL_XPD_SDIO_REG = (1 << 31) - RTC_CNTL_DREFH_SDIO_M = (3 << 29) - RTC_CNTL_DREFM_SDIO_M = (3 << 27) - RTC_CNTL_DREFL_SDIO_M = (3 << 25) - # RTC_CNTL_SDIO_TIEH = (1 << 23) # not used here, setting TIEH=1 would set 3.3V output, not safe for esptool.py to do - RTC_CNTL_SDIO_FORCE = (1 << 22) - RTC_CNTL_SDIO_PD_EN = (1 << 21) - - reg_val = RTC_CNTL_SDIO_FORCE # override efuse setting - reg_val |= RTC_CNTL_SDIO_PD_EN - if new_voltage != "OFF": - reg_val |= RTC_CNTL_XPD_SDIO_REG # enable internal LDO - if new_voltage == "1.9V": - reg_val |= (RTC_CNTL_DREFH_SDIO_M | RTC_CNTL_DREFM_SDIO_M | RTC_CNTL_DREFL_SDIO_M) # boost voltage - self.write_reg(RTC_CNTL_SDIO_CONF_REG, reg_val) - print("VDDSDIO regulator set to %s" % new_voltage) - - def read_flash_slow(self, offset, length, progress_fn): - BLOCK_LEN = 64 # ROM read limit per command (this limit is why it's so slow) - - data = b'' - while len(data) < length: - block_len = min(BLOCK_LEN, length - len(data)) - r = self.check_command("read flash block", self.ESP_READ_FLASH_SLOW, - struct.pack('> 0) & 0x0F - return pkg_version - - def get_flash_version(self): - num_word = 3 - block1_addr = self.EFUSE_BASE + 0x044 - word3 = self.read_reg(block1_addr + (4 * num_word)) - pkg_version = (word3 >> 21) & 0x0F - return pkg_version - - def get_psram_version(self): - num_word = 3 - block1_addr = self.EFUSE_BASE + 0x044 - word3 = self.read_reg(block1_addr + (4 * num_word)) - pkg_version = (word3 >> 28) & 0x0F - return pkg_version - - def get_block2_version(self): - num_word = 4 - block2_addr = self.EFUSE_BASE + 0x05C - word4 = self.read_reg(block2_addr + (4 * num_word)) - block2_version = (word4 >> 4) & 0x07 - return block2_version - - def get_chip_description(self): - chip_name = { - 0: "ESP32-S2", - 1: "ESP32-S2FH2", - 2: "ESP32-S2FH4", - 102: "ESP32-S2FNR2", - 100: "ESP32-S2R2", - }.get(self.get_flash_version() + self.get_psram_version() * 100, "unknown ESP32-S2") - - return "%s" % (chip_name) - - def get_chip_features(self): - features = ["WiFi"] - - if self.secure_download_mode: - features += ["Secure Download Mode Enabled"] - - flash_version = { - 0: "No Embedded Flash", - 1: "Embedded Flash 2MB", - 2: "Embedded Flash 4MB", - }.get(self.get_flash_version(), "Unknown Embedded Flash") - features += [flash_version] - - psram_version = { - 0: "No Embedded PSRAM", - 1: "Embedded PSRAM 2MB", - 2: "Embedded PSRAM 4MB", - }.get(self.get_psram_version(), "Unknown Embedded PSRAM") - features += [psram_version] - - block2_version = { - 0: "No calibration in BLK2 of efuse", - 1: "ADC and temperature sensor calibration in BLK2 of efuse V1", - 2: "ADC and temperature sensor calibration in BLK2 of efuse V2", - }.get(self.get_block2_version(), "Unknown Calibration in BLK2") - features += [block2_version] - - return features - - def get_crystal_freq(self): - # ESP32-S2 XTAL is fixed to 40MHz - return 40 - - def override_vddsdio(self, new_voltage): - raise NotImplementedInROMError("VDD_SDIO overrides are not supported for ESP32-S2") - - def read_mac(self): - mac0 = self.read_reg(self.MAC_EFUSE_REG) - mac1 = self.read_reg(self.MAC_EFUSE_REG + 4) # only bottom 16 bits are MAC - bitstring = struct.pack(">II", mac1, mac0)[2:] - try: - return tuple(ord(b) for b in bitstring) - except TypeError: # Python 3, bitstring elements are already bytes - return tuple(bitstring) - - def get_flash_crypt_config(self): - return None # doesn't exist on ESP32-S2 - - def get_key_block_purpose(self, key_block): - if key_block < 0 or key_block > 5: - raise FatalError("Valid key block numbers must be in range 0-5") - - reg, shift = [(self.EFUSE_PURPOSE_KEY0_REG, self.EFUSE_PURPOSE_KEY0_SHIFT), - (self.EFUSE_PURPOSE_KEY1_REG, self.EFUSE_PURPOSE_KEY1_SHIFT), - (self.EFUSE_PURPOSE_KEY2_REG, self.EFUSE_PURPOSE_KEY2_SHIFT), - (self.EFUSE_PURPOSE_KEY3_REG, self.EFUSE_PURPOSE_KEY3_SHIFT), - (self.EFUSE_PURPOSE_KEY4_REG, self.EFUSE_PURPOSE_KEY4_SHIFT), - (self.EFUSE_PURPOSE_KEY5_REG, self.EFUSE_PURPOSE_KEY5_SHIFT)][key_block] - return (self.read_reg(reg) >> shift) & 0xF - - def is_flash_encryption_key_valid(self): - # Need to see either an AES-128 key or two AES-256 keys - purposes = [self.get_key_block_purpose(b) for b in range(6)] - - if any(p == self.PURPOSE_VAL_XTS_AES128_KEY for p in purposes): - return True - - return any(p == self.PURPOSE_VAL_XTS_AES256_KEY_1 for p in purposes) \ - and any(p == self.PURPOSE_VAL_XTS_AES256_KEY_2 for p in purposes) - - def uses_usb(self, _cache=[]): - if self.secure_download_mode: - return False # can't detect native USB in secure download mode - if not _cache: - buf_no = self.read_reg(self.UARTDEV_BUF_NO) & 0xff - _cache.append(buf_no == self.UARTDEV_BUF_NO_USB) - return _cache[0] - - def _post_connect(self): - if self.uses_usb(): - self.ESP_RAM_BLOCK = self.USB_RAM_BLOCK - - def _check_if_can_reset(self): - """ - Check the strapping register to see if we can reset out of download mode. - """ - if os.getenv("ESPTOOL_TESTING") is not None: - print("ESPTOOL_TESTING is set, ignoring strapping mode check") - # Esptool tests over USB CDC run with GPIO0 strapped low, don't complain in this case. - return - strap_reg = self.read_reg(self.GPIO_STRAP_REG) - force_dl_reg = self.read_reg(self.RTC_CNTL_OPTION1_REG) - if strap_reg & self.GPIO_STRAP_SPI_BOOT_MASK == 0 and force_dl_reg & self.RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK == 0: - print("WARNING: {} chip was placed into download mode using GPIO0.\n" - "esptool.py can not exit the download mode over USB. " - "To run the app, reset the chip manually.\n" - "To suppress this note, set --after option to 'no_reset'.".format(self.get_chip_description())) - raise SystemExit(1) - - def hard_reset(self): - if self.uses_usb(): - self._check_if_can_reset() - - print('Hard resetting via RTS pin...') - self._setRTS(True) # EN->LOW - if self.uses_usb(): - # Give the chip some time to come out of reset, to be able to handle further DTR/RTS transitions - time.sleep(0.2) - self._setRTS(False) - time.sleep(0.2) - else: - self._setRTS(False) - - -class ESP32S3ROM(ESP32ROM): - CHIP_NAME = "ESP32-S3" - - IMAGE_CHIP_ID = 9 - - CHIP_DETECT_MAGIC_VALUE = [0x9] - - BOOTLOADER_FLASH_OFFSET = 0x0 - - FPGA_SLOW_BOOT = False - - IROM_MAP_START = 0x42000000 - IROM_MAP_END = 0x44000000 - DROM_MAP_START = 0x3c000000 - DROM_MAP_END = 0x3e000000 - - UART_DATE_REG_ADDR = 0x60000080 - - SPI_REG_BASE = 0x60002000 - SPI_USR_OFFS = 0x18 - SPI_USR1_OFFS = 0x1c - SPI_USR2_OFFS = 0x20 - SPI_MOSI_DLEN_OFFS = 0x24 - SPI_MISO_DLEN_OFFS = 0x28 - SPI_W0_OFFS = 0x58 - - FLASH_ENCRYPTED_WRITE_ALIGN = 16 - - # todo: use espefuse APIs to get this info - EFUSE_BASE = 0x60007000 # BLOCK0 read base address - MAC_EFUSE_REG = EFUSE_BASE + 0x044 - - EFUSE_RD_REG_BASE = EFUSE_BASE + 0x030 # BLOCK0 read base address - - EFUSE_PURPOSE_KEY0_REG = EFUSE_BASE + 0x34 - EFUSE_PURPOSE_KEY0_SHIFT = 24 - EFUSE_PURPOSE_KEY1_REG = EFUSE_BASE + 0x34 - EFUSE_PURPOSE_KEY1_SHIFT = 28 - EFUSE_PURPOSE_KEY2_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY2_SHIFT = 0 - EFUSE_PURPOSE_KEY3_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY3_SHIFT = 4 - EFUSE_PURPOSE_KEY4_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY4_SHIFT = 8 - EFUSE_PURPOSE_KEY5_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY5_SHIFT = 12 - - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG = EFUSE_RD_REG_BASE - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT = 1 << 20 - - PURPOSE_VAL_XTS_AES256_KEY_1 = 2 - PURPOSE_VAL_XTS_AES256_KEY_2 = 3 - PURPOSE_VAL_XTS_AES128_KEY = 4 - - UARTDEV_BUF_NO = 0x3fcef14c # Variable in ROM .bss which indicates the port in use - UARTDEV_BUF_NO_USB = 3 # Value of the above variable indicating that USB is in use - - USB_RAM_BLOCK = 0x800 # Max block size USB CDC is used - - GPIO_STRAP_REG = 0x60004038 - GPIO_STRAP_SPI_BOOT_MASK = 0x8 # Not download mode - RTC_CNTL_OPTION1_REG = 0x6000812C - RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK = 0x1 # Is download mode forced over USB? - - UART_CLKDIV_REG = 0x60000014 - - MEMORY_MAP = [[0x00000000, 0x00010000, "PADDING"], - [0x3C000000, 0x3D000000, "DROM"], - [0x3D000000, 0x3E000000, "EXTRAM_DATA"], - [0x600FE000, 0x60100000, "RTC_DRAM"], - [0x3FC88000, 0x3FD00000, "BYTE_ACCESSIBLE"], - [0x3FC88000, 0x403E2000, "MEM_INTERNAL"], - [0x3FC88000, 0x3FD00000, "DRAM"], - [0x40000000, 0x4001A100, "IROM_MASK"], - [0x40370000, 0x403E0000, "IRAM"], - [0x600FE000, 0x60100000, "RTC_IRAM"], - [0x42000000, 0x42800000, "IROM"], - [0x50000000, 0x50002000, "RTC_DATA"]] - - def get_chip_description(self): - return "ESP32-S3" - - def get_chip_features(self): - return ["WiFi", "BLE"] - - def get_crystal_freq(self): - # ESP32S3 XTAL is fixed to 40MHz - return 40 - - def get_flash_crypt_config(self): - return None # doesn't exist on ESP32-S3 - - def get_key_block_purpose(self, key_block): - if key_block < 0 or key_block > 5: - raise FatalError("Valid key block numbers must be in range 0-5") - - reg, shift = [(self.EFUSE_PURPOSE_KEY0_REG, self.EFUSE_PURPOSE_KEY0_SHIFT), - (self.EFUSE_PURPOSE_KEY1_REG, self.EFUSE_PURPOSE_KEY1_SHIFT), - (self.EFUSE_PURPOSE_KEY2_REG, self.EFUSE_PURPOSE_KEY2_SHIFT), - (self.EFUSE_PURPOSE_KEY3_REG, self.EFUSE_PURPOSE_KEY3_SHIFT), - (self.EFUSE_PURPOSE_KEY4_REG, self.EFUSE_PURPOSE_KEY4_SHIFT), - (self.EFUSE_PURPOSE_KEY5_REG, self.EFUSE_PURPOSE_KEY5_SHIFT)][key_block] - return (self.read_reg(reg) >> shift) & 0xF - - def is_flash_encryption_key_valid(self): - # Need to see either an AES-128 key or two AES-256 keys - purposes = [self.get_key_block_purpose(b) for b in range(6)] - - if any(p == self.PURPOSE_VAL_XTS_AES128_KEY for p in purposes): - return True - - return any(p == self.PURPOSE_VAL_XTS_AES256_KEY_1 for p in purposes) \ - and any(p == self.PURPOSE_VAL_XTS_AES256_KEY_2 for p in purposes) - - def override_vddsdio(self, new_voltage): - raise NotImplementedInROMError("VDD_SDIO overrides are not supported for ESP32-S3") - - def read_mac(self): - mac0 = self.read_reg(self.MAC_EFUSE_REG) - mac1 = self.read_reg(self.MAC_EFUSE_REG + 4) # only bottom 16 bits are MAC - bitstring = struct.pack(">II", mac1, mac0)[2:] - try: - return tuple(ord(b) for b in bitstring) - except TypeError: # Python 3, bitstring elements are already bytes - return tuple(bitstring) - - def uses_usb(self, _cache=[]): - if self.secure_download_mode: - return False # can't detect native USB in secure download mode - if not _cache: - buf_no = self.read_reg(self.UARTDEV_BUF_NO) & 0xff - _cache.append(buf_no == self.UARTDEV_BUF_NO_USB) - return _cache[0] - - def _post_connect(self): - if self.uses_usb(): - self.ESP_RAM_BLOCK = self.USB_RAM_BLOCK - - def _check_if_can_reset(self): - """ - Check the strapping register to see if we can reset out of download mode. - """ - if os.getenv("ESPTOOL_TESTING") is not None: - print("ESPTOOL_TESTING is set, ignoring strapping mode check") - # Esptool tests over USB CDC run with GPIO0 strapped low, don't complain in this case. - return - strap_reg = self.read_reg(self.GPIO_STRAP_REG) - force_dl_reg = self.read_reg(self.RTC_CNTL_OPTION1_REG) - if strap_reg & self.GPIO_STRAP_SPI_BOOT_MASK == 0 and force_dl_reg & self.RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK == 0: - print("WARNING: {} chip was placed into download mode using GPIO0.\n" - "esptool.py can not exit the download mode over USB. " - "To run the app, reset the chip manually.\n" - "To suppress this note, set --after option to 'no_reset'.".format(self.get_chip_description())) - raise SystemExit(1) - - def hard_reset(self): - if self.uses_usb(): - self._check_if_can_reset() - - print('Hard resetting via RTS pin...') - self._setRTS(True) # EN->LOW - if self.uses_usb(): - # Give the chip some time to come out of reset, to be able to handle further DTR/RTS transitions - time.sleep(0.2) - self._setRTS(False) - time.sleep(0.2) - else: - self._setRTS(False) - - -class ESP32S3BETA2ROM(ESP32S3ROM): - CHIP_NAME = "ESP32-S3(beta2)" - IMAGE_CHIP_ID = 4 - - CHIP_DETECT_MAGIC_VALUE = [0xeb004136] - - EFUSE_BASE = 0x6001A000 # BLOCK0 read base address - - def get_chip_description(self): - return "ESP32-S3(beta2)" - - -class ESP32C3ROM(ESP32ROM): - CHIP_NAME = "ESP32-C3" - IMAGE_CHIP_ID = 5 - - FPGA_SLOW_BOOT = False - - IROM_MAP_START = 0x42000000 - IROM_MAP_END = 0x42800000 - DROM_MAP_START = 0x3c000000 - DROM_MAP_END = 0x3c800000 - - SPI_REG_BASE = 0x60002000 - SPI_USR_OFFS = 0x18 - SPI_USR1_OFFS = 0x1C - SPI_USR2_OFFS = 0x20 - SPI_MOSI_DLEN_OFFS = 0x24 - SPI_MISO_DLEN_OFFS = 0x28 - SPI_W0_OFFS = 0x58 - - BOOTLOADER_FLASH_OFFSET = 0x0 - - # Magic value for ESP32C3 eco 1+2 and ESP32C3 eco3 respectivly - CHIP_DETECT_MAGIC_VALUE = [0x6921506f, 0x1b31506f] - - UART_DATE_REG_ADDR = 0x60000000 + 0x7c - - EFUSE_BASE = 0x60008800 - MAC_EFUSE_REG = EFUSE_BASE + 0x044 - - EFUSE_RD_REG_BASE = EFUSE_BASE + 0x030 # BLOCK0 read base address - - EFUSE_PURPOSE_KEY0_REG = EFUSE_BASE + 0x34 - EFUSE_PURPOSE_KEY0_SHIFT = 24 - EFUSE_PURPOSE_KEY1_REG = EFUSE_BASE + 0x34 - EFUSE_PURPOSE_KEY1_SHIFT = 28 - EFUSE_PURPOSE_KEY2_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY2_SHIFT = 0 - EFUSE_PURPOSE_KEY3_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY3_SHIFT = 4 - EFUSE_PURPOSE_KEY4_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY4_SHIFT = 8 - EFUSE_PURPOSE_KEY5_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY5_SHIFT = 12 - - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG = EFUSE_RD_REG_BASE - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT = 1 << 20 - - PURPOSE_VAL_XTS_AES128_KEY = 4 - - GPIO_STRAP_REG = 0x3f404038 - - FLASH_ENCRYPTED_WRITE_ALIGN = 16 - - MEMORY_MAP = [[0x00000000, 0x00010000, "PADDING"], - [0x3C000000, 0x3C800000, "DROM"], - [0x3FC80000, 0x3FCE0000, "DRAM"], - [0x3FC88000, 0x3FD00000, "BYTE_ACCESSIBLE"], - [0x3FF00000, 0x3FF20000, "DROM_MASK"], - [0x40000000, 0x40060000, "IROM_MASK"], - [0x42000000, 0x42800000, "IROM"], - [0x4037C000, 0x403E0000, "IRAM"], - [0x50000000, 0x50002000, "RTC_IRAM"], - [0x50000000, 0x50002000, "RTC_DRAM"], - [0x600FE000, 0x60100000, "MEM_INTERNAL2"]] - - def get_pkg_version(self): - num_word = 3 - block1_addr = self.EFUSE_BASE + 0x044 - word3 = self.read_reg(block1_addr + (4 * num_word)) - pkg_version = (word3 >> 21) & 0x07 - return pkg_version - - def get_chip_revision(self): - # reads WAFER_VERSION field from EFUSE_RD_MAC_SPI_SYS_3_REG - block1_addr = self.EFUSE_BASE + 0x044 - num_word = 3 - pos = 18 - return (self.read_reg(block1_addr + (4 * num_word)) & (0x7 << pos)) >> pos - - def get_chip_description(self): - chip_name = { - 0: "ESP32-C3", - }.get(self.get_pkg_version(), "unknown ESP32-C3") - chip_revision = self.get_chip_revision() - - return "%s (revision %d)" % (chip_name, chip_revision) - - def get_chip_features(self): - return ["Wi-Fi"] - - def get_crystal_freq(self): - # ESP32C3 XTAL is fixed to 40MHz - return 40 - - def override_vddsdio(self, new_voltage): - raise NotImplementedInROMError("VDD_SDIO overrides are not supported for ESP32-C3") - - def read_mac(self): - mac0 = self.read_reg(self.MAC_EFUSE_REG) - mac1 = self.read_reg(self.MAC_EFUSE_REG + 4) # only bottom 16 bits are MAC - bitstring = struct.pack(">II", mac1, mac0)[2:] - try: - return tuple(ord(b) for b in bitstring) - except TypeError: # Python 3, bitstring elements are already bytes - return tuple(bitstring) - - def get_flash_crypt_config(self): - return None # doesn't exist on ESP32-C3 - - def get_key_block_purpose(self, key_block): - if key_block < 0 or key_block > 5: - raise FatalError("Valid key block numbers must be in range 0-5") - - reg, shift = [(self.EFUSE_PURPOSE_KEY0_REG, self.EFUSE_PURPOSE_KEY0_SHIFT), - (self.EFUSE_PURPOSE_KEY1_REG, self.EFUSE_PURPOSE_KEY1_SHIFT), - (self.EFUSE_PURPOSE_KEY2_REG, self.EFUSE_PURPOSE_KEY2_SHIFT), - (self.EFUSE_PURPOSE_KEY3_REG, self.EFUSE_PURPOSE_KEY3_SHIFT), - (self.EFUSE_PURPOSE_KEY4_REG, self.EFUSE_PURPOSE_KEY4_SHIFT), - (self.EFUSE_PURPOSE_KEY5_REG, self.EFUSE_PURPOSE_KEY5_SHIFT)][key_block] - return (self.read_reg(reg) >> shift) & 0xF - - def is_flash_encryption_key_valid(self): - # Need to see an AES-128 key - purposes = [self.get_key_block_purpose(b) for b in range(6)] - - return any(p == self.PURPOSE_VAL_XTS_AES128_KEY for p in purposes) - - -class ESP32H2BETA1ROM(ESP32ROM): - CHIP_NAME = "ESP32-H2(beta1)" - IMAGE_CHIP_ID = 10 - - IROM_MAP_START = 0x42000000 - IROM_MAP_END = 0x42800000 - DROM_MAP_START = 0x3c000000 - DROM_MAP_END = 0x3c800000 - - SPI_REG_BASE = 0x60002000 - SPI_USR_OFFS = 0x18 - SPI_USR1_OFFS = 0x1C - SPI_USR2_OFFS = 0x20 - SPI_MOSI_DLEN_OFFS = 0x24 - SPI_MISO_DLEN_OFFS = 0x28 - SPI_W0_OFFS = 0x58 - - BOOTLOADER_FLASH_OFFSET = 0x0 - - CHIP_DETECT_MAGIC_VALUE = [0xca26cc22] - - UART_DATE_REG_ADDR = 0x60000000 + 0x7c - - EFUSE_BASE = 0x6001A000 - MAC_EFUSE_REG = EFUSE_BASE + 0x044 - - EFUSE_RD_REG_BASE = EFUSE_BASE + 0x030 # BLOCK0 read base address - - EFUSE_PURPOSE_KEY0_REG = EFUSE_BASE + 0x34 - EFUSE_PURPOSE_KEY0_SHIFT = 24 - EFUSE_PURPOSE_KEY1_REG = EFUSE_BASE + 0x34 - EFUSE_PURPOSE_KEY1_SHIFT = 28 - EFUSE_PURPOSE_KEY2_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY2_SHIFT = 0 - EFUSE_PURPOSE_KEY3_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY3_SHIFT = 4 - EFUSE_PURPOSE_KEY4_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY4_SHIFT = 8 - EFUSE_PURPOSE_KEY5_REG = EFUSE_BASE + 0x38 - EFUSE_PURPOSE_KEY5_SHIFT = 12 - - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG = EFUSE_RD_REG_BASE - EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT = 1 << 20 - - PURPOSE_VAL_XTS_AES128_KEY = 4 - - GPIO_STRAP_REG = 0x3f404038 - - FLASH_ENCRYPTED_WRITE_ALIGN = 16 - - MEMORY_MAP = [] - - FLASH_FREQUENCY = { - '48m': 0xf, - '24m': 0x0, - '16m': 0x1, - '12m': 0x2, - } - - def get_pkg_version(self): - num_word = 3 - block1_addr = self.EFUSE_BASE + 0x044 - word3 = self.read_reg(block1_addr + (4 * num_word)) - pkg_version = (word3 >> 21) & 0x0F - return pkg_version - - def get_chip_revision(self): - # reads WAFER_VERSION field from EFUSE_RD_MAC_SPI_SYS_3_REG - block1_addr = self.EFUSE_BASE + 0x044 - num_word = 3 - pos = 18 - return (self.read_reg(block1_addr + (4 * num_word)) & (0x7 << pos)) >> pos - - def get_chip_description(self): - chip_name = { - 0: "ESP32-H2", - }.get(self.get_pkg_version(), "unknown ESP32-H2") - chip_revision = self.get_chip_revision() - - return "%s (revision %d)" % (chip_name, chip_revision) - - def get_chip_features(self): - return ["BLE/802.15.4"] - - def get_crystal_freq(self): - return 32 - - def override_vddsdio(self, new_voltage): - raise NotImplementedInROMError("VDD_SDIO overrides are not supported for ESP32-H2") - - def read_mac(self): - mac0 = self.read_reg(self.MAC_EFUSE_REG) - mac1 = self.read_reg(self.MAC_EFUSE_REG + 4) # only bottom 16 bits are MAC - bitstring = struct.pack(">II", mac1, mac0)[2:] - try: - return tuple(ord(b) for b in bitstring) - except TypeError: # Python 3, bitstring elements are already bytes - return tuple(bitstring) - - def get_flash_crypt_config(self): - return None # doesn't exist on ESP32-H2 - - def get_key_block_purpose(self, key_block): - if key_block < 0 or key_block > 5: - raise FatalError("Valid key block numbers must be in range 0-5") - - reg, shift = [(self.EFUSE_PURPOSE_KEY0_REG, self.EFUSE_PURPOSE_KEY0_SHIFT), - (self.EFUSE_PURPOSE_KEY1_REG, self.EFUSE_PURPOSE_KEY1_SHIFT), - (self.EFUSE_PURPOSE_KEY2_REG, self.EFUSE_PURPOSE_KEY2_SHIFT), - (self.EFUSE_PURPOSE_KEY3_REG, self.EFUSE_PURPOSE_KEY3_SHIFT), - (self.EFUSE_PURPOSE_KEY4_REG, self.EFUSE_PURPOSE_KEY4_SHIFT), - (self.EFUSE_PURPOSE_KEY5_REG, self.EFUSE_PURPOSE_KEY5_SHIFT)][key_block] - return (self.read_reg(reg) >> shift) & 0xF - - def is_flash_encryption_key_valid(self): - # Need to see an AES-128 key - purposes = [self.get_key_block_purpose(b) for b in range(6)] - - return any(p == self.PURPOSE_VAL_XTS_AES128_KEY for p in purposes) - - -class ESP32H2BETA2ROM(ESP32H2BETA1ROM): - CHIP_NAME = "ESP32-H2(beta2)" - IMAGE_CHIP_ID = 14 - - -class ESP32C2ROM(ESP32C3ROM): - CHIP_NAME = "ESP32-C2" - IMAGE_CHIP_ID = 12 - - IROM_MAP_START = 0x42000000 - IROM_MAP_END = 0x42400000 - DROM_MAP_START = 0x3c000000 - DROM_MAP_END = 0x3c400000 - - # Magic value for ESP32C2 ECO0 and ECO1 respectively - CHIP_DETECT_MAGIC_VALUE = [0x6F51306F, 0x7c41a06f] - - EFUSE_BASE = 0x60008800 - MAC_EFUSE_REG = EFUSE_BASE + 0x040 - - FLASH_FREQUENCY = { - '60m': 0xf, - '30m': 0x0, - '20m': 0x1, - '15m': 0x2, - } - - def get_pkg_version(self): - num_word = 3 - block1_addr = self.EFUSE_BASE + 0x044 - word3 = self.read_reg(block1_addr + (4 * num_word)) - pkg_version = (word3 >> 21) & 0x0F - return pkg_version - - def get_chip_description(self): - chip_name = { - 0: "ESP32-C2", - }.get(self.get_pkg_version(), "unknown ESP32-C2") - chip_revision = self.get_chip_revision() - - return "%s (revision %d)" % (chip_name, chip_revision) - - def get_chip_revision(self): - si = self.get_security_info() - return si["api_version"] - - def _post_connect(self): - # ESP32C2 ECO0 is no longer supported by the flasher stub - if self.get_chip_revision() == 0: - self.stub_is_disabled = True - self.IS_STUB = False - - -class ESP32C6BETAROM(ESP32C3ROM): - CHIP_NAME = "ESP32-C6(beta)" - IMAGE_CHIP_ID = 7 - - CHIP_DETECT_MAGIC_VALUE = [0x0da1806f] - - UART_DATE_REG_ADDR = 0x00000500 - - def get_chip_description(self): - chip_name = { - 0: "ESP32-C6", - }.get(self.get_pkg_version(), "unknown ESP32-C6") - chip_revision = self.get_chip_revision() - - return "%s (revision %d)" % (chip_name, chip_revision) - - -class ESP32StubLoader(ESP32ROM): - """ Access class for ESP32 stub loader, runs on top of ROM. - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32ROM.STUB_CLASS = ESP32StubLoader - - -class ESP32S2StubLoader(ESP32S2ROM): - """ Access class for ESP32-S2 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - if rom_loader.uses_usb(): - self.ESP_RAM_BLOCK = self.USB_RAM_BLOCK - self.FLASH_WRITE_SIZE = self.USB_RAM_BLOCK - - -ESP32S2ROM.STUB_CLASS = ESP32S2StubLoader - - -class ESP32S3BETA2StubLoader(ESP32S3BETA2ROM): - """ Access class for ESP32S3 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32S3BETA2ROM.STUB_CLASS = ESP32S3BETA2StubLoader - - -class ESP32S3StubLoader(ESP32S3ROM): - """ Access class for ESP32S3 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - if rom_loader.uses_usb(): - self.ESP_RAM_BLOCK = self.USB_RAM_BLOCK - self.FLASH_WRITE_SIZE = self.USB_RAM_BLOCK - - -ESP32S3ROM.STUB_CLASS = ESP32S3StubLoader - - -class ESP32C3StubLoader(ESP32C3ROM): - """ Access class for ESP32C3 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32C3ROM.STUB_CLASS = ESP32C3StubLoader - - -class ESP32H2BETA1StubLoader(ESP32H2BETA1ROM): - """ Access class for ESP32H2BETA1 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32H2BETA1ROM.STUB_CLASS = ESP32H2BETA1StubLoader - - -class ESP32H2BETA2StubLoader(ESP32H2BETA2ROM): - """ Access class for ESP32H2BETA2 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32H2BETA2ROM.STUB_CLASS = ESP32H2BETA2StubLoader - - -class ESP32C2StubLoader(ESP32C2ROM): - """ Access class for ESP32C2 stub loader, runs on top of ROM. - - (Basically the same as ESP32StubLoader, but different base class. - Can possibly be made into a mixin.) - """ - FLASH_WRITE_SIZE = 0x4000 # matches MAX_WRITE_BLOCK in stub_loader.c - STATUS_BYTES_LENGTH = 2 # same as ESP8266, different to ESP32 ROM - IS_STUB = True - - def __init__(self, rom_loader): - self.secure_download_mode = rom_loader.secure_download_mode - self._port = rom_loader._port - self._trace_enabled = rom_loader._trace_enabled - self.flush_input() # resets _slip_reader - - -ESP32C2ROM.STUB_CLASS = ESP32C2StubLoader - - -class ESPBOOTLOADER(object): - """ These are constants related to software ESP8266 bootloader, working with 'v2' image files """ - - # First byte of the "v2" application image - IMAGE_V2_MAGIC = 0xea - - # First 'segment' value in a "v2" application image, appears to be a constant version value? - IMAGE_V2_SEGMENT = 4 - - -def LoadFirmwareImage(chip, filename): - """ Load a firmware image. Can be for any supported SoC. - - ESP8266 images will be examined to determine if they are original ROM firmware images (ESP8266ROMFirmwareImage) - or "v2" OTA bootloader images. - - Returns a BaseFirmwareImage subclass, either ESP8266ROMFirmwareImage (v1) or ESP8266V2FirmwareImage (v2). - """ - chip = re.sub(r"[-()]", "", chip.lower()) - with open(filename, 'rb') as f: - if chip == 'esp32': - return ESP32FirmwareImage(f) - elif chip == "esp32s2": - return ESP32S2FirmwareImage(f) - elif chip == "esp32s3beta2": - return ESP32S3BETA2FirmwareImage(f) - elif chip == "esp32s3": - return ESP32S3FirmwareImage(f) - elif chip == 'esp32c3': - return ESP32C3FirmwareImage(f) - elif chip == 'esp32c6beta': - return ESP32C6BETAFirmwareImage(f) - elif chip == 'esp32h2beta1': - return ESP32H2BETA1FirmwareImage(f) - elif chip == 'esp32h2beta2': - return ESP32H2BETA2FirmwareImage(f) - elif chip == 'esp32c2': - return ESP32C2FirmwareImage(f) - else: # Otherwise, ESP8266 so look at magic to determine the image type - magic = ord(f.read(1)) - f.seek(0) - if magic == ESPLoader.ESP_IMAGE_MAGIC: - return ESP8266ROMFirmwareImage(f) - elif magic == ESPBOOTLOADER.IMAGE_V2_MAGIC: - return ESP8266V2FirmwareImage(f) - else: - raise FatalError("Invalid image magic number: %d" % magic) - - -class ImageSegment(object): - """ Wrapper class for a segment in an ESP image - (very similar to a section in an ELFImage also) """ - def __init__(self, addr, data, file_offs=None): - self.addr = addr - self.data = data - self.file_offs = file_offs - self.include_in_checksum = True - if self.addr != 0: - self.pad_to_alignment(4) # pad all "real" ImageSegments 4 byte aligned length - - def copy_with_new_addr(self, new_addr): - """ Return a new ImageSegment with same data, but mapped at - a new address. """ - return ImageSegment(new_addr, self.data, 0) - - def split_image(self, split_len): - """ Return a new ImageSegment which splits "split_len" bytes - from the beginning of the data. Remaining bytes are kept in - this segment object (and the start address is adjusted to match.) """ - result = copy.copy(self) - result.data = self.data[:split_len] - self.data = self.data[split_len:] - self.addr += split_len - self.file_offs = None - result.file_offs = None - return result - - def __repr__(self): - r = "len 0x%05x load 0x%08x" % (len(self.data), self.addr) - if self.file_offs is not None: - r += " file_offs 0x%08x" % (self.file_offs) - return r - - def get_memory_type(self, image): - """ - Return a list describing the memory type(s) that is covered by this - segment's start address. - """ - return [map_range[2] for map_range in image.ROM_LOADER.MEMORY_MAP if map_range[0] <= self.addr < map_range[1]] - - def pad_to_alignment(self, alignment): - self.data = pad_to(self.data, alignment, b'\x00') - - -class ELFSection(ImageSegment): - """ Wrapper class for a section in an ELF image, has a section - name as well as the common properties of an ImageSegment. """ - def __init__(self, name, addr, data): - super(ELFSection, self).__init__(addr, data) - self.name = name.decode("utf-8") - - def __repr__(self): - return "%s %s" % (self.name, super(ELFSection, self).__repr__()) - - -class BaseFirmwareImage(object): - SEG_HEADER_LEN = 8 - SHA256_DIGEST_LEN = 32 - - """ Base class with common firmware image functions """ - def __init__(self): - self.segments = [] - self.entrypoint = 0 - self.elf_sha256 = None - self.elf_sha256_offset = 0 - - def load_common_header(self, load_file, expected_magic): - (magic, segments, self.flash_mode, self.flash_size_freq, self.entrypoint) = struct.unpack(' 16: - raise FatalError('Invalid segment count %d (max 16). Usually this indicates a linker script problem.' % len(self.segments)) - - def load_segment(self, f, is_irom_segment=False): - """ Load the next segment from the image file """ - file_offs = f.tell() - (offset, size) = struct.unpack(' 0x40200000 or offset < 0x3ffe0000 or size > 65536: - print('WARNING: Suspicious segment 0x%x, length %d' % (offset, size)) - - def maybe_patch_segment_data(self, f, segment_data): - """If SHA256 digest of the ELF file needs to be inserted into this segment, do so. Returns segment data.""" - segment_len = len(segment_data) - file_pos = f.tell() # file_pos is position in the .bin file - if self.elf_sha256_offset >= file_pos and self.elf_sha256_offset < file_pos + segment_len: - # SHA256 digest needs to be patched into this binary segment, - # calculate offset of the digest inside the binary segment. - patch_offset = self.elf_sha256_offset - file_pos - # Sanity checks - if patch_offset < self.SEG_HEADER_LEN or patch_offset + self.SHA256_DIGEST_LEN > segment_len: - raise FatalError('Cannot place SHA256 digest on segment boundary' - '(elf_sha256_offset=%d, file_pos=%d, segment_size=%d)' % - (self.elf_sha256_offset, file_pos, segment_len)) - # offset relative to the data part - patch_offset -= self.SEG_HEADER_LEN - if segment_data[patch_offset:patch_offset + self.SHA256_DIGEST_LEN] != b'\x00' * self.SHA256_DIGEST_LEN: - raise FatalError('Contents of segment at SHA256 digest offset 0x%x are not all zero. Refusing to overwrite.' % - self.elf_sha256_offset) - assert(len(self.elf_sha256) == self.SHA256_DIGEST_LEN) - segment_data = segment_data[0:patch_offset] + self.elf_sha256 + \ - segment_data[patch_offset + self.SHA256_DIGEST_LEN:] - return segment_data - - def save_segment(self, f, segment, checksum=None): - """ Save the next segment to the image file, return next checksum value if provided """ - segment_data = self.maybe_patch_segment_data(f, segment.data) - f.write(struct.pack(' 0: - if len(irom_segments) != 1: - raise FatalError('Found %d segments that could be irom0. Bad ELF file?' % len(irom_segments)) - return irom_segments[0] - return None - - def get_non_irom_segments(self): - irom_segment = self.get_irom_segment() - return [s for s in self.segments if s != irom_segment] - - def merge_adjacent_segments(self): - if not self.segments: - return # nothing to merge - - segments = [] - # The easiest way to merge the sections is the browse them backward. - for i in range(len(self.segments) - 1, 0, -1): - # elem is the previous section, the one `next_elem` may need to be - # merged in - elem = self.segments[i - 1] - next_elem = self.segments[i] - if all((elem.get_memory_type(self) == next_elem.get_memory_type(self), - elem.include_in_checksum == next_elem.include_in_checksum, - next_elem.addr == elem.addr + len(elem.data))): - # Merge any segment that ends where the next one starts, without spanning memory types - # - # (don't 'pad' any gaps here as they may be excluded from the image due to 'noinit' - # or other reasons.) - elem.data += next_elem.data - else: - # The section next_elem cannot be merged into the previous one, - # which means it needs to be part of the final segments. - # As we are browsing the list backward, the elements need to be - # inserted at the beginning of the final list. - segments.insert(0, next_elem) - - # The first segment will always be here as it cannot be merged into any - # "previous" section. - segments.insert(0, self.segments[0]) - - # note: we could sort segments here as well, but the ordering of segments is sometimes - # important for other reasons (like embedded ELF SHA-256), so we assume that the linker - # script will have produced any adjacent sections in linear order in the ELF, anyhow. - self.segments = segments - - def set_mmu_page_size(self, size): - """ If supported, this should be overridden by the chip-specific class. Gets called in elf2image. """ - print('WARNING: Changing MMU page size is not supported on {}! Defaulting to 64KB.'.format(self.ROM_LOADER.CHIP_NAME)) - - -class ESP8266ROMFirmwareImage(BaseFirmwareImage): - """ 'Version 1' firmware image, segments loaded directly by the ROM bootloader. """ - - ROM_LOADER = ESP8266ROM - - def __init__(self, load_file=None): - super(ESP8266ROMFirmwareImage, self).__init__() - self.flash_mode = 0 - self.flash_size_freq = 0 - self.version = 1 - - if load_file is not None: - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - - for _ in range(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - self.verify() - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - return input_file + '-' - - def save(self, basename): - """ Save a set of V1 images for flashing. Parameter is a base filename. """ - # IROM data goes in its own plain binary file - irom_segment = self.get_irom_segment() - if irom_segment is not None: - with open("%s0x%05x.bin" % (basename, irom_segment.addr - ESP8266ROM.IROM_MAP_START), "wb") as f: - f.write(irom_segment.data) - - # everything but IROM goes at 0x00000 in an image file - normal_segments = self.get_non_irom_segments() - with open("%s0x00000.bin" % basename, 'wb') as f: - self.write_common_header(f, normal_segments) - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - for segment in normal_segments: - checksum = self.save_segment(f, segment, checksum) - self.append_checksum(f, checksum) - - -ESP8266ROM.BOOTLOADER_IMAGE = ESP8266ROMFirmwareImage - - -class ESP8266V2FirmwareImage(BaseFirmwareImage): - """ 'Version 2' firmware image, segments loaded by software bootloader stub - (ie Espressif bootloader or rboot) - """ - - ROM_LOADER = ESP8266ROM - - def __init__(self, load_file=None): - super(ESP8266V2FirmwareImage, self).__init__() - self.version = 2 - if load_file is not None: - segments = self.load_common_header(load_file, ESPBOOTLOADER.IMAGE_V2_MAGIC) - if segments != ESPBOOTLOADER.IMAGE_V2_SEGMENT: - # segment count is not really segment count here, but we expect to see '4' - print('Warning: V2 header has unexpected "segment" count %d (usually 4)' % segments) - - # irom segment comes before the second header - # - # the file is saved in the image with a zero load address - # in the header, so we need to calculate a load address - irom_segment = self.load_segment(load_file, True) - irom_segment.addr = 0 # for actual mapped addr, add ESP8266ROM.IROM_MAP_START + flashing_addr + 8 - irom_segment.include_in_checksum = False - - first_flash_mode = self.flash_mode - first_flash_size_freq = self.flash_size_freq - first_entrypoint = self.entrypoint - # load the second header - - segments = self.load_common_header(load_file, ESPLoader.ESP_IMAGE_MAGIC) - - if first_flash_mode != self.flash_mode: - print('WARNING: Flash mode value in first header (0x%02x) disagrees with second (0x%02x). Using second value.' - % (first_flash_mode, self.flash_mode)) - if first_flash_size_freq != self.flash_size_freq: - print('WARNING: Flash size/freq value in first header (0x%02x) disagrees with second (0x%02x). Using second value.' - % (first_flash_size_freq, self.flash_size_freq)) - if first_entrypoint != self.entrypoint: - print('WARNING: Entrypoint address in first header (0x%08x) disagrees with second header (0x%08x). Using second value.' - % (first_entrypoint, self.entrypoint)) - - # load all the usual segments - for _ in range(segments): - self.load_segment(load_file) - self.checksum = self.read_checksum(load_file) - - self.verify() - - def default_output_name(self, input_file): - """ Derive a default output name from the ELF name. """ - irom_segment = self.get_irom_segment() - if irom_segment is not None: - irom_offs = irom_segment.addr - ESP8266ROM.IROM_MAP_START - else: - irom_offs = 0 - return "%s-0x%05x.bin" % (os.path.splitext(input_file)[0], - irom_offs & ~(ESPLoader.FLASH_SECTOR_SIZE - 1)) - - def save(self, filename): - with open(filename, 'wb') as f: - # Save first header for irom0 segment - f.write(struct.pack(b' 0: - last_addr = flash_segments[0].addr - for segment in flash_segments[1:]: - if segment.addr // self.IROM_ALIGN == last_addr // self.IROM_ALIGN: - raise FatalError(("Segment loaded at 0x%08x lands in same 64KB flash mapping as segment loaded at 0x%08x. " - "Can't generate binary. Suggest changing linker script or ELF to merge sections.") % - (segment.addr, last_addr)) - last_addr = segment.addr - - def get_alignment_data_needed(segment): - # Actual alignment (in data bytes) required for a segment header: positioned so that - # after we write the next 8 byte header, file_offs % IROM_ALIGN == segment.addr % IROM_ALIGN - # - # (this is because the segment's vaddr may not be IROM_ALIGNed, more likely is aligned - # IROM_ALIGN+0x18 to account for the binary file header - align_past = (segment.addr % self.IROM_ALIGN) - self.SEG_HEADER_LEN - pad_len = (self.IROM_ALIGN - (f.tell() % self.IROM_ALIGN)) + align_past - if pad_len == 0 or pad_len == self.IROM_ALIGN: - return 0 # already aligned - - # subtract SEG_HEADER_LEN a second time, as the padding block has a header as well - pad_len -= self.SEG_HEADER_LEN - if pad_len < 0: - pad_len += self.IROM_ALIGN - return pad_len - - # try to fit each flash segment on a 64kB aligned boundary - # by padding with parts of the non-flash segments... - while len(flash_segments) > 0: - segment = flash_segments[0] - pad_len = get_alignment_data_needed(segment) - if pad_len > 0: # need to pad - if len(ram_segments) > 0 and pad_len > self.SEG_HEADER_LEN: - pad_segment = ram_segments[0].split_image(pad_len) - if len(ram_segments[0].data) == 0: - ram_segments.pop(0) - else: - pad_segment = ImageSegment(0, b'\x00' * pad_len, f.tell()) - checksum = self.save_segment(f, pad_segment, checksum) - total_segments += 1 - else: - # write the flash segment - assert (f.tell() + 8) % self.IROM_ALIGN == segment.addr % self.IROM_ALIGN - checksum = self.save_flash_segment(f, segment, checksum) - flash_segments.pop(0) - total_segments += 1 - - # flash segments all written, so write any remaining RAM segments - for segment in ram_segments: - checksum = self.save_segment(f, segment, checksum) - total_segments += 1 - - if self.secure_pad: - # pad the image so that after signing it will end on a a 64KB boundary. - # This ensures all mapped flash content will be verified. - if not self.append_digest: - raise FatalError("secure_pad only applies if a SHA-256 digest is also appended to the image") - align_past = (f.tell() + self.SEG_HEADER_LEN) % self.IROM_ALIGN - # 16 byte aligned checksum (force the alignment to simplify calculations) - checksum_space = 16 - if self.secure_pad == '1': - # after checksum: SHA-256 digest + (to be added by signing process) version, signature + 12 trailing bytes due to alignment - space_after_checksum = 32 + 4 + 64 + 12 - elif self.secure_pad == '2': # Secure Boot V2 - # after checksum: SHA-256 digest + signature sector, but we place signature sector after the 64KB boundary - space_after_checksum = 32 - pad_len = (self.IROM_ALIGN - align_past - checksum_space - space_after_checksum) % self.IROM_ALIGN - pad_segment = ImageSegment(0, b'\x00' * pad_len, f.tell()) - - checksum = self.save_segment(f, pad_segment, checksum) - total_segments += 1 - - # done writing segments - self.append_checksum(f, checksum) - image_length = f.tell() - - if self.secure_pad: - assert ((image_length + space_after_checksum) % self.IROM_ALIGN) == 0 - - # kinda hacky: go back to the initial header and write the new segment count - # that includes padding segments. This header is not checksummed - f.seek(1) - try: - f.write(chr(total_segments)) - except TypeError: # Python 3 - f.write(bytes([total_segments])) - - if self.append_digest: - # calculate the SHA256 of the whole file and append it - f.seek(0) - digest = hashlib.sha256() - digest.update(f.read(image_length)) - f.write(digest.digest()) - - with open(filename, 'wb') as real_file: - real_file.write(f.getvalue()) - - def save_flash_segment(self, f, segment, checksum=None): - """ Save the next segment to the image file, return next checksum value if provided """ - segment_end_pos = f.tell() + len(segment.data) + self.SEG_HEADER_LEN - segment_len_remainder = segment_end_pos % self.IROM_ALIGN - if segment_len_remainder < 0x24: - # Work around a bug in ESP-IDF 2nd stage bootloader, that it didn't map the - # last MMU page, if an IROM/DROM segment was < 0x24 bytes over the page boundary. - segment.data += b'\x00' * (0x24 - segment_len_remainder) - return self.save_segment(f, segment, checksum) - - def load_extended_header(self, load_file): - def split_byte(n): - return (n & 0x0F, (n >> 4) & 0x0F) - - fields = list(struct.unpack(self.EXTENDED_HEADER_STRUCT_FMT, load_file.read(16))) - - self.wp_pin = fields[0] - - # SPI pin drive stengths are two per byte - self.clk_drv, self.q_drv = split_byte(fields[1]) - self.d_drv, self.cs_drv = split_byte(fields[2]) - self.hd_drv, self.wp_drv = split_byte(fields[3]) - - chip_id = fields[4] - if chip_id != self.ROM_LOADER.IMAGE_CHIP_ID: - print(("Unexpected chip id in image. Expected %d but value was %d. " - "Is this image for a different chip model?") % (self.ROM_LOADER.IMAGE_CHIP_ID, chip_id)) - - # reserved fields in the middle should all be zero - if any(f for f in fields[6:-1] if f != 0): - print("Warning: some reserved header fields have non-zero values. This image may be from a newer esptool.py?") - - append_digest = fields[-1] # last byte is append_digest - if append_digest in [0, 1]: - self.append_digest = (append_digest == 1) - else: - raise RuntimeError("Invalid value for append_digest field (0x%02x). Should be 0 or 1.", append_digest) - - def save_extended_header(self, save_file): - def join_byte(ln, hn): - return (ln & 0x0F) + ((hn & 0x0F) << 4) - - append_digest = 1 if self.append_digest else 0 - - fields = [self.wp_pin, - join_byte(self.clk_drv, self.q_drv), - join_byte(self.d_drv, self.cs_drv), - join_byte(self.hd_drv, self.wp_drv), - self.ROM_LOADER.IMAGE_CHIP_ID, - self.min_rev] - fields += [0] * 8 # padding - fields += [append_digest] - - packed = struct.pack(self.EXTENDED_HEADER_STRUCT_FMT, *fields) - save_file.write(packed) - - -class ESP8266V3FirmwareImage(ESP32FirmwareImage): - """ ESP8266 V3 firmware image is very similar to ESP32 image - """ - - EXTENDED_HEADER_STRUCT_FMT = "B" * 16 - - def is_flash_addr(self, addr): - return (addr > ESP8266ROM.IROM_MAP_START) - - def save(self, filename): - total_segments = 0 - with io.BytesIO() as f: # write file to memory first - self.write_common_header(f, self.segments) - - checksum = ESPLoader.ESP_CHECKSUM_MAGIC - - # split segments into flash-mapped vs ram-loaded, and take copies so we can mutate them - flash_segments = [copy.deepcopy(s) for s in sorted(self.segments, key=lambda s:s.addr) if self.is_flash_addr(s.addr) and len(s.data)] - ram_segments = [copy.deepcopy(s) for s in sorted(self.segments, key=lambda s:s.addr) if not self.is_flash_addr(s.addr) and len(s.data)] - - # check for multiple ELF sections that are mapped in the same flash mapping region. - # this is usually a sign of a broken linker script, but if you have a legitimate - # use case then let us know - if len(flash_segments) > 0: - last_addr = flash_segments[0].addr - for segment in flash_segments[1:]: - if segment.addr // self.IROM_ALIGN == last_addr // self.IROM_ALIGN: - raise FatalError(("Segment loaded at 0x%08x lands in same 64KB flash mapping as segment loaded at 0x%08x. " - "Can't generate binary. Suggest changing linker script or ELF to merge sections.") % - (segment.addr, last_addr)) - last_addr = segment.addr - - # try to fit each flash segment on a 64kB aligned boundary - # by padding with parts of the non-flash segments... - while len(flash_segments) > 0: - segment = flash_segments[0] - # remove 8 bytes empty data for insert segment header - if segment.name == '.flash.rodata': - segment.data = segment.data[8:] - # write the flash segment - checksum = self.save_segment(f, segment, checksum) - flash_segments.pop(0) - total_segments += 1 - - # flash segments all written, so write any remaining RAM segments - for segment in ram_segments: - checksum = self.save_segment(f, segment, checksum) - total_segments += 1 - - # done writing segments - self.append_checksum(f, checksum) - image_length = f.tell() - - # kinda hacky: go back to the initial header and write the new segment count - # that includes padding segments. This header is not checksummed - f.seek(1) - try: - f.write(chr(total_segments)) - except TypeError: # Python 3 - f.write(bytes([total_segments])) - - if self.append_digest: - # calculate the SHA256 of the whole file and append it - f.seek(0) - digest = hashlib.sha256() - digest.update(f.read(image_length)) - f.write(digest.digest()) - - with open(filename, 'wb') as real_file: - real_file.write(f.getvalue()) - - def load_extended_header(self, load_file): - def split_byte(n): - return (n & 0x0F, (n >> 4) & 0x0F) - - fields = list(struct.unpack(self.EXTENDED_HEADER_STRUCT_FMT, load_file.read(16))) - - self.wp_pin = fields[0] - - # SPI pin drive stengths are two per byte - self.clk_drv, self.q_drv = split_byte(fields[1]) - self.d_drv, self.cs_drv = split_byte(fields[2]) - self.hd_drv, self.wp_drv = split_byte(fields[3]) - - if fields[15] in [0, 1]: - self.append_digest = (fields[15] == 1) - else: - raise RuntimeError("Invalid value for append_digest field (0x%02x). Should be 0 or 1.", fields[15]) - - # remaining fields in the middle should all be zero - if any(f for f in fields[4:15] if f != 0): - print("Warning: some reserved header fields have non-zero values. This image may be from a newer esptool.py?") - - -ESP32ROM.BOOTLOADER_IMAGE = ESP32FirmwareImage - - -class ESP32S2FirmwareImage(ESP32FirmwareImage): - """ ESP32S2 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32S2ROM - - -ESP32S2ROM.BOOTLOADER_IMAGE = ESP32S2FirmwareImage - - -class ESP32S3BETA2FirmwareImage(ESP32FirmwareImage): - """ ESP32S3 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32S3BETA2ROM - - -ESP32S3BETA2ROM.BOOTLOADER_IMAGE = ESP32S3BETA2FirmwareImage - - -class ESP32S3FirmwareImage(ESP32FirmwareImage): - """ ESP32S3 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32S3ROM - - -ESP32S3ROM.BOOTLOADER_IMAGE = ESP32S3FirmwareImage - - -class ESP32C3FirmwareImage(ESP32FirmwareImage): - """ ESP32C3 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32C3ROM - - -ESP32C3ROM.BOOTLOADER_IMAGE = ESP32C3FirmwareImage - - -class ESP32C6BETAFirmwareImage(ESP32FirmwareImage): - """ ESP32C6 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32C6BETAROM - - -ESP32C6BETAROM.BOOTLOADER_IMAGE = ESP32C6BETAFirmwareImage - - -class ESP32H2BETA1FirmwareImage(ESP32FirmwareImage): - """ ESP32H2 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32H2BETA1ROM - - -ESP32H2BETA1ROM.BOOTLOADER_IMAGE = ESP32H2BETA1FirmwareImage - - -class ESP32H2BETA2FirmwareImage(ESP32FirmwareImage): - """ ESP32H2 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32H2BETA2ROM - - -ESP32H2BETA2ROM.BOOTLOADER_IMAGE = ESP32H2BETA2FirmwareImage - - -class ESP32C2FirmwareImage(ESP32FirmwareImage): - """ ESP32C2 Firmware Image almost exactly the same as ESP32FirmwareImage """ - ROM_LOADER = ESP32C2ROM - - def set_mmu_page_size(self, size): - if size not in [16384, 32768, 65536]: - raise FatalError("{} is not a valid page size.".format(size)) - self.IROM_ALIGN = size - - -ESP32C2ROM.BOOTLOADER_IMAGE = ESP32C2FirmwareImage - - -class ELFFile(object): - SEC_TYPE_PROGBITS = 0x01 - SEC_TYPE_STRTAB = 0x03 - SEC_TYPE_INITARRAY = 0x0e - SEC_TYPE_FINIARRAY = 0x0f - - PROG_SEC_TYPES = (SEC_TYPE_PROGBITS, SEC_TYPE_INITARRAY, SEC_TYPE_FINIARRAY) - - LEN_SEC_HEADER = 0x28 - - SEG_TYPE_LOAD = 0x01 - LEN_SEG_HEADER = 0x20 - - def __init__(self, name): - # Load sections from the ELF file - self.name = name - with open(self.name, 'rb') as f: - self._read_elf_file(f) - - def get_section(self, section_name): - for s in self.sections: - if s.name == section_name: - return s - raise ValueError("No section %s in ELF file" % section_name) - - def _read_elf_file(self, f): - # read the ELF file header - LEN_FILE_HEADER = 0x34 - try: - (ident, _type, machine, _version, - self.entrypoint, _phoff, shoff, _flags, - _ehsize, _phentsize, _phnum, shentsize, - shnum, shstrndx) = struct.unpack("<16sHHLLLLLHHHHHH", f.read(LEN_FILE_HEADER)) - except struct.error as e: - raise FatalError("Failed to read a valid ELF header from %s: %s" % (self.name, e)) - - if byte(ident, 0) != 0x7f or ident[1:4] != b'ELF': - raise FatalError("%s has invalid ELF magic header" % self.name) - if machine not in [0x5e, 0xf3]: - raise FatalError("%s does not appear to be an Xtensa or an RISCV ELF file. e_machine=%04x" % (self.name, machine)) - if shentsize != self.LEN_SEC_HEADER: - raise FatalError("%s has unexpected section header entry size 0x%x (not 0x%x)" % (self.name, shentsize, self.LEN_SEC_HEADER)) - if shnum == 0: - raise FatalError("%s has 0 section headers" % (self.name)) - self._read_sections(f, shoff, shnum, shstrndx) - self._read_segments(f, _phoff, _phnum, shstrndx) - - def _read_sections(self, f, section_header_offs, section_header_count, shstrndx): - f.seek(section_header_offs) - len_bytes = section_header_count * self.LEN_SEC_HEADER - section_header = f.read(len_bytes) - if len(section_header) == 0: - raise FatalError("No section header found at offset %04x in ELF file." % section_header_offs) - if len(section_header) != (len_bytes): - raise FatalError("Only read 0x%x bytes from section header (expected 0x%x.) Truncated ELF file?" % (len(section_header), len_bytes)) - - # walk through the section header and extract all sections - section_header_offsets = range(0, len(section_header), self.LEN_SEC_HEADER) - - def read_section_header(offs): - name_offs, sec_type, _flags, lma, sec_offs, size = struct.unpack_from(" 0] - self.sections = prog_sections - - def _read_segments(self, f, segment_header_offs, segment_header_count, shstrndx): - f.seek(segment_header_offs) - len_bytes = segment_header_count * self.LEN_SEG_HEADER - segment_header = f.read(len_bytes) - if len(segment_header) == 0: - raise FatalError("No segment header found at offset %04x in ELF file." % segment_header_offs) - if len(segment_header) != (len_bytes): - raise FatalError("Only read 0x%x bytes from segment header (expected 0x%x.) Truncated ELF file?" % (len(segment_header), len_bytes)) - - # walk through the segment header and extract all segments - segment_header_offsets = range(0, len(segment_header), self.LEN_SEG_HEADER) - - def read_segment_header(offs): - seg_type, seg_offs, _vaddr, lma, size, _memsize, _flags, _align = struct.unpack_from(" 0] - self.segments = prog_segments - - def sha256(self): - # return SHA256 hash of the input ELF file - sha256 = hashlib.sha256() - with open(self.name, 'rb') as f: - sha256.update(f.read()) - return sha256.digest() - - -def slip_reader(port, trace_function): - """Generator to read SLIP packets from a serial port. - Yields one full SLIP packet at a time, raises exception on timeout or invalid data. - - Designed to avoid too many calls to serial.read(1), which can bog - down on slow systems. - """ - partial_packet = None - in_escape = False - successful_slip = False - while True: - waiting = port.inWaiting() - read_bytes = port.read(1 if waiting == 0 else waiting) - if read_bytes == b'': - if partial_packet is None: # fail due to no data - msg = "Serial data stream stopped: Possible serial noise or corruption." if successful_slip else "No serial data received." - else: # fail during packet transfer - msg = "Packet content transfer stopped (received {} bytes)".format(len(partial_packet)) - trace_function(msg) - raise FatalError(msg) - trace_function("Read %d bytes: %s", len(read_bytes), HexFormatter(read_bytes)) - for b in read_bytes: - if type(b) is int: - b = bytes([b]) # python 2/3 compat - - if partial_packet is None: # waiting for packet header - if b == b'\xc0': - partial_packet = b"" - else: - trace_function("Read invalid data: %s", HexFormatter(read_bytes)) - trace_function("Remaining data in serial buffer: %s", HexFormatter(port.read(port.inWaiting()))) - raise FatalError('Invalid head of packet (0x%s): Possible serial noise or corruption.' % hexify(b)) - elif in_escape: # part-way through escape sequence - in_escape = False - if b == b'\xdc': - partial_packet += b'\xc0' - elif b == b'\xdd': - partial_packet += b'\xdb' - else: - trace_function("Read invalid data: %s", HexFormatter(read_bytes)) - trace_function("Remaining data in serial buffer: %s", HexFormatter(port.read(port.inWaiting()))) - raise FatalError('Invalid SLIP escape (0xdb, 0x%s)' % (hexify(b))) - elif b == b'\xdb': # start of escape sequence - in_escape = True - elif b == b'\xc0': # end of packet - trace_function("Received full packet: %s", HexFormatter(partial_packet)) - yield partial_packet - partial_packet = None - successful_slip = True - else: # normal byte in packet - partial_packet += b - - -def arg_auto_int(x): - return int(x, 0) - - -def format_chip_name(c): - """ Normalize chip name from user input """ - c = c.lower().replace('-', '') - if c == 'esp8684': # TODO: Delete alias, ESPTOOL-389 - print('WARNING: Chip name ESP8684 is deprecated in favor of ESP32-C2 and will be removed in a future release. Using ESP32-C2 instead.') - return 'esp32c2' - return c - - -def div_roundup(a, b): - """ Return a/b rounded up to nearest integer, - equivalent result to int(math.ceil(float(int(a)) / float(int(b))), only - without possible floating point accuracy errors. - """ - return (int(a) + int(b) - 1) // int(b) - - -def align_file_position(f, size): - """ Align the position in the file to the next block of specified size """ - align = (size - 1) - (f.tell() % size) - f.seek(align, 1) - - -def flash_size_bytes(size): - """ Given a flash size of the type passed in args.flash_size - (ie 512KB or 1MB) then return the size in bytes. - """ - if "MB" in size: - return int(size[:size.index("MB")]) * 1024 * 1024 - elif "KB" in size: - return int(size[:size.index("KB")]) * 1024 - else: - raise FatalError("Unknown size %s" % size) - - -def hexify(s, uppercase=True): - format_str = '%02X' if uppercase else '%02x' - if not PYTHON2: - return ''.join(format_str % c for c in s) - else: - return ''.join(format_str % ord(c) for c in s) - - -class HexFormatter(object): - """ - Wrapper class which takes binary data in its constructor - and returns a hex string as it's __str__ method. - - This is intended for "lazy formatting" of trace() output - in hex format. Avoids overhead (significant on slow computers) - of generating long hex strings even if tracing is disabled. - - Note that this doesn't save any overhead if passed as an - argument to "%", only when passed to trace() - - If auto_split is set (default), any long line (> 16 bytes) will be - printed as separately indented lines, with ASCII decoding at the end - of each line. - """ - def __init__(self, binary_string, auto_split=True): - self._s = binary_string - self._auto_split = auto_split - - def __str__(self): - if self._auto_split and len(self._s) > 16: - result = "" - s = self._s - while len(s) > 0: - line = s[:16] - ascii_line = "".join(c if (c == ' ' or (c in string.printable and c not in string.whitespace)) - else '.' for c in line.decode('ascii', 'replace')) - s = s[16:] - result += "\n %-16s %-16s | %s" % (hexify(line[:8], False), hexify(line[8:], False), ascii_line) - return result - else: - return hexify(self._s, False) - - -def pad_to(data, alignment, pad_character=b'\xFF'): - """ Pad to the next alignment boundary """ - pad_mod = len(data) % alignment - if pad_mod != 0: - data += pad_character * (alignment - pad_mod) - return data - - -class FatalError(RuntimeError): - """ - Wrapper class for runtime errors that aren't caused by internal bugs, but by - ESP ROM responses or input content. - """ - def __init__(self, message): - RuntimeError.__init__(self, message) - - @staticmethod - def WithResult(message, result): - """ - Return a fatal error object that appends the hex values of - 'result' and its meaning as a string formatted argument. - """ - - err_defs = { - 0x101: 'Out of memory', - 0x102: 'Invalid argument', - 0x103: 'Invalid state', - 0x104: 'Invalid size', - 0x105: 'Requested resource not found', - 0x106: 'Operation or feature not supported', - 0x107: 'Operation timed out', - 0x108: 'Received response was invalid', - 0x109: 'CRC or checksum was invalid', - 0x10A: 'Version was invalid', - 0x10B: 'MAC address was invalid', - } - - err_code = struct.unpack(">H", result[:2]) - message += " (result was {}: {})".format(hexify(result), err_defs.get(err_code[0], 'Unknown result')) - return FatalError(message) - - -class NotImplementedInROMError(FatalError): - """ - Wrapper class for the error thrown when a particular ESP bootloader function - is not implemented in the ROM bootloader. - """ - def __init__(self, bootloader, func): - FatalError.__init__(self, "%s ROM does not support function %s." % (bootloader.CHIP_NAME, func.__name__)) - - -class NotSupportedError(FatalError): - def __init__(self, esp, function_name): - FatalError.__init__(self, "Function %s is not supported for %s." % (function_name, esp.CHIP_NAME)) - -# "Operation" commands, executable at command line. One function each -# -# Each function takes either two args (, ) or a single -# argument. - - -class UnsupportedCommandError(RuntimeError): - """ - Wrapper class for when ROM loader returns an invalid command response. - - Usually this indicates the loader is running in Secure Download Mode. - """ - def __init__(self, esp, op): - if esp.secure_download_mode: - msg = "This command (0x%x) is not supported in Secure Download Mode" % op - else: - msg = "Invalid (unsupported) command 0x%x" % op - RuntimeError.__init__(self, msg) - - -def load_ram(esp, args): - image = LoadFirmwareImage(esp.CHIP_NAME, args.filename) - - print('RAM boot...') - for seg in image.segments: - size = len(seg.data) - print('Downloading %d bytes at %08x...' % (size, seg.addr), end=' ') - sys.stdout.flush() - esp.mem_begin(size, div_roundup(size, esp.ESP_RAM_BLOCK), esp.ESP_RAM_BLOCK, seg.addr) - - seq = 0 - while len(seg.data) > 0: - esp.mem_block(seg.data[0:esp.ESP_RAM_BLOCK], seq) - seg.data = seg.data[esp.ESP_RAM_BLOCK:] - seq += 1 - print('done!') - - print('All segments done, executing at %08x' % image.entrypoint) - esp.mem_finish(image.entrypoint) - - -def read_mem(esp, args): - print('0x%08x = 0x%08x' % (args.address, esp.read_reg(args.address))) - - -def write_mem(esp, args): - esp.write_reg(args.address, args.value, args.mask, 0) - print('Wrote %08x, mask %08x to %08x' % (args.value, args.mask, args.address)) - - -def dump_mem(esp, args): - with open(args.filename, 'wb') as f: - for i in range(args.size // 4): - d = esp.read_reg(args.address + (i * 4)) - f.write(struct.pack(b'> 16 - args.flash_size = DETECTED_FLASH_SIZES.get(size_id) - if args.flash_size is None: - print('Warning: Could not auto-detect Flash size (FlashID=0x%x, SizeID=0x%x), defaulting to 4MB' % (flash_id, size_id)) - args.flash_size = '4MB' - else: - print('Auto-detected Flash size:', args.flash_size) - - -def _update_image_flash_params(esp, address, args, image): - """ Modify the flash mode & size bytes if this looks like an executable bootloader image """ - if len(image) < 8: - return image # not long enough to be a bootloader image - - # unpack the (potential) image header - magic, _, flash_mode, flash_size_freq = struct.unpack("BBBB", image[:4]) - if address != esp.BOOTLOADER_FLASH_OFFSET: - return image # not flashing bootloader offset, so don't modify this - - if (args.flash_mode, args.flash_freq, args.flash_size) == ('keep',) * 3: - return image # all settings are 'keep', not modifying anything - - # easy check if this is an image: does it start with a magic byte? - if magic != esp.ESP_IMAGE_MAGIC: - print("Warning: Image file at 0x%x doesn't look like an image file, so not changing any flash settings." % address) - return image - - # make sure this really is an image, and not just data that - # starts with esp.ESP_IMAGE_MAGIC (mostly a problem for encrypted - # images that happen to start with a magic byte - try: - test_image = esp.BOOTLOADER_IMAGE(io.BytesIO(image)) - test_image.verify() - except Exception: - print("Warning: Image file at 0x%x is not a valid %s image, so not changing any flash settings." % (address, esp.CHIP_NAME)) - return image - - if args.flash_mode != 'keep': - flash_mode = {'qio': 0, 'qout': 1, 'dio': 2, 'dout': 3}[args.flash_mode] - - flash_freq = flash_size_freq & 0x0F - if args.flash_freq != 'keep': - flash_freq = esp.parse_flash_freq_arg(args.flash_freq) - - flash_size = flash_size_freq & 0xF0 - if args.flash_size != 'keep': - flash_size = esp.parse_flash_size_arg(args.flash_size) - - flash_params = struct.pack(b'BB', flash_mode, flash_size + flash_freq) - if flash_params != image[2:4]: - print('Flash params set to 0x%04x' % struct.unpack(">H", flash_params)) - image = image[0:2] + flash_params + image[4:] - return image - - -def write_flash(esp, args): - # set args.compress based on default behaviour: - # -> if either --compress or --no-compress is set, honour that - # -> otherwise, set --compress unless --no-stub is set - if args.compress is None and not args.no_compress: - args.compress = not args.no_stub - - # In case we have encrypted files to write, we first do few sanity checks before actual flash - if args.encrypt or args.encrypt_files is not None: - do_write = True - - if not esp.secure_download_mode: - if esp.get_encrypted_download_disabled(): - raise FatalError("This chip has encrypt functionality in UART download mode disabled. " - "This is the Flash Encryption configuration for Production mode instead of Development mode.") - - crypt_cfg_efuse = esp.get_flash_crypt_config() - - if crypt_cfg_efuse is not None and crypt_cfg_efuse != 0xF: - print('Unexpected FLASH_CRYPT_CONFIG value: 0x%x' % (crypt_cfg_efuse)) - do_write = False - - enc_key_valid = esp.is_flash_encryption_key_valid() - - if not enc_key_valid: - print('Flash encryption key is not programmed') - do_write = False - - # Determine which files list contain the ones to encrypt - files_to_encrypt = args.addr_filename if args.encrypt else args.encrypt_files - - for address, argfile in files_to_encrypt: - if address % esp.FLASH_ENCRYPTED_WRITE_ALIGN: - print("File %s address 0x%x is not %d byte aligned, can't flash encrypted" % - (argfile.name, address, esp.FLASH_ENCRYPTED_WRITE_ALIGN)) - do_write = False - - if not do_write and not args.ignore_flash_encryption_efuse_setting: - raise FatalError("Can't perform encrypted flash write, consult Flash Encryption documentation for more information") - - # verify file sizes fit in flash - if args.flash_size != 'keep': # TODO: check this even with 'keep' - flash_end = flash_size_bytes(args.flash_size) - for address, argfile in args.addr_filename: - argfile.seek(0, os.SEEK_END) - if address + argfile.tell() > flash_end: - raise FatalError(("File %s (length %d) at offset %d will not fit in %d bytes of flash. " - "Use --flash_size argument, or change flashing address.") - % (argfile.name, argfile.tell(), address, flash_end)) - argfile.seek(0) - - if args.erase_all: - erase_flash(esp, args) - else: - for address, argfile in args.addr_filename: - argfile.seek(0, os.SEEK_END) - write_end = address + argfile.tell() - argfile.seek(0) - bytes_over = address % esp.FLASH_SECTOR_SIZE - if bytes_over != 0: - print("WARNING: Flash address {:#010x} is not aligned to a {:#x} byte flash sector. " - "{:#x} bytes before this address will be erased." - .format(address, esp.FLASH_SECTOR_SIZE, bytes_over)) - # Print the address range of to-be-erased flash memory region - print("Flash will be erased from {:#010x} to {:#010x}..." - .format(address - bytes_over, div_roundup(write_end, esp.FLASH_SECTOR_SIZE) * esp.FLASH_SECTOR_SIZE - 1)) - - """ Create a list describing all the files we have to flash. Each entry holds an "encrypt" flag - marking whether the file needs encryption or not. This list needs to be sorted. - - First, append to each entry of our addr_filename list the flag args.encrypt - For example, if addr_filename is [(0x1000, "partition.bin"), (0x8000, "bootloader")], - all_files will be [(0x1000, "partition.bin", args.encrypt), (0x8000, "bootloader", args.encrypt)], - where, of course, args.encrypt is either True or False - """ - all_files = [(offs, filename, args.encrypt) for (offs, filename) in args.addr_filename] - - """Now do the same with encrypt_files list, if defined. - In this case, the flag is True - """ - if args.encrypt_files is not None: - encrypted_files_flag = [(offs, filename, True) for (offs, filename) in args.encrypt_files] - - # Concatenate both lists and sort them. - # As both list are already sorted, we could simply do a merge instead, - # but for the sake of simplicity and because the lists are very small, - # let's use sorted. - all_files = sorted(all_files + encrypted_files_flag, key=lambda x: x[0]) - - for address, argfile, encrypted in all_files: - compress = args.compress - - # Check whether we can compress the current file before flashing - if compress and encrypted: - print('\nWARNING: - compress and encrypt options are mutually exclusive ') - print('Will flash %s uncompressed' % argfile.name) - compress = False - - if args.no_stub: - print('Erasing flash...') - image = pad_to(argfile.read(), esp.FLASH_ENCRYPTED_WRITE_ALIGN if encrypted else 4) - if len(image) == 0: - print('WARNING: File %s is empty' % argfile.name) - continue - image = _update_image_flash_params(esp, address, args, image) - calcmd5 = hashlib.md5(image).hexdigest() - uncsize = len(image) - if compress: - uncimage = image - image = zlib.compress(uncimage, 9) - # Decompress the compressed binary a block at a time, to dynamically calculate the - # timeout based on the real write size - decompress = zlib.decompressobj() - blocks = esp.flash_defl_begin(uncsize, len(image), address) - else: - blocks = esp.flash_begin(uncsize, address, begin_rom_encrypted=encrypted) - argfile.seek(0) # in case we need it again - seq = 0 - bytes_sent = 0 # bytes sent on wire - bytes_written = 0 # bytes written to flash - t = time.time() - - timeout = DEFAULT_TIMEOUT - - while len(image) > 0: - print_overwrite('Writing at 0x%08x... (%d %%)' % (address + bytes_written, 100 * (seq + 1) // blocks)) - sys.stdout.flush() - block = image[0:esp.FLASH_WRITE_SIZE] - if compress: - # feeding each compressed block into the decompressor lets us see block-by-block how much will be written - block_uncompressed = len(decompress.decompress(block)) - bytes_written += block_uncompressed - block_timeout = max(DEFAULT_TIMEOUT, timeout_per_mb(ERASE_WRITE_TIMEOUT_PER_MB, block_uncompressed)) - if not esp.IS_STUB: - timeout = block_timeout # ROM code writes block to flash before ACKing - esp.flash_defl_block(block, seq, timeout=timeout) - if esp.IS_STUB: - timeout = block_timeout # Stub ACKs when block is received, then writes to flash while receiving the block after it - else: - # Pad the last block - block = block + b'\xff' * (esp.FLASH_WRITE_SIZE - len(block)) - if encrypted: - esp.flash_encrypt_block(block, seq) - else: - esp.flash_block(block, seq) - bytes_written += len(block) - bytes_sent += len(block) - image = image[esp.FLASH_WRITE_SIZE:] - seq += 1 - - if esp.IS_STUB: - # Stub only writes each block to flash after 'ack'ing the receive, so do a final dummy operation which will - # not be 'ack'ed until the last block has actually been written out to flash - esp.read_reg(ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR, timeout=timeout) - - t = time.time() - t - speed_msg = "" - if compress: - if t > 0.0: - speed_msg = " (effective %.1f kbit/s)" % (uncsize / t * 8 / 1000) - print_overwrite('Wrote %d bytes (%d compressed) at 0x%08x in %.1f seconds%s...' % (uncsize, - bytes_sent, - address, t, speed_msg), last_line=True) - else: - if t > 0.0: - speed_msg = " (%.1f kbit/s)" % (bytes_written / t * 8 / 1000) - print_overwrite('Wrote %d bytes at 0x%08x in %.1f seconds%s...' % (bytes_written, address, t, speed_msg), last_line=True) - - if not encrypted and not esp.secure_download_mode: - try: - res = esp.flash_md5sum(address, uncsize) - if res != calcmd5: - print('File md5: %s' % calcmd5) - print('Flash md5: %s' % res) - print('MD5 of 0xFF is %s' % (hashlib.md5(b'\xFF' * uncsize).hexdigest())) - raise FatalError("MD5 of file does not match data in flash!") - else: - print('Hash of data verified.') - except NotImplementedInROMError: - pass - - print('\nLeaving...') - - if esp.IS_STUB: - # skip sending flash_finish to ROM loader here, - # as it causes the loader to exit and run user code - esp.flash_begin(0, 0) - - # Get the "encrypted" flag for the last file flashed - # Note: all_files list contains triplets like: - # (address: Integer, filename: String, encrypted: Boolean) - last_file_encrypted = all_files[-1][2] - - # Check whether the last file flashed was compressed or not - if args.compress and not last_file_encrypted: - esp.flash_defl_finish(False) - else: - esp.flash_finish(False) - - if args.verify: - print('Verifying just-written flash...') - print('(This option is deprecated, flash contents are now always read back after flashing.)') - # If some encrypted files have been flashed print a warning saying that we won't check them - if args.encrypt or args.encrypt_files is not None: - print('WARNING: - cannot verify encrypted files, they will be ignored') - # Call verify_flash function only if there at least one non-encrypted file flashed - if not args.encrypt: - verify_flash(esp, args) - - -def image_info(args): - if args.chip == "auto": - print("WARNING: --chip not specified, defaulting to ESP8266.") - image = LoadFirmwareImage(args.chip, args.filename) - print('Image version: %d' % image.version) - print('Entry point: %08x' % image.entrypoint if image.entrypoint != 0 else 'Entry point not set') - print('%d segments' % len(image.segments)) - print() - idx = 0 - for seg in image.segments: - idx += 1 - segs = seg.get_memory_type(image) - seg_name = ",".join(segs) - print('Segment %d: %r [%s]' % (idx, seg, seg_name)) - calc_checksum = image.calculate_checksum() - print('Checksum: %02x (%s)' % (image.checksum, - 'valid' if image.checksum == calc_checksum else 'invalid - calculated %02x' % calc_checksum)) - try: - digest_msg = 'Not appended' - if image.append_digest: - is_valid = image.stored_digest == image.calc_digest - digest_msg = "%s (%s)" % (hexify(image.calc_digest).lower(), - "valid" if is_valid else "invalid") - print('Validation Hash: %s' % digest_msg) - except AttributeError: - pass # ESP8266 image has no append_digest field - - -def make_image(args): - image = ESP8266ROMFirmwareImage() - if len(args.segfile) == 0: - raise FatalError('No segments specified') - if len(args.segfile) != len(args.segaddr): - raise FatalError('Number of specified files does not match number of specified addresses') - for (seg, addr) in zip(args.segfile, args.segaddr): - with open(seg, 'rb') as f: - data = f.read() - image.segments.append(ImageSegment(addr, data)) - image.entrypoint = args.entrypoint - image.save(args.output) - - -def elf2image(args): - e = ELFFile(args.input) - if args.chip == 'auto': # Default to ESP8266 for backwards compatibility - args.chip = 'esp8266' - - print("Creating {} image...".format(args.chip)) - - if args.chip == 'esp32': - image = ESP32FirmwareImage() - if args.secure_pad: - image.secure_pad = '1' - elif args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32s2': - image = ESP32S2FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32s3beta2': - image = ESP32S3BETA2FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32s3': - image = ESP32S3FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32c3': - image = ESP32C3FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32c6beta': - image = ESP32C6BETAFirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32h2beta1': - image = ESP32H2BETA1FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32h2beta2': - image = ESP32H2BETA2FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.chip == 'esp32c2': - image = ESP32C2FirmwareImage() - if args.secure_pad_v2: - image.secure_pad = '2' - elif args.version == '1': # ESP8266 - image = ESP8266ROMFirmwareImage() - elif args.version == '2': - image = ESP8266V2FirmwareImage() - else: - image = ESP8266V3FirmwareImage() - image.entrypoint = e.entrypoint - image.flash_mode = {'qio': 0, 'qout': 1, 'dio': 2, 'dout': 3}[args.flash_mode] - - if args.chip != 'esp8266': - image.min_rev = int(args.min_rev) - - if args.flash_mmu_page_size: - image.set_mmu_page_size(flash_size_bytes(args.flash_mmu_page_size)) - - # ELFSection is a subclass of ImageSegment, so can use interchangeably - image.segments = e.segments if args.use_segments else e.sections - - image.flash_size_freq = image.ROM_LOADER.parse_flash_size_arg(args.flash_size) - image.flash_size_freq += image.ROM_LOADER.parse_flash_freq_arg(args.flash_freq) - - if args.elf_sha256_offset: - image.elf_sha256 = e.sha256() - image.elf_sha256_offset = args.elf_sha256_offset - - before = len(image.segments) - image.merge_adjacent_segments() - if len(image.segments) != before: - delta = before - len(image.segments) - print("Merged %d ELF section%s" % (delta, "s" if delta > 1 else "")) - - image.verify() - - if args.output is None: - args.output = image.default_output_name(args.input) - image.save(args.output) - - print("Successfully created {} image.".format(args.chip)) - - -def read_mac(esp, args): - mac = esp.read_mac() - - def print_mac(label, mac): - print('%s: %s' % (label, ':'.join(map(lambda x: '%02x' % x, mac)))) - print_mac("MAC", mac) - - -def chip_id(esp, args): - try: - chipid = esp.chip_id() - print('Chip ID: 0x%08x' % chipid) - except NotSupportedError: - print('Warning: %s has no Chip ID. Reading MAC instead.' % esp.CHIP_NAME) - read_mac(esp, args) - - -def erase_flash(esp, args): - print('Erasing flash (this may take a while)...') - t = time.time() - esp.erase_flash() - print('Chip erase completed successfully in %.1fs' % (time.time() - t)) - - -def erase_region(esp, args): - print('Erasing region (may be slow depending on size)...') - t = time.time() - esp.erase_region(args.address, args.size) - print('Erase completed successfully in %.1f seconds.' % (time.time() - t)) - - -def run(esp, args): - esp.run() - - -def flash_id(esp, args): - flash_id = esp.flash_id() - print('Manufacturer: %02x' % (flash_id & 0xff)) - flid_lowbyte = (flash_id >> 16) & 0xFF - print('Device: %02x%02x' % ((flash_id >> 8) & 0xff, flid_lowbyte)) - print('Detected flash size: %s' % (DETECTED_FLASH_SIZES.get(flid_lowbyte, "Unknown"))) - - -def read_flash(esp, args): - if args.no_progress: - flash_progress = None - else: - def flash_progress(progress, length): - msg = '%d (%d %%)' % (progress, progress * 100.0 / length) - padding = '\b' * len(msg) - if progress == length: - padding = '\n' - sys.stdout.write(msg + padding) - sys.stdout.flush() - t = time.time() - data = esp.read_flash(args.address, args.size, flash_progress) - t = time.time() - t - print_overwrite('Read %d bytes at 0x%x in %.1f seconds (%.1f kbit/s)...' - % (len(data), args.address, t, len(data) / t * 8 / 1000), last_line=True) - with open(args.filename, 'wb') as f: - f.write(data) - - -def verify_flash(esp, args): - differences = False - - for address, argfile in args.addr_filename: - image = pad_to(argfile.read(), 4) - argfile.seek(0) # rewind in case we need it again - - image = _update_image_flash_params(esp, address, args, image) - - image_size = len(image) - print('Verifying 0x%x (%d) bytes @ 0x%08x in flash against %s...' % (image_size, image_size, address, argfile.name)) - # Try digest first, only read if there are differences. - digest = esp.flash_md5sum(address, image_size) - expected_digest = hashlib.md5(image).hexdigest() - if digest == expected_digest: - print('-- verify OK (digest matched)') - continue - else: - differences = True - if getattr(args, 'diff', 'no') != 'yes': - print('-- verify FAILED (digest mismatch)') - continue - - flash = esp.read_flash(address, image_size) - assert flash != image - diff = [i for i in range(image_size) if flash[i] != image[i]] - print('-- verify FAILED: %d differences, first @ 0x%08x' % (len(diff), address + diff[0])) - for d in diff: - flash_byte = flash[d] - image_byte = image[d] - if PYTHON2: - flash_byte = ord(flash_byte) - image_byte = ord(image_byte) - print(' %08x %02x %02x' % (address + d, flash_byte, image_byte)) - if differences: - raise FatalError("Verify failed.") - - -def read_flash_status(esp, args): - print('Status value: 0x%04x' % esp.read_status(args.bytes)) - - -def write_flash_status(esp, args): - fmt = "0x%%0%dx" % (args.bytes * 2) - args.value = args.value & ((1 << (args.bytes * 8)) - 1) - print(('Initial flash status: ' + fmt) % esp.read_status(args.bytes)) - print(('Setting flash status: ' + fmt) % args.value) - esp.write_status(args.value, args.bytes, args.non_volatile) - print(('After flash status: ' + fmt) % esp.read_status(args.bytes)) - - -def get_security_info(esp, args): - si = esp.get_security_info() - # TODO: better display and tests - print('Flags: {:#010x} ({})'.format(si["flags"], bin(si["flags"]))) - print('Flash_Crypt_Cnt: {:#x}'.format(si["flash_crypt_cnt"])) - print('Key_Purposes: {}'.format(si["key_purposes"])) - if si["chip_id"] is not None and si["api_version"] is not None: - print('Chip_ID: {}'.format(si["chip_id"])) - print('Api_Version: {}'.format(si["api_version"])) - - -def merge_bin(args): - try: - chip_class = _chip_to_rom_loader(args.chip) - except KeyError: - msg = "Please specify the chip argument" if args.chip == "auto" else "Invalid chip choice: '{}'".format(args.chip) - msg = msg + " (choose from {})".format(', '.join(SUPPORTED_CHIPS)) - raise FatalError(msg) - - # sort the files by offset. The AddrFilenamePairAction has already checked for overlap - input_files = sorted(args.addr_filename, key=lambda x: x[0]) - if not input_files: - raise FatalError("No input files specified") - first_addr = input_files[0][0] - if first_addr < args.target_offset: - raise FatalError("Output file target offset is 0x%x. Input file offset 0x%x is before this." % (args.target_offset, first_addr)) - - if args.format != 'raw': - raise FatalError("This version of esptool only supports the 'raw' output format") - - with open(args.output, 'wb') as of: - def pad_to(flash_offs): - # account for output file offset if there is any - of.write(b'\xFF' * (flash_offs - args.target_offset - of.tell())) - for addr, argfile in input_files: - pad_to(addr) - image = argfile.read() - image = _update_image_flash_params(chip_class, addr, args, image) - of.write(image) - if args.fill_flash_size: - pad_to(flash_size_bytes(args.fill_flash_size)) - print("Wrote 0x%x bytes to file %s, ready to flash to offset 0x%x" % (of.tell(), args.output, args.target_offset)) - - -def version(args): - print(__version__) - -# -# End of operations functions -# - - -def main(argv=None, esp=None): - """ - Main function for esptool - - argv - Optional override for default arguments parsing (that uses sys.argv), can be a list of custom arguments - as strings. Arguments and their values need to be added as individual items to the list e.g. "-b 115200" thus - becomes ['-b', '115200']. - - esp - Optional override of the connected device previously returned by get_default_connected_device() - """ - - external_esp = esp is not None - - parser = argparse.ArgumentParser(description='esptool.py v%s - Espressif chips ROM Bootloader Utility' % __version__, prog='esptool') - - parser.add_argument('--chip', '-c', - help='Target chip type', - type=format_chip_name, # support ESP32-S2, etc. - choices=['auto'] + SUPPORTED_CHIPS, - default=os.environ.get('ESPTOOL_CHIP', 'auto')) - - parser.add_argument( - '--port', '-p', - help='Serial port device', - default=os.environ.get('ESPTOOL_PORT', None)) - - parser.add_argument( - '--baud', '-b', - help='Serial port baud rate used when flashing/reading', - type=arg_auto_int, - default=os.environ.get('ESPTOOL_BAUD', ESPLoader.ESP_ROM_BAUD)) - - parser.add_argument( - '--before', - help='What to do before connecting to the chip', - choices=['default_reset', 'usb_reset', 'no_reset', 'no_reset_no_sync'], - default=os.environ.get('ESPTOOL_BEFORE', 'default_reset')) - - parser.add_argument( - '--after', '-a', - help='What to do after esptool.py is finished', - choices=['hard_reset', 'soft_reset', 'no_reset', 'no_reset_stub'], - default=os.environ.get('ESPTOOL_AFTER', 'hard_reset')) - - parser.add_argument( - '--no-stub', - help="Disable launching the flasher stub, only talk to ROM bootloader. Some features will not be available.", - action='store_true') - - parser.add_argument( - '--trace', '-t', - help="Enable trace-level output of esptool.py interactions.", - action='store_true') - - parser.add_argument( - '--override-vddsdio', - help="Override ESP32 VDDSDIO internal voltage regulator (use with care)", - choices=ESP32ROM.OVERRIDE_VDDSDIO_CHOICES, - nargs='?') - - parser.add_argument( - '--connect-attempts', - help=('Number of attempts to connect, negative or 0 for infinite. ' - 'Default: %d.' % DEFAULT_CONNECT_ATTEMPTS), - type=int, - default=os.environ.get('ESPTOOL_CONNECT_ATTEMPTS', DEFAULT_CONNECT_ATTEMPTS)) - - subparsers = parser.add_subparsers( - dest='operation', - help='Run esptool {command} -h for additional help') - - def add_spi_connection_arg(parent): - parent.add_argument('--spi-connection', '-sc', help='ESP32-only argument. Override default SPI Flash connection. ' - 'Value can be SPI, HSPI or a comma-separated list of 5 I/O numbers to use for SPI flash (CLK,Q,D,HD,CS).', - action=SpiConnectionAction) - - parser_load_ram = subparsers.add_parser( - 'load_ram', - help='Download an image to RAM and execute') - parser_load_ram.add_argument('filename', help='Firmware image') - - parser_dump_mem = subparsers.add_parser( - 'dump_mem', - help='Dump arbitrary memory to disk') - parser_dump_mem.add_argument('address', help='Base address', type=arg_auto_int) - parser_dump_mem.add_argument('size', help='Size of region to dump', type=arg_auto_int) - parser_dump_mem.add_argument('filename', help='Name of binary dump') - - parser_read_mem = subparsers.add_parser( - 'read_mem', - help='Read arbitrary memory location') - parser_read_mem.add_argument('address', help='Address to read', type=arg_auto_int) - - parser_write_mem = subparsers.add_parser( - 'write_mem', - help='Read-modify-write to arbitrary memory location') - parser_write_mem.add_argument('address', help='Address to write', type=arg_auto_int) - parser_write_mem.add_argument('value', help='Value', type=arg_auto_int) - parser_write_mem.add_argument('mask', help='Mask of bits to write', type=arg_auto_int, nargs='?', default='0xFFFFFFFF') - - def add_spi_flash_subparsers(parent, allow_keep, auto_detect): - """ Add common parser arguments for SPI flash properties """ - extra_keep_args = ['keep'] if allow_keep else [] - - if auto_detect and allow_keep: - extra_fs_message = ", detect, or keep" - elif auto_detect: - extra_fs_message = ", or detect" - elif allow_keep: - extra_fs_message = ", or keep" - else: - extra_fs_message = "" - - parent.add_argument('--flash_freq', '-ff', help='SPI Flash frequency', - choices=extra_keep_args + ['80m', '60m', '48m', '40m', '30m', '26m', '24m', '20m', '16m', '15m', '12m'], - default=os.environ.get('ESPTOOL_FF', 'keep' if allow_keep else '40m')) - parent.add_argument('--flash_mode', '-fm', help='SPI Flash mode', - choices=extra_keep_args + ['qio', 'qout', 'dio', 'dout'], - default=os.environ.get('ESPTOOL_FM', 'keep' if allow_keep else 'qio')) - parent.add_argument('--flash_size', '-fs', help='SPI Flash size in MegaBytes (1MB, 2MB, 4MB, 8MB, 16MB, 32MB, 64MB, 128MB)' - ' plus ESP8266-only (256KB, 512KB, 2MB-c1, 4MB-c1)' + extra_fs_message, - action=FlashSizeAction, auto_detect=auto_detect, - default=os.environ.get('ESPTOOL_FS', 'keep' if allow_keep else '1MB')) - add_spi_connection_arg(parent) - - parser_write_flash = subparsers.add_parser( - 'write_flash', - help='Write a binary blob to flash') - - parser_write_flash.add_argument('addr_filename', metavar='
', help='Address followed by binary filename, separated by space', - action=AddrFilenamePairAction) - parser_write_flash.add_argument('--erase-all', '-e', - help='Erase all regions of flash (not just write areas) before programming', - action="store_true") - - add_spi_flash_subparsers(parser_write_flash, allow_keep=True, auto_detect=True) - parser_write_flash.add_argument('--no-progress', '-p', help='Suppress progress output', action="store_true") - parser_write_flash.add_argument('--verify', help='Verify just-written data on flash ' - '(mostly superfluous, data is read back during flashing)', action='store_true') - parser_write_flash.add_argument('--encrypt', help='Apply flash encryption when writing data (required correct efuse settings)', - action='store_true') - # In order to not break backward compatibility, our list of encrypted files to flash is a new parameter - parser_write_flash.add_argument('--encrypt-files', metavar='
', - help='Files to be encrypted on the flash. Address followed by binary filename, separated by space.', - action=AddrFilenamePairAction) - parser_write_flash.add_argument('--ignore-flash-encryption-efuse-setting', help='Ignore flash encryption efuse settings ', - action='store_true') - - compress_args = parser_write_flash.add_mutually_exclusive_group(required=False) - compress_args.add_argument('--compress', '-z', help='Compress data in transfer (default unless --no-stub is specified)', - action="store_true", default=None) - compress_args.add_argument('--no-compress', '-u', help='Disable data compression during transfer (default if --no-stub is specified)', - action="store_true") - - subparsers.add_parser( - 'run', - help='Run application code in flash') - - parser_image_info = subparsers.add_parser( - 'image_info', - help='Dump headers from an application image') - parser_image_info.add_argument('filename', help='Image file to parse') - - parser_make_image = subparsers.add_parser( - 'make_image', - help='Create an application image from binary files') - parser_make_image.add_argument('output', help='Output image file') - parser_make_image.add_argument('--segfile', '-f', action='append', help='Segment input file') - parser_make_image.add_argument('--segaddr', '-a', action='append', help='Segment base address', type=arg_auto_int) - parser_make_image.add_argument('--entrypoint', '-e', help='Address of entry point', type=arg_auto_int, default=0) - - parser_elf2image = subparsers.add_parser( - 'elf2image', - help='Create an application image from ELF file') - parser_elf2image.add_argument('input', help='Input ELF file') - parser_elf2image.add_argument('--output', '-o', help='Output filename prefix (for version 1 image), or filename (for version 2 single image)', type=str) - parser_elf2image.add_argument('--version', '-e', help='Output image version', choices=['1', '2', '3'], default='1') - parser_elf2image.add_argument('--min-rev', '-r', help='Minimum chip revision', choices=['0', '1', '2', '3'], default='0') - parser_elf2image.add_argument('--secure-pad', action='store_true', - help='Pad image so once signed it will end on a 64KB boundary. For Secure Boot v1 images only.') - parser_elf2image.add_argument('--secure-pad-v2', action='store_true', - help='Pad image to 64KB, so once signed its signature sector will start at the next 64K block. ' - 'For Secure Boot v2 images only.') - parser_elf2image.add_argument('--elf-sha256-offset', help='If set, insert SHA256 hash (32 bytes) of the input ELF file at specified offset in the binary.', - type=arg_auto_int, default=None) - parser_elf2image.add_argument('--use_segments', help='If set, ELF segments will be used instead of ELF sections to genereate the image.', - action='store_true') - parser_elf2image.add_argument('--flash-mmu-page-size', help="Change flash MMU page size.", choices=['64KB', '32KB', '16KB']) - - add_spi_flash_subparsers(parser_elf2image, allow_keep=False, auto_detect=False) - - subparsers.add_parser( - 'read_mac', - help='Read MAC address from OTP ROM') - - subparsers.add_parser( - 'chip_id', - help='Read Chip ID from OTP ROM') - - parser_flash_id = subparsers.add_parser( - 'flash_id', - help='Read SPI flash manufacturer and device ID') - add_spi_connection_arg(parser_flash_id) - - parser_read_status = subparsers.add_parser( - 'read_flash_status', - help='Read SPI flash status register') - - add_spi_connection_arg(parser_read_status) - parser_read_status.add_argument('--bytes', help='Number of bytes to read (1-3)', type=int, choices=[1, 2, 3], default=2) - - parser_write_status = subparsers.add_parser( - 'write_flash_status', - help='Write SPI flash status register') - - add_spi_connection_arg(parser_write_status) - parser_write_status.add_argument('--non-volatile', help='Write non-volatile bits (use with caution)', action='store_true') - parser_write_status.add_argument('--bytes', help='Number of status bytes to write (1-3)', type=int, choices=[1, 2, 3], default=2) - parser_write_status.add_argument('value', help='New value', type=arg_auto_int) - - parser_read_flash = subparsers.add_parser( - 'read_flash', - help='Read SPI flash content') - add_spi_connection_arg(parser_read_flash) - parser_read_flash.add_argument('address', help='Start address', type=arg_auto_int) - parser_read_flash.add_argument('size', help='Size of region to dump', type=arg_auto_int) - parser_read_flash.add_argument('filename', help='Name of binary dump') - parser_read_flash.add_argument('--no-progress', '-p', help='Suppress progress output', action="store_true") - - parser_verify_flash = subparsers.add_parser( - 'verify_flash', - help='Verify a binary blob against flash') - parser_verify_flash.add_argument('addr_filename', help='Address and binary file to verify there, separated by space', - action=AddrFilenamePairAction) - parser_verify_flash.add_argument('--diff', '-d', help='Show differences', - choices=['no', 'yes'], default='no') - add_spi_flash_subparsers(parser_verify_flash, allow_keep=True, auto_detect=True) - - parser_erase_flash = subparsers.add_parser( - 'erase_flash', - help='Perform Chip Erase on SPI flash') - add_spi_connection_arg(parser_erase_flash) - - parser_erase_region = subparsers.add_parser( - 'erase_region', - help='Erase a region of the flash') - add_spi_connection_arg(parser_erase_region) - parser_erase_region.add_argument('address', help='Start address (must be multiple of 4096)', type=arg_auto_int) - parser_erase_region.add_argument('size', help='Size of region to erase (must be multiple of 4096)', type=arg_auto_int) - - parser_merge_bin = subparsers.add_parser( - 'merge_bin', - help='Merge multiple raw binary files into a single file for later flashing') - - parser_merge_bin.add_argument('--output', '-o', help='Output filename', type=str, required=True) - parser_merge_bin.add_argument('--format', '-f', help='Format of the output file', choices='raw', default='raw') # for future expansion - add_spi_flash_subparsers(parser_merge_bin, allow_keep=True, auto_detect=False) - - parser_merge_bin.add_argument('--target-offset', '-t', help='Target offset where the output file will be flashed', - type=arg_auto_int, default=0) - parser_merge_bin.add_argument('--fill-flash-size', help='If set, the final binary file will be padded with FF ' - 'bytes up to this flash size.', action=FlashSizeAction) - parser_merge_bin.add_argument('addr_filename', metavar='
', - help='Address followed by binary filename, separated by space', - action=AddrFilenamePairAction) - - subparsers.add_parser('get_security_info', help='Get some security-related data') - - subparsers.add_parser('version', help='Print esptool version') - - # internal sanity check - every operation matches a module function of the same name - for operation in subparsers.choices.keys(): - assert operation in globals(), "%s should be a module function" % operation - - argv = expand_file_arguments(argv or sys.argv[1:]) - - args = parser.parse_args(argv) - print('esptool.py v%s' % __version__) - - # operation function can take 1 arg (args), 2 args (esp, arg) - # or be a member function of the ESPLoader class. - - if args.operation is None: - parser.print_help() - sys.exit(1) - - # Forbid the usage of both --encrypt, which means encrypt all the given files, - # and --encrypt-files, which represents the list of files to encrypt. - # The reason is that allowing both at the same time increases the chances of - # having contradictory lists (e.g. one file not available in one of list). - if args.operation == "write_flash" and args.encrypt and args.encrypt_files is not None: - raise FatalError("Options --encrypt and --encrypt-files must not be specified at the same time.") - - operation_func = globals()[args.operation] - - if PYTHON2: - # This function is depreciated in Python3 - operation_args = inspect.getargspec(operation_func).args - else: - operation_args = inspect.getfullargspec(operation_func).args - - if operation_args[0] == 'esp': # operation function takes an ESPLoader connection object - if args.before != "no_reset_no_sync": - initial_baud = min(ESPLoader.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate - else: - initial_baud = args.baud - - if args.port is None: - ser_list = get_port_list() - print("Found %d serial ports" % len(ser_list)) - else: - ser_list = [args.port] - esp = esp or get_default_connected_device(ser_list, port=args.port, connect_attempts=args.connect_attempts, - initial_baud=initial_baud, chip=args.chip, trace=args.trace, - before=args.before) - - if esp is None: - raise FatalError("Could not connect to an Espressif device on any of the %d available serial ports." % len(ser_list)) - - if esp.secure_download_mode: - print("Chip is %s in Secure Download Mode" % esp.CHIP_NAME) - else: - print("Chip is %s" % (esp.get_chip_description())) - print("Features: %s" % ", ".join(esp.get_chip_features())) - print("Crystal is %dMHz" % esp.get_crystal_freq()) - read_mac(esp, args) - - if not args.no_stub: - if esp.secure_download_mode: - print("WARNING: Stub loader is not supported in Secure Download Mode, setting --no-stub") - args.no_stub = True - elif not esp.IS_STUB and esp.stub_is_disabled: - print("WARNING: Stub loader has been disabled for compatibility, setting --no-stub") - args.no_stub = True - else: - esp = esp.run_stub() - - if args.override_vddsdio: - esp.override_vddsdio(args.override_vddsdio) - - if args.baud > initial_baud: - try: - esp.change_baud(args.baud) - except NotImplementedInROMError: - print("WARNING: ROM doesn't support changing baud rate. Keeping initial baud rate %d" % initial_baud) - - # override common SPI flash parameter stuff if configured to do so - if hasattr(args, "spi_connection") and args.spi_connection is not None: - if esp.CHIP_NAME != "ESP32": - raise FatalError("Chip %s does not support --spi-connection option." % esp.CHIP_NAME) - print("Configuring SPI flash mode...") - esp.flash_spi_attach(args.spi_connection) - elif args.no_stub: - print("Enabling default SPI flash mode...") - # ROM loader doesn't enable flash unless we explicitly do it - esp.flash_spi_attach(0) - - # XMC chip startup sequence - XMC_VENDOR_ID = 0x20 - - def is_xmc_chip_strict(): - id = esp.flash_id() - rdid = ((id & 0xff) << 16) | ((id >> 16) & 0xff) | (id & 0xff00) - - vendor_id = ((rdid >> 16) & 0xFF) - mfid = ((rdid >> 8) & 0xFF) - cpid = (rdid & 0xFF) - - if vendor_id != XMC_VENDOR_ID: - return False - - matched = False - if mfid == 0x40: - if cpid >= 0x13 and cpid <= 0x20: - matched = True - elif mfid == 0x41: - if cpid >= 0x17 and cpid <= 0x20: - matched = True - elif mfid == 0x50: - if cpid >= 0x15 and cpid <= 0x16: - matched = True - return matched - - def flash_xmc_startup(): - # If the RDID value is a valid XMC one, may skip the flow - fast_check = True - if fast_check and is_xmc_chip_strict(): - return # Successful XMC flash chip boot-up detected by RDID, skipping. - - sfdp_mfid_addr = 0x10 - mf_id = esp.read_spiflash_sfdp(sfdp_mfid_addr, 8) - if mf_id != XMC_VENDOR_ID: # Non-XMC chip detected by SFDP Read, skipping. - return - - print("WARNING: XMC flash chip boot-up failure detected! Running XMC25QHxxC startup flow") - esp.run_spiflash_command(0xB9) # Enter DPD - esp.run_spiflash_command(0x79) # Enter UDPD - esp.run_spiflash_command(0xFF) # Exit UDPD - time.sleep(0.002) # Delay tXUDPD - esp.run_spiflash_command(0xAB) # Release Power-Down - time.sleep(0.00002) - # Check for success - if not is_xmc_chip_strict(): - print("WARNING: XMC flash boot-up fix failed.") - print("XMC flash chip boot-up fix successful!") - - # Check flash chip connection - if not esp.secure_download_mode: - try: - flash_id = esp.flash_id() - if flash_id in (0xffffff, 0x000000): - print('WARNING: Failed to communicate with the flash chip, read/write operations will fail. ' - 'Try checking the chip connections or removing any other hardware connected to IOs.') - except Exception as e: - esp.trace('Unable to verify flash chip connection ({}).'.format(e)) - - # Check if XMC SPI flash chip booted-up successfully, fix if not - if not esp.secure_download_mode: - try: - flash_xmc_startup() - except Exception as e: - esp.trace('Unable to perform XMC flash chip startup sequence ({}).'.format(e)) - - if hasattr(args, "flash_size"): - print("Configuring flash size...") - detect_flash_size(esp, args) - if args.flash_size != 'keep': # TODO: should set this even with 'keep' - esp.flash_set_parameters(flash_size_bytes(args.flash_size)) - # Check if stub supports chosen flash size - if esp.IS_STUB and args.flash_size in ('32MB', '64MB', '128MB'): - print("WARNING: Flasher stub doesn't fully support flash size larger than 16MB, in case of failure use --no-stub.") - - if esp.IS_STUB and hasattr(args, "address") and hasattr(args, "size"): - if args.address + args.size > 0x1000000: - print("WARNING: Flasher stub doesn't fully support flash size larger than 16MB, in case of failure use --no-stub.") - - try: - operation_func(esp, args) - finally: - try: # Clean up AddrFilenamePairAction files - for address, argfile in args.addr_filename: - argfile.close() - except AttributeError: - pass - - # Handle post-operation behaviour (reset or other) - if operation_func == load_ram: - # the ESP is now running the loaded image, so let it run - print('Exiting immediately.') - elif args.after == 'hard_reset': - esp.hard_reset() - elif args.after == 'soft_reset': - print('Soft resetting...') - # flash_finish will trigger a soft reset - esp.soft_reset(False) - elif args.after == 'no_reset_stub': - print('Staying in flasher stub.') - else: # args.after == 'no_reset' - print('Staying in bootloader.') - if esp.IS_STUB: - esp.soft_reset(True) # exit stub back to ROM loader - - if not external_esp: - esp._port.close() - - else: - operation_func(args) - - -def get_port_list(): - if list_ports is None: - raise FatalError("Listing all serial ports is currently not available. Please try to specify the port when " - "running esptool.py or update the pyserial package to the latest version") - return sorted(ports.device for ports in list_ports.comports()) - - -def expand_file_arguments(argv): - """ Any argument starting with "@" gets replaced with all values read from a text file. - Text file arguments can be split by newline or by space. - Values are added "as-is", as if they were specified in this order on the command line. - """ - new_args = [] - expanded = False - for arg in argv: - if arg.startswith("@"): - expanded = True - with open(arg[1:], "r") as f: - for line in f.readlines(): - new_args += shlex.split(line) - else: - new_args.append(arg) - if expanded: - print("esptool.py %s" % (" ".join(new_args[1:]))) - return new_args - return argv - - -class FlashSizeAction(argparse.Action): - """ Custom flash size parser class to support backwards compatibility with megabit size arguments. - - (At next major relase, remove deprecated sizes and this can become a 'normal' choices= argument again.) - """ - def __init__(self, option_strings, dest, nargs=1, auto_detect=False, **kwargs): - super(FlashSizeAction, self).__init__(option_strings, dest, nargs, **kwargs) - self._auto_detect = auto_detect - - def __call__(self, parser, namespace, values, option_string=None): - try: - value = { - '2m': '256KB', - '4m': '512KB', - '8m': '1MB', - '16m': '2MB', - '32m': '4MB', - '16m-c1': '2MB-c1', - '32m-c1': '4MB-c1', - }[values[0]] - print("WARNING: Flash size arguments in megabits like '%s' are deprecated." % (values[0])) - print("Please use the equivalent size '%s'." % (value)) - print("Megabit arguments may be removed in a future release.") - except KeyError: - value = values[0] - - known_sizes = dict(ESP8266ROM.FLASH_SIZES) - known_sizes.update(ESP32ROM.FLASH_SIZES) - if self._auto_detect: - known_sizes['detect'] = 'detect' - known_sizes['keep'] = 'keep' - if value not in known_sizes: - raise argparse.ArgumentError(self, '%s is not a known flash size. Known sizes: %s' % (value, ", ".join(known_sizes.keys()))) - setattr(namespace, self.dest, value) - - -class SpiConnectionAction(argparse.Action): - """ Custom action to parse 'spi connection' override. Values are SPI, HSPI, or a sequence of 5 pin numbers separated by commas. - """ - def __call__(self, parser, namespace, value, option_string=None): - if value.upper() == "SPI": - value = 0 - elif value.upper() == "HSPI": - value = 1 - elif "," in value: - values = value.split(",") - if len(values) != 5: - raise argparse.ArgumentError(self, '%s is not a valid list of comma-separate pin numbers. Must be 5 numbers - CLK,Q,D,HD,CS.' % value) - try: - values = tuple(int(v, 0) for v in values) - except ValueError: - raise argparse.ArgumentError(self, '%s is not a valid argument. All pins must be numeric values' % values) - if any([v for v in values if v > 33 or v < 0]): - raise argparse.ArgumentError(self, 'Pin numbers must be in the range 0-33.') - # encode the pin numbers as a 32-bit integer with packed 6-bit values, the same way ESP32 ROM takes them - # TODO: make this less ESP32 ROM specific somehow... - clk, q, d, hd, cs = values - value = (hd << 24) | (cs << 18) | (d << 12) | (q << 6) | clk - else: - raise argparse.ArgumentError(self, '%s is not a valid spi-connection value. ' - 'Values are SPI, HSPI, or a sequence of 5 pin numbers CLK,Q,D,HD,CS).' % value) - setattr(namespace, self.dest, value) - - -class AddrFilenamePairAction(argparse.Action): - """ Custom parser class for the address/filename pairs passed as arguments """ - def __init__(self, option_strings, dest, nargs='+', **kwargs): - super(AddrFilenamePairAction, self).__init__(option_strings, dest, nargs, **kwargs) - - def __call__(self, parser, namespace, values, option_string=None): - # validate pair arguments - pairs = [] - for i in range(0, len(values), 2): - try: - address = int(values[i], 0) - except ValueError: - raise argparse.ArgumentError(self, 'Address "%s" must be a number' % values[i]) - try: - argfile = open(values[i + 1], 'rb') - except IOError as e: - raise argparse.ArgumentError(self, e) - except IndexError: - raise argparse.ArgumentError(self, 'Must be pairs of an address and the binary filename to write there') - pairs.append((address, argfile)) - - # Sort the addresses and check for overlapping - end = 0 - for address, argfile in sorted(pairs, key=lambda x: x[0]): - argfile.seek(0, 2) # seek to end - size = argfile.tell() - argfile.seek(0) - sector_start = address & ~(ESPLoader.FLASH_SECTOR_SIZE - 1) - sector_end = ((address + size + ESPLoader.FLASH_SECTOR_SIZE - 1) & ~(ESPLoader.FLASH_SECTOR_SIZE - 1)) - 1 - if sector_start < end: - message = 'Detected overlap at address: 0x%x for file: %s' % (address, argfile.name) - raise argparse.ArgumentError(self, message) - end = sector_end - setattr(namespace, self.dest, pairs) - - -# Binary stub code (see flasher_stub dir for source & details) -ESP8266ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNq9Pftj1DbS/4rthCQbkiLZXq/Mo2w2yQItXCEcKddL28gvelxpwzZXcj34/vbP85Jl7yaB67U/LFl5ZWk0M5q3xH8265/OF//evB1oNUlNmmTjeCfYrOy5bZ8VmycXypxcGH1y0dT328aYP2n7Ue0nbj9J+5lw\ -O+FPQe0iP7mo2t+0mp5c1I3X0FXbMNworGv80PZzfer2cY6Nc/ft5KJUruH3Ni0sleVG03gNfKEYvNB9e9n+Wg6etf9WDb8OC6kVNu64b6sGouUtdWjX1w5Va2y0S6pjfmxbTNUJNtr56xS/tf/W40unWPWtXVmd\ -DZ597c2ew/IrwVLj4d1mbrK2Ufj4K1fiuC7dXPojofv0b5GD43sPoqL2YFWa+U15fOi3k0E7HbTHg/ak1z7vtRb9vnowt879dug3ej33/Ibtj2EGY5bD9en+ms2gjd/jQTsZtNNBOxu0zaBd9tt6AI/u9Q/8Rq/n\ -1G+cDtb1R370Ne34E3noOp66jseG7eya9uSatrmyfX5F66crWk52X9our2wvrto7134+dd9mn4Sj809Y9xDy5hopMIBcDyDRAyzq3nhrfuOm3+gNe8dv7PuN536jR5BfBpJmAKcdtMtBu05W7BL9J+7iP1oK/F4p\ -8XulyO+VMr9XCl3X/sSP5r2hY28HTnDnZbjjxrzTUpYcCe406F0z9pvVOm+JMr2VbrZW63l9cc5WqzWisNhaAIOwaeZ9CYCmERq3zX0GVRpG0cftm9RvT51Se7jHL+SpGwr+zWlKQAMo80YFAcwdWyJxOSZ7WEEH\ -C7C1q88zQEXyrG2l8DoMncEXLU/aQQCBRn3xAsxaVLo/wDuzdiqk3FRRX13sA5DwlfvNXsC/tzP3IEIJEsmbYNAVNAm818qvPL4fkr2HINCXFqgaF3c77oPwTHqcbMJSaO0mW80m/OKIyMitv8Ew824PeY/T3iuJ\ -JoO+BSJybCQd4iPhPN3hX6NAb0To9cR7bnwmUM7d+erh3iPiJFvyrzZ1ja0WBLL0H7cLFyu1k72nwnPL++NaGcXPTNnnQeeN+J9ukumyTUlOW+o12vk3vRHTVeAyyL2V99zAovdLb6eY0WB3Nf4ACTe08howkhst\ -L3k/NPdhhEq2o3GPiWBDfdpp+tNOzT9lqSINJ5TUXQ/MQnnzF6nXqKBhsXHHe6HpSY3ShwyGqj0R4hsV2v8Re8rqrlOoAKH2BHOj+4yV+/TAhpXllELPKSHRNWzXeIlUnB7M8c/OY/xz8dDx1Bf8rUgf8bey/Iy/\ -VQbdn+lDcpiVOJw1Lmn6eEPm5ndDggmgz0H0sWORs9ooVWTXItyhrE5tK6XK2LYCrootCJ/YglyLLeOtZklb+i5YEbPMKhLGVMkKI/OxDSDFX0YT6G1IKBeAZs0QwAZU5f52SHrLsoLAfjCYDt/z5Po3ntCiWNre\ -ceKo/QIYikN6vwMGn2r/6RENXy2tSJOr3jQRYQyBoOGBSkmwHvTlI8If8HDJcDh+Hn/s87eyEVsRn9esBOiLli8FQyYOAZuJZbWCOjkygCZMrTnIDb2ms1/kHUZgxb8MBH3ePdVxtAc8FqFcR+d1HZ+MZ8/2Yxtt\ -ILe1ckGXCQQZ4oBVU88/oLeTWCwSg8pRqyhoQL/qrV039xb0iGzU5yhdRtGzfWIQYhZhJLZ2QOZpGx224BT08+oZ46BF0wSlyoS4WSc8VMlGWp5549c1rLV9OGZgxsQxSs8puNVJCw9FwMUPaB8iItsXcgpmbKb7\ -QFF4WoLBwFKsyRZBw71N9lYezgCRwJvU/xiet/OWGOQA1MnoBp2i5qgb2fLIQIwSbYUNiOT9mywf4+bqegLYuQ82/GhweU1/Lc61yTr+0+W6e3X+nteKGhGQ1B/2c/mZpDhExJbm5SkA9MJ5fA2RrJ3hS5kVVG03\ -8UvGUIGvz4iGlX4AnPkDzogmdOm9YvyeCnt+xSh0Jof8HPegvIVGEf+UTNyI7ReAeNx+sQj6zoy3WI0WXCKYfI29brKxKJIZ2M34PK7UoTyhHZDzd+O+u93A4MD207iJCtAp9JoBttHHzLeVgwlliarnvHfEkCzJ\ -9zbZ97wY3APIRknHZ7njhVP2QfQ/lsVfY2nAvIzoNdOz3oIdiOHpZvjiMVBjDZQSKcEGbYQd6lKWtwC6f4hrFaCBfkxQg9Vf65s0IAokhBMtcATyuxVzVSC9atX94uZqJp+TLeoNRTB/vTTOEcUgVsB8LB7J/BsA\ -mjFpmM37tkrDTAzsVFWeegN6xZ3EMtnF6tcOGC+ZZ5DLi0pvSD/ocYYcuAu6U1OABWar444n3YwxcHDh6I+RHvMtyG8z/hXF4t3O1V05ncmQ9DFOF9KCLp9u4nY8mptb91gtlQFFUExMs5djCMfA5ga5DtQnW+AR\ -DFUlN8GcWQNdnjL7Zt94erNJvHfqmecoCSAZBdHBF6WVv+QO5mhrN6boToPbuBRpgQoN5stBw8Ae0+YJvF6waml8uh91frcuDp62bu1fYYjJDTBKSY2Nj/AP62LYRMCJFC9D7fZ0P5jGAf086dgFdZ8CbRtswJiy\ -JggtA9w57vL9QbAdjSWHk/gKnDhuQLkOqsV1MZx7cKx2l4Nf8czhDx7f7sS5iTvIidTAct0IE6d7wBsZN/ud0kCrezzHFaggXb1hEB4nw6kvCA4waiDhU7E8jN8TXyCJUBNsfR6LjaiWTLmHn21BXq1A8z1YB+M7\ -DoHvkaq1s2+OyG7fV08PKCfTNzAzcsBAVgLOy5qs+GZyl7CJshOdFFr4nOQHSgdQWQhX429uCpmgnw+DZ4NkCUo3R+aHbHYB3seOrWGr1tMbsHPUd/Dv04jAWmKF+Mu3lJtE+VsxlilS1fXOJ+Zz9BrTPmkAeton\ -5CFU4w4cpb7ZRtvwyxcY2/jyQAzUp6QE270ypjl1hgm3R57hBbNnrxg3JulYph53ETNdehyTLTuPqyQUm9PIit+z34TNcvwdNA9/Rp37GB0w30BsyFzWJ5uwh8dizKHdAeRIxUwEKJGa6Ubc9Wlkd2b9PJku1yad\ -jYKjAfbFLqhinPWQLafE7YW5CMG5jBeStENCmnvw6q7nfTDX9L2PWB52Xgc8xuBGsEYsU4Mwwoyyuhcc0p5TGsQ6jl/S+MJCpedCUFaXTZ8iG3ZgLsRFvPz24RNzL2KAy/HrLjFXC78rEqpJ1LkIKE2DJHCM7+T2\ -4SNed+YJRjf1kXQ7suuXuzoRcU07qt1mhkPb5BwV4TsY9C15HzB6EUe4QxmnRnivhXeTRs7jcBt+sKiSef0tPjZzj6Ut7CrqEYPfYsY5IzAOs7dvYPCjcL0It8++ZKvKHrx+QXajSY/sDZxhhz0Mp/1Aj6UtyAUy\ -6fwx/QbbEDagBVJqdQT/jrfeAKh2CwHZOLKju89BlH2A/bRLMgBCBK09uumZPOB3QTTyBCAk63iLJrcuF6BnvugScUCBC1BK8NckI9D/I+aeFgI2fbFcAKByxi+lvBahOC06OQODOX0PWvx0H8Z8g+GF4lvAzyJc\ -7zhKkgsmhqctZW6EbFKAKwBRvQr3pBENf5ETTVFtsUy2Mc+9pl4D/t6T2Y6wpKewV3oAzCmMppIWkqN2wi2Y8Gtyl6riqMvZAXpN/DfaoEbdEicItvw30czqI4i+En+A8oFaCzP+dyerdDIL9VGYEtccs8wgpyMI\ -XgCsx+SNUBAvSIXXTTDmeKSvY8WW1bH9rNtLupnyZrL668xLVzQYb1ckSZDYsEeQQxPVBOBVzLsNpVZI7qolS8hyt97ZZwSyfkCfhx8UYKBAdQzSpRaGAEowNwjkp2tCD7RXEnqFYok8GMw693ygiq22ljtoPxUV\ -l88UZOOrYjfqJ7p0ORXhpwl3JVq+dcCw1imA0Lx1mwjUz/oIuCAI99q/JRfO1Mke0aRE5++Yq2VIfa2fbN7dmne51zyWRUMA8ap1Pw+pdqWp8uIDyDz0CdNhuu1qjFjEiBWM6P8WI7wSipFig0OdU8YB8lDEXpgJ\ -2MlV5KyJagcTKWcuM9kwDf9x7MCv1+xKwboZBX3q1+pj1yprNGwdggI0WNwUCk09+gIvgDghfVhBLNCZ3IgJs7dqcUx52fWO+CQCU1kikLb8hbVhurREIGdItVkAlKNr1c5ZwdatYskSNTb6IhLABBGaRUSTfdWZ\ -QBRrC0nBNNV7zuDFJIw0xBXwSxU06hRyLmlr7uWN2H5UFyeyAAHdwRVwnoXQGbD4aD6O0ncT6l/04oCftPvz/373C/3fEMDI3OpclK2jco8nEAiXCLy7z7hlve5QE/7TKWROp7Y0Bf1b/AxfD4VeL2i3ICNNjhkR\ -hkVh6YUVEy/cGV+FoND2Zra+hryeIDslC6C8n8a5dP9VoKEhJAazV5BuLdVTkJrqFQceNA78itiZWs0Tgggs2Kc3glZ7FnYsChRtK9mObmMV4djpz9dA7tcvTn/GkBDweT6nlCd6lYiGDTYW0A1JVy4E02NJ+LMn\ -e9EZmAxkL+apNpydH3QSJXoFEn+H4zAGJ5/Bs1ik4ZjWtgDbqVseZkx6y1uECa2N1gnW/IRDkrmEQ5SZ7UPQpICdWiQQJqO0izoTJoHwKhr41Ocd9SFWytMFAP0S6PVCwpcXc3/D/Na+lVt0L1Ci7BImdIFhWxCE\ -OnwNr+rXXfzT9HJXMyeKInajmskcw6bhK3qnlVjdLgVdo6v5chGT9RSovVKBss2b/XUgRkM0fWnCIrzxapW1cC/u05rlBcyJrlYdeGEbEh8T1I4hzFbt/dXN4PUTK5pqrzoBNP2K6QjEQZNcS5jYMULSU7QPMaC4\ -iwpoXUE+WkUlG59OxN/3RDxGAsMHyIes8ygz5RmoSv8w5D7ifeRzt8nm/bwu2+aOJuYamtQi2VEyLtymy1F6oE0vBcnFO/xp85N0N1pu6CKAUtTxCt5qR1fr2wehGqj2Fpc9TQ52HaEzJBhb9Rqhb3+fUpS6TCDk\ -COoc2WbCCkOJUkTOf+xFCSiOqQ98yYYyQOn9lVsfI1KwgBLXe8pVPuBHxHtkULdwb+EKhabsImCsJ7Yoau8MB0eigRkDIQliCqwWunwoBVQfDgIhkLKhwcBz2EZWjIgVjSVWbL3T3ch+9oTZqJVkTqqxHE4YM6p5\ -2XGwJuc0joSxCdk6Dj+b3sKoVEzlO5S8HcFvI5ajlZdnBe8UKg9hkBxraw6+oDAPZniaL/a2RxyS4HlG5Dzn4OJbDvnVYyknKqGAx/BebrLtmyEbX+WMJHilpg/YB4XpzEsIJhiW2kW5vY50uYngnWMsdGbziKJ9\ -+x9j6+wknTL25OJNnPAnIS9Yh2hDGHK4NPj5Vl1wyrrggH7uaUfTZcIZH5E1s9CcBRgdt7d4HzTTKDh7u3f8fRcmgNnMZHLn7IIxrd6hQnwHzbMzPQvVAt/H2MlbjjOxJaMNFwJBEYjVgK/0jCDPuXgF8lxaLyja\ -4FJPTizMwlvwdjR72aXF2tc3SZxgAjgLaFflAW0irH6ztJks788CSt5tTpBZHGMqcCyYYUAsl69imKj8QBEpCmrVwWiPDEqEsWTnJ3UxJCQNz67SbiuXLfj5e6IHPVMMWsqVO4Z+sGolMO8IGPWLi69hXCucsGFG\ -gmAyCzl1UZjWg6WpAQmlCZC+wTsA5T0KgDA/+039togE/u13YMiAtCmhW44Ozdcw3Az4DrgpR4v7YGZvLsLPSJSjycTR0oJTbS1cuxtbXpoz58yy8dQkRuhdhgo6dl7UDdhhI45rZ5FouRscKxXc19g93fsAze01\ -OKKRK/ZlyDeLMXwYaA4N4vRqBCIgizHVBkZIa9itd/l+HfftP5gM4UwOKIgCRGnK92Sse5r7FH4G76lF85ba3kB7ysGUi6wqfiFZgrjIbpZo770iuxdUzFJQ6yMsIS0lKNmv/fCqs4g8K6iOxIHUxb3r9a3QCtUf\ -4sKLj1e2S59QfI7j9KxwXcyObCEsrXLTV7Fki1ZAsRa4wEQsoYbwXz2626+I7qeI49ine9KjuyW65xrGNOl8UHHfauAfWVABvVPeproQ3yFF+kIJmcYS2zQ42VQo42102ifwE0JSDkzrCNG37JzdF4GrSemMk02I\ -8I/D2wDHAqORLe2/I6ikJGkxk+xd2tPxWw1FSSFeDZ7+hKx+5836QT3PB6IkBghV4uYMg3kZlPfW+jmhtgu7C5kiu8GWOw9cfyqrQmlVNv4IPl3t3S/Cjesc/HccxWpxs6H52FhOPnjZZfFYIzX0fo4mWtG49AWQ\ -Czw/dBd9n9D0qLndhKxLjCPs9i0xrhrKxqhSElfwsftoZ5W3U+eCoFM89IUfUf+hI/yathzZVkuVzCVHNLFkvDVXIP3bohH+xK8rccVjrn1AN2LCZVuTvsbtscrzOVUMSmCg9QZh/BDYHEVYs8LeHQ8X0BqFYmdT\ -MYTWBGF8+z6f0Oq/4DvGmkIaTbHF50GKaMTE0uT6NsUF2apVxokDKpfSBWgUJ8ik8sqiKVbvsaFSPE3l+RoqhSeSGROB52krk33GfM+db/BhOgy1FRhJBhnV00nFCp1E2QDWSUeeToKJ17tSseFJnhXqiVVS7lkk\ -f6R6+phgru5FOquPCir9j9QTOsXFUD0t1Rua4u6lKuomD/sxummPA+NXkh7tbaiiUkx9quQKRlpKncggLH14kciok4qOsLpY61GXNAsbnTjUhE3kJkGBwaePc47XY3AXiQsNqMZz4rgf8A+ctupy9g2b08Sk0852\ -6vvwUixEnnSP6uE/EFVejLShwCi717p4MaeDH31zEVgqpwB4Z0dI7nktuIxdmJAdtcR17aiFroVatiCJZEojjarMK6YpiRq6WL/MTFC5ug1puwkzhrHJNGFbBQt/0FyI2ThNOAxQefrmElq8A9S+51IorLiYAGR2\ -toSZAwR/Pbh8I/lWmMfOZ8vYIYae+djB4aeBnj4S7MQedjAlKq5ttiSFRq0UwpMHxSpL6g2nxdlubyqJnHu4FsRMPcQojv5igB2RGc+HB+Cg1Fnpm5Cql7LuBkAzaUOpkV7tCOILw2vbECbCeA2iBhhVv4646npD\ -iqOL1kR5XbB/wGVDWAEwBsNEU5h98WlxNV1KqdnfO0HqCVEvtlbxJQErMyOtmbZxfX7EUqSzwL5+SDPz3/GDmaeDYGbWN5K6tHW9pEjZMkCfDyRCz+kryenbS1aLVmBe1Vzh8ilfvc566tWIei2HXt9qzw8SHcWf\ -4vZ9ClMgkNnNS7XrgDH+V9pV/bna1XLdQscCp30WuML7M33vr69dDZY5F3+264fWcyG7R28nBqNMdkNz/TNlgje211i4bKEY+YlT/hMstJh/SpWF5mQJ1r9Nurjc9QZZdZksyT9KluQT9sZY9PjixHavFZQi7STK\ -NnkaP/UQyOWOiMPCbr3lg1aW/OCzf5H0aAHbkVCuRceMxQrpdnU7WtjRPRIGcrYKTaE9PlIEpoFFzOFBF8wSOyERklRo7M5z8JjL7A2mg6GYAwqWG/vhZIGudAnLzX68LtQrxX/WmUOErFGLkkW4c7qNDENJzsae\ -EXLWPDoAdSwe3yEJb0es/VTx8zHzU+UXg/JOpPcL5gnWr/Ic6xyVU+fxnQgfxHdAq2ZcLKhFaLl+ikaBnKkaC4ya9O3rF37VikRj31OA2jivZeGd2ZKgYi1RP9gIqDomJJjcCaGJuI5YxRJ4acWPk6Y7bHXx0ZVu\ -e1xdkTAQr/kfW33zHlbjKm9aPpsPyrUgn+bXLLRstP6ObjLCiD/XPaD3jlFzgIS+PMGzfjb18tXu7JZkLsEZb3341hkPqMpQu5ADMMPOZXU/n0CEPOmXkfyvk4dS+IFO03kfW67sgy8F+Oiw1g5WE8A+s3kxHwLP\ -MS2sLIy7ysIW/r1TznqgJt2SDJ0UvY7oAZXymLkkef2xw29QEq3lRVfdZ1y8T3pheG+D9qsefwkHGcqFfx7nEvYxzD5myD6gOCH6asXmBT6iLxAnuhBmkvoHSlJyYGssR+4kqUixOdYPwGeQMKgxlBGOmCwxn1SO\ -f4AvmF0E5nY56yIcc2E3EBJ7gfeAX8Zcvz0hLYCpmjHXYcs+xvOBNQaCLQ1SGaypPqSFyQlrLIFOn0gGjT/jD4z+8gIBwSz6jWF1mG+Gi1yloBZW3cZdiTg8AyRAfhL2GcJUeyIvod/kg669pVOvrk96xW/jK37L\ -rvht0v8NYKu5bYroNqziQQ6ona5BXA1YuWCU5+q054jFvgaDV7vBtnOSpyp+AHnZRv8FUIAnKWatqbCCqegAlYKyCcAVnZ7YlVMtv1L+ULuk9PQdHwBr+W8PIt6W+EcOXUDsYrLLZa1YSyQl8tny5QmYyQaJqgzP\ -bimmAVSt4o7JqvJYxDIzU83puJpr0DA9mMxXXNgigpbdBSWpR1TuWAduj8LtrbUCaqgrOksFX17wF+hY8bH2xo7WzMniLaGnfRFq6kv7/G8nizPeF+60dEn7p1F4gqWw60FwfixG9YxCO0bR+RYu/4y928LGQjgY\ -b7ztjp4vEPfbBBPWwOYsWwwcU4Nxilh23S0t5wlgJegaMjkwe1qwZ9V4Z0HLyehb72yUUscgQ2sYG5VnPH/GVRBy1KqLpMvDHIbAcv3W7NjtCgJU9phFH25NPhOAMtwuH1zX9fJzkz3gh0YAwqjAocDkHdZA7A/e\ -L/0LrsCtbaycsqHCjvdzPoBiLx+kd2onWXbjSpB/DQDYqJ0AnCfwikpGQsnV342dQxl6gZstkVMjZpx453u72fjQnEFHZIQR+w8/vKETJ1u7HYsrjrE0eR/m2q/6iGnPlLGERm6wK+dhvxkvD+ImyTpni8x62L/5\ -w2/N7iM+fkOnhXLvOJjliwbQ1M9loxg+JOaO7jFceIJCQQwQlU1+r5tdl/iT69iF+QGeXpZVQoOlAFDRHolIBpRcuYjEjsP9/h0WZRziLRUh3lIR4i0V4X0S31r7988MLyzpqlBV74K8U/++mNOQs1q9a4VI9nkX\ -QjA/xyfn8CznI5IoNRszuFihZHMDZS4W5ZYkIyrN2gdqPvsXLbm7iHp3IbRu9QJvOCr9O6zQFpRwFBfJ0sshx6IbvqenA55ZoDQhX1SpvR268jYfpx3kmgiHt9jHaLyEXpjbQ6p/IEyp9eN9BpTuctoTluzfPyFH\ -ebvHj3qXVOD9HMfnSwhzBVVULqKipSWZpYtgpt0dPU4zpv6aPa5Aypf6DME/11uPhQ9I5KOZYQ67NWmJ3xjoyrly+LsAZxmzjOXWjoo6T6QFnZVSQi5zBRxE93/BkTnhNjzniIis5MqQul5GZB//x79w12qyzGtB\ -sH48Qzt+R8vphSlVnPHhLJ11pRoiwSq4ZS9PzOMAqZM/Njvba6Md5MpzySliXQ2eugeLAg07qFys+gBHlcixvPc8LnoXV3krYd5XHuWQ7X0uX8Xdj+XuHfkR5TBszVIfMGviyUUDHm2+d3L+Fgj9rBPgGFdJWEZz\ -cFGzPIb14ewlFZhANBspWe6tOqF0yAmCBljESpgm3dpBFqm47IePtwpT5TF7XBrjds297qa3jg3cDQsgQkwZi2GQjk5O8NWHd1lhN5AJKaFkSZePIORp3gIa8QLhZ+xUNt3NX8FKQdH4pdDPRoRHb/ecy4mydIZB\ -FvV479ENJwCg73g0xpx5+kW0vRbs7I0ORUFFtVww8fcVCtFoUVzjYI206VVCjW58nA6Ac2eRufhby8UaVeEp9GZ4LhUJO19xRaC7HaSQQ7lyE1522ThckNtpgt4ar5PUS4KKRdO5lgzZbVCkPes86gwxcZzlohGR\ -YSArcpFcYFSgHMYv8dXbDD4vfWV71r+pDWp2sUQQaVHitS7T1HuGbmcu9195JFjat7BJcc+6ndrdfSW7Nuo8iFKSlGJiDa8s0Z0zblwwRRwXTKo0fK9TRYdCFrAD9W63DRu1chs25Uw6e/Ao8SIGcFRyCxF/p8jx\ -MR/grEI6w97gdSM8FNYkGxlzsuKiqFp3JytUInfFjAUTu5112RdUyKUlEUJuJWEr7JMERsen3eVL53y3QmH/C9b/0WerH/zGud+48Bvv+6xoBpcI5sO2f8mbKe+s0B/In0xD0h6Vb4U3zKnAnOdvmWN9Jm3J4Gwf\ -lO47nPmwCRo/ex1PVT697YF32Yo6qmQ3v6GKutW8aCVUIWf1sP6ugSsns1d+UesjOkyz8E7eL10Ll4gBgvyzvdfBPP98cOME3emn+XacppsU32GbFC2Jje7GDoIGYqFxYIX37rHxahu4yRIPpdfobPMFbdasuO+t\ -MnzfJ073kuYCv7iQ5Fs6e8O2XOVdnLEUzdgjAuDdNWLr2QO+UxP3khYg693uwiY8kdkcCkUQaF5IpXYZ8tyuoJbYRDVfptSu+6VkXxIBgFL5aK7BmoAzsfyxebojPEaZuu5mHUHnXBYiJ7bU7MmPIV/G0AzESrHq\ -sia6FsXKK9HJAvclGGmo+SA64E6lc/oD7+zJ/iJlbNphEqBJo/0uQVTzvRyEV3e960QOTGz8ZRT+h3eHuhf0AP6/FTJlzCV3TfjrkjQ8lMLgQ5GgO11o03J4tR8PkXuP4NhA0+DlB7a/oyAwZb6+66WfxcrNPK/N\ -yxJ+uniFiFHsLiBCo/4BZ0AAe6UXeFCZd623HE5RUKZVxzSYnBqcbER8WctSWkRuRiuAw8c4FR4ZiUa8sXoRGWcs4T1oY/QOEBrsjTdC9UW7DI/nfWNZSdF7rTPR3KvYe6gkimwNa7PgwpgmwzsFEjgCU4xHTw+8\ -i+zS7hCdIGaCxzAVM5AuInfyRGkw6IuDYw6n1JNMYmmRD4Ch4hd8Msm8EEq8yoyjz8Gj4y6Myb3aRWwB/LEPP8ROLlsCBWEo8tgCO2M4m2Ous2v8DjJLWT6/DpCl66mxzCDD4c+DRP7nBcoULr0T+9jtfpa7pr//\ -5dwuzr3/OyU1/H+n+L8kk1ilxnz4f3giyVw=\ -"""))) -ESP32ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqVWm1z2zYS/iuyEtmRL+kAFEUCvutEdh3ZTtKp3TaKk1PvSoJkk7uMx3Z0Y8VN/vth3wiQUtO7D7JJEFzsLnaffQF/31vV69XewaDcW66V8T+1XDfp0+Vau+gGLtqbIl2u69LfVDAtPMkO4XLHXxf+1yzXTg1g\ -BKgm/lljO8OP/J90MFgt19YvVSf+NvO/aVhNKXhrSm8Z7f9nHQqeFaDt2TGGuC9gTHmStQriqHLYAAt+NPdTgUYKdIBT3SFoaZqu/KiKpDYDFr0xsaiec3i/6jHlmfEcwEyjHi5O6SnOLP6Xmf3V4afVoN2JQW9P\ -8GeEoxrU5US8kkgqR9oIC7OkyFUZKdj2OLTJO7oII6jqxadNUTzFz340AWmGajCgrdkmjlIz4rcWZv08vy+2CKzUVaQ412fL9gTqcrV9TdJ0f0xpetsptmggID+ckA565o3cmCPg+QFZbQFaN0EQV5AlG5gF2gfF\ -4i5M/KC3woLvjRn65Vl/6Et+UFtgFf5MlFrVwXBwmQnrCN/UpPCmmTEJDfT9q5pVJ2p0QHfCY6zOAq6b/kba5RXtQKX/T607sGYUwLCN2cm39IpXBAvp8NERCnBg7DDsllXRLigz4yvT2ziTxvezmVyd0jC+Y9OW\ -lDhGqWWLBowRoM0yZ0n8ptWyaRHS2Oi6BRfLopvYL8pkHGECb5LsbGemBYhhbLL8A0TS3hGdJcYdj7UvueSS3/Bc2jLGwOSs76LRAuhKReBGFhOt4nUOezvnyWmQvJ5GhsLmjevHRuAQxMroVaSHdjwnmFHqMxGA\ -J9oTqPUcbSXa1p4BBr3a5aol0x2/6r61IqariFFEJTTLSDmsyC5InD8BT2ZY8n9K0E1zmZ5PHLk0bKma+Hd1+van8+XykEIJvV1zRES/PPYKy3gHMDY9ZJ+fkrOCVuvJJupBMNOw5xXhRFmR2KZ18m5ca+3RuIMh\ -3bp0/PMjoHIwHMO/RykQcMrGQGy6EQQd6JoicFM8PX2IioC5Q1JJESJLJchREXCaCJwDa9/CziAOJAQ2tWyFJuMskmD9AnwYkjRpqdaR9yXBBsWtegG0wKtBPJ68F6/cYWVFWIdcq20KfQCYuyUBgFAg4UAJogAZ\ -I96SEBsk4SlMAPncoYTQJE4BcESPDXKYggUM9yfqb4ccI5LxpT2Ng8oThGRQaCEbPe1z+ZiYaEMrKIHnKt6whF0TptW0C/C8Klkl5RaVyBzH5j7p0sZ3haZhOvlX6FQ8J92csxm1SZIDSQ2T8AwtiO91OWSoQgGY\ -myb9o1RKri/jGw9QFeL/DBDkG/YBQLF2GDJikNffZDs7xAPESM22IFE6lsnr7Cpe/yIktOje+vw7xx6fRrukw7StHt+4/fBWyc64wc8GZjwfziZgD4sJpa3oFLzrZfQ2QHRRdPOwDh9RPMA6oQzv4EbkZLVkLhmx\ -F5SANuz+eMODuTgWxZV/Zi4f4s18F99cxzer+GYd34BSf2M8rFTrTLDeO3arnSJkyHG2rIvmjOTUCHRl0CT6c/p4efUGCB01PCXKKoJIF6EeQZklMS5eQcSavvZ7ZNjqM9mIitbF+dvMr93AG3/RsgtM3l8gS/Pd\ -aCZu6ewj6V0zaEttRWZ2vRZ7zbv26vRXIxTw53momqgimf6IEfD+BoW4jbx7KvZ/DSnaIAQcjJ1oDKPgIsKOxjRv8CvE3wFxVW5o+X54f5wT7LqaE12kc77aLrfJQdIJ4V8dFwYOfLtI5h+YjIr1C08eBd1WG/Fm\ -wYlZTclTIVkm7u8HIlOWNUUktM+cc1QwjOzZcvWW8tcieSFA+Irr20nw6aLhNXLKNJxpngELP+7CEqAJqLiT16QSyEHAuy3q+FdQ4IAUi3jAwtgNTKgDUODr2TZwqEPeg1EeDfyxlBul+7qPY0rsnv5wenhGfLY9\ -CFA2pAyqnFEGhSTgRoUmBtYT6dNebdcrBHG3XLfe0GrWqVz7aStyRUjc3niF7UUU0qh7IomHsNCRRJmISBnqoc/veOmaMepSss/Zh32MVSbhkKU92tCVc3T1kv5BKjplMoAtlsRZU6xTZNs+tl222PeS4jxgH/k3\ -lr9V3brw1bBAWOPcR2Ck7m8kvIXgoymc4uttWDiCmKpeDPOEbXxK79IiL8glnB54j69ydn16LjVHvSMXPn5UGPb2H/S7OmVb0u6wl9RsIPh7exawTFAqSHBIKNM0P5KBA+dxH8tb8fkwZKBjTv31l+2YLDVKR0Uu\ -2+iPJbRVZUGu5NIZ1MsQQF1CySHGUehQQFcOkYJdLq7g4+VBaSXLV2nuObloEMHIkHqgJih0DHdxZOpwT+57yOBd708gCqZ/kZS2FeuUsgKdrTrSXnKy4LgGCnqcHB2CzEfcG9Q4aQ8H9e3FcjW+2KWCH0OAy++I\ -gq7ZxpBBeXtyyxfYpToGGtfHgwYvTkcdJtOzi3k3c9Hu4dHFkjsHVRIiGUR8MlLCSrBgh1v89XVvyHF8mLsGdDghlNZJNwFCapMQHWAcfKyIxnEObuA8CrLqtqM0dEKb0w85ySg+KHVnF81vklxQJoDGkt0NGp7s\ -OM+g8RPQbIMol8x/Yx1lGPCaExz0yyDcNK8DXYdIOH/YWhT2lGKWYJUiJ5ZAmc1dGHdEjyoO4l96EBnFioDMjZCchyYPrFd21psLDHL6ZmWje1yp7JxY2m+YHLL0i0xfru5sABPIC2tOjbrqPo7YbY2K1u0uV7cW\ -dxIP/95WFejj0uzByirpK3IWtBhNUzRF53+PBrUMvifmVNqNcu3ESV+i11FVDxPS/oQFdw9QH7di8HMybV+2nvWeOWEwDWaDqacaX0igwYwwGXALL5WmXgIhgm5rDp3hgrMhhqzYW1V5XEumuODStJK8uP3BNuUL\ -CK5GbyuJMM2dsAFX/fRil1oFqFekxH1j3MSjEcoPfyfXgGWD0Ksr0wUZbVOPyDM8WhxThoI9toIoSfe5Tbuh9WD05UbWeQDS3XIoheKo4MTFo/peqCbaVLztEy6opdXU82AfBf8abJtebCy2T0W50X/lukbd8Q7r\ -A07vaXkwU4jgLuox9EQ53SqK3RRlwXqCrc+uGQbJtGQbGPuMi42THThnqCt439CgAF4zF9FSmh+1tDLpOI1IhAIvkprMgVOetum5jUysewsPfPwY8QFEnQxEiuSELIJe+cLLmlcQtkfBviAkFEpa17dinevIni14\ -Rfr49BlFeS1xveOPuFwhy6EA62lY8HpFWSIAeQ1B19acCODBWEXd4lqPqyNMCD49JLqAGGbyBTWS/TtqnRt6S/bEe+oq3sMMm6ZXYPnrN0B8dERxpYHE1nL/PI6fVt3DSYRkMAJVkO6aflupoHoIoALrFkNteRzH\ -ExB1sk+dFazTICBNJcZzVx3maj2Di4E8yiIbo+jPpp22U3JODLCTo44HrTAMeoBWFk8fsBT9ibNSTIQjdWHqnm4qbEWIak0q42ZBTVc8FUowMq1/Bl5fxhkPzYkdROddgHbZKXuRgZ03/4H09hUs8AysZMpmaWRv\ -6y5wetJXrYHOj2K03T2WFZ5KrTTqtcXVJkEM5E1UrhWgj16MWbCD1zPwgENK4ez0++XVZ+poo2XUkWXgcZalQhO8D/YD0oSK2+BYw/VYsVyYQt/G6fWYe/wWCwBuXBfcuHDJzvJ2lwxB1VEvu06eYBvrM1wDfmqE\ -uiLudxcW2ie6PCYDcBz0yzylSkG1xwzNcYAsa7b5u5o/6GxCwCdH6RbUQoyv1rxaj/hgELSIJUz9Ce6+BEyTTwmgssC6pQ6WBGmyKlsXpt6CSmacRmC78hYurmkZ3c8lXLZ4E87tsAqp5REp2m/HybfPZzSm09gG\ -MHp6VuW8omlPmu4pfbXm/Ys7XPmKWYOYBQw4mFK4k5xudTamxBtPdkvqtmE5n92HQkHnDUUgnR9yXKjXDB34uHXOcZQsFIdEtqmvCXfMZNzyTcq4lu8eEmwQ1VTr4+biCYgjw6Q5Uzm3GDHkQtoDdlfatsqS+NRg\ -OTU7QYcn45l/wgS7Col5ju62G0VDPCiq6Vqc0ZvB3h2XajjtI4wDZYRalD96rrIDLBY8MSnWBdOqBLn6QW5TvP0456qs7iWviEHgptgKuxwFRzbS6qp7xb4R/mFSxclEVBuKb89WkBkIpFNlp2YnmMAd8zEJKuqc\ -W44MXDbZRAuMWRM+KG3Z3QQ37LRGMlaYaAAfeJHGOYgZjQjpMOUuXXizlPg1OYpLU+g5cvwqywFNw+47M4gHT6b+V2jiYOJc/0mhC3l1FXs5HhqpYz5chdQPcmFQquZGJdiBlUO0+PzHoo1jAfyznL7ttEdae3yU\ -kol3I+juEdCCFwFQF9OXW85f6WUQ3aUi+pSSAAMO0d8MnT3vnbSBH9vXfKiZP+dGsiWhjMlnp2AtZ5xiWjGyZKvy5IuOazzdPIqYSbi9ICCNKcYgsnj9GijfvAGtX+I3RvbmHFPvT8V6V2Dljk8UsDtwQIxiKcje\ -UWCYq78Px9NO35wTz4Uc1+ofWDEV8V7yqVQjFZahUz/Mq2XMSW3S0egvgGel2YW1bkj6SocoWrBxOjz935VzXx6ggFrA4bvhJjlko5i5lZEXFtxRL20bgdXqOlB27p5gBI82uWKWl7R8JiJnL/kWrU3fslUy3yTH\ -J/k+AcJ/U60tgUxhPE+20echd62yMZ8PYJjNCACLKZ8R6ZR9CS0uP3s1j76NAROxbRXzgTQMXMOA5bYgNEcCBXN2OX8fcMFyryhMsGdv5o1MOB0tUmI1HP6kW7BMDwRAv9l8arTuD87/0a4AVp5xHyEs8vjPAHN3\ -S26polZG9pq10Tk3bL/kk4XawuFR+FoL8xv8iCoJHzYY1qqkSgo/AJp8pq5pyB93abrKd4e0FaZX426cp6vxA1kXfXUohBtoWNGaw/Zcfi98mEWs4ewnfHi17cy+ks/0RLSs8+owsNLV1d7jAX4u+s+Pq+IWPhrV\ -Kk+niVdi6p/UV6vbT+2gnurMD1bFqoi+LuWzjT1+EhOaZGo6TdMv/wXshTKs\ -"""))) -ESP32S2ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqVW3t33TQS/yo3TvNsu0i2ry13YfMALild6AvSwuacxZbtcvb05CRpIEkp+9lX87LG9i2wf9zGlqXRSDP6zUv9bee6u73eebRods5ujQs/A7+fzm6tVy/0wC+1v39223cHoU9sLo7gz0b4UIdff3brzQJagGQa\ -vvXVqHk3/JMvwmOVh1+YqktDSxF+Sz0bDFzSQGfD32JEJLAC5AMF54j7GtrMdSBn1HKapAcuQmsZugKNHOgAs3ZEsKJutg2tAw/fLQ4PvjOHB7TCwC2MaSeMBAbCrA6ezL3TE/qKPeu/0nM8I/wehFnhL/9RPyeM\ -dLAzXlbSECXjaeFxPl4UMtOovawmjFXpz/QQW3BXT+/mKwgUP4TWFBaRGJAjSGG+CvgdEr+dMBv6BRFUdWSla9V++Slb1WRBY67Wz0kbPG0zlkcb1l8gID/skC9EzhvCijsGhjdJO2vYchdX4WvSWAe9YOthV1EE\ -WWgM2lbzu3NJmJs3D49NaLQV8An/ZMZcd1FZcJqMNwhHWtrtvj9kEhboh6GW90320APdjNt4L2t47qdSrM7Oaftb+39uuQcNxgU4VrAq+4yGhI3gRXr8dIwLeOSqJIqqMkoEOAhe2gM5FUqIuX4/PJSnEyKPYwBA\ -mJocjMaKlBYMB7ChXcaLCXLrRG4KVCr1POBIxat3+lw06Z6CApaTCHfUswI0YY2r+AfgY8NB9BWtwnPbMMinr3lE4LJqNNylj6dHVE2AR6mO3Mhksqv4XIJ4V9w5jyvvlkpXWMNxfq0HHrGrUUORHqryimDGmA9E\ -AL7YQKCzK1QXJdaJDsZ9rc6uBzLj9vPxqGtiulWMIiqhZqrN4Y0cg8RPnwAUHIq2oA50RCiajQSmtE4OagJioX6EsAtSfJc9pBFTHEL9w/MHep2nOGVYSk5GJ2gzCEiaUQesQkuN7gpqUjvGHyIAirGpFlNOFwMd\ -6If7WrCpVezq70gjX0PDMa4prY/fV1Pb/QDxBbAv5TFmThOssbHqxCvY0v1ke3sjvkczPDlvlUA34rYhMWbUO9qtmj2FRtlmp0zjyHFgW+pGfsHhfTVbFx0UkEddqy1MmXq6y42eNEpLNkxxPrbH61ZNu7OrJ96K\ -MrDF1yQYPMeVzLoXJYuLt2iN+OTIEef54aBXCYOL4xG4rYOZIlvmMgJHB+DoPR07VB6wTHWdDOeC1tu7LmqsK+LhHilfS+1O2an5NgznNSUWvB5ZIhReMS/hS9uwGRWTKu1+RZs1chbUICaFyowEqgmBdis2jgVE\ -HD4STzYdHy95t00y+EI8V5+vJxVn9YIIxXzi2slJqHN5MgO0dHw6cM1Be2rGaJDwaPuy+6Ah4mFPXHE5+6gP4de0pFEfwxtot2ncOTnj4qj/dVwJzwVZkrZdgbIaA3qbbUdHyzMzDW+WSavIXdfNKVZOfXciiAr1\ -BxnsaUaDHWZBR/r52E+aYr/3l+qkHuEEr/NnmSeQgDWaLJgmm//48tnZ2RGfDMOA4lvx/L4ggdghyrnHXuWS4AU0wi/nTjUswua8MRlLKx3D0kgC4u44/yhhhcv3vtsFKo+SPfizmwMBb6pBVS8oaOtr9OJUnHIo\ -zlvDKljzU1FH09agWBTuWXTcFsBJtmBW6ymr36ACeNItsBONWH5LJ0lsmHa1Eb5tOLU+U55eGv0deZ7EaIhzYOgnnkcjaNpGvV0HW7W5R0A48w1AgfvpUQcyhq1QJZqMyzqBDrAofyRhWqqjS2yxew59JYin62Q/\ -M58e8QlJ915XJwMMPxSzbGsR9XJ9GBWj+9f65e0LFrLzVyxg56XN+JfkxWxskDAguLDmY/JEzT/X0z6PBpUw5tnnnhU5H1sK6bZWkXu/H0cJWM34mR2Fr5NDwBNzmlGMj94wy6RRowEcwNbr6HXEhzKxmEhp4hiM\ -RQyJgjB14gOB8xlW4ddJ5a2WxM/65UK/XOuXW/3CLhSi00Y9SQk0chShwRyjih6zJvKqnWviNqA48h9g3ccImXDIkMhzFcCCo847bevvwSVfvuJThKbSKS+g4P5mvUmhY3YZhUIsvX/+A0esxfY0Fjp8R9bTMlKI\ -BSKluLgV7SrH2uXLP4RJ8MeBDauyLssXCMPvL9l8Dgm0LYlUgoyacsETASK1RQz4W55RuGFAhIRbwYDYzDzj98n7L0o69b7jvUM6z67XL9uVsNCMTI6gFnmBdbp6yySyiMkS09aDG6tSBpGR09BYU4AErnXtle0v\ -WGubhkmF1VYla2PJ0TgAVPElHJUfYZdg6BNxmL4nzRCNol39QFoAXcHu+WUPo92LbVg07Am4L+kr2hwwo3Aoa1SssKcN7CnqcM0RMgPETOhgY/toLCof4aA2YzjAvgIHSxKJqAceDhHgzCK0B09Pjh6DJzhENY5N\ -Qnp48ulgSMmghDYVpbifyNpjpgS/xNStOzw8mOS4JgkxRvqdIcqAaadJR8fhixuZh8NRmm9OHvMzJlcvNld5ZIkHhbO4dlkajmlUuuiMQBtna40KpWsdV7ccbr8WHxjk1OXCZX7Bzcb8IgbM0RElu2Yei+/sloMX\ -/XfpOuwdRPDgHnAHovr2Uoh7eXL5Hj7d/ip9zY2Mz38deKFd/HmgXnAEBhGt4CEc1KQ+O1eg7FTyJurthgCxpTBt8OlxFKwvfZKUKTkF6I8NUPCEY0a7y19QoTvpcnQDotjAf624n/v3Bi8JaW/Qmeg7jJw78kjJ\ -S92Hs7zBkUZHa0TPhHuhTYAKw+AxdPOovPKfklGN8fMckgiJmkpBNP8qNt2+/+NMCfSp+jkLSHcZfW3iOayOU4q+/kj2hI0LgN+Upv4+Nz4ATv2sgpI9S6J7ujd4E8qhQixuBsOC3vOPbEzadZOgnF4Q1EGDnu3B\ -2fmaCYEWuNjTBeEcbo1i1na2kJS0FLx5cJd8Bi6QNZJ1kzQcBAZouzgSBQ3AadbIHjRf4qHWbvOUqrGxG8x0yss1Wp9qv4Z1GhucGwvI3u1/Ac7Q8v6Ks3HTGoTlmKMbFpsKMfLRinfs1+r0HPVMToTI2zXKAnuu\ -PLeqX+8vzdsvCez6ntO0qkxXMl1WPgfCtWZUHCuZbPWR6WbiBoGlC6X1k1G6HBhTmnDsUb7liME8xn7cegetyRFoTcLqj0mr3TuYEj+0kN55TgGX9eUNjAfl8l/h4yZGW1syOrviByptQaHlIln0WAPa3Rzr7B7r\ -vsr1IBtuqgqg0WnCPACk1nnEJBAj4S3pPn5Po49BbFGOijjb6EVA5FJhLQgk0CygEidpfhhsU51CCkpUdeNsVtdtSeNWnBecrbYVyzzaWfAvbzhDltJaPa1zp/weAgiTrrgMBoewuFr0qutQ+imOMc2SYH8sD6z2\ -MbVzzBRqNNeARIbzae1SIsZtZQg0M2DgGsfMgEvZX8UPbcGpI9zIdMUJc1MsuF1T8crWNNMpxPLCMxRyBocIVYp60moCG4akajURU7wfmLS8q/14V58zU80w5I2a1OpJz3ZGpEmj6FOkuXqucv+De3jFKc10NPc/\ -I3O59DCjPVjowXY0eFNqAbnuk0VGoIJipT0fse5V2r1MxFln6Y+r448n3UAHAV8wVQb645EYRNjlHTvS/obQCOKkTqqDAE5w5Jxy2ys7fx5yi258XE1zQ36/w1N5yulQjGVnJehEsjoQLblPyLp5yUjAcca6EnoD\ -CJr7a8Kspv4bY4pGDggyZQ140qq4mTaFYe4h2ekOE59baxDc8cfic830NgePCn1BIA0qYQLyTq/g3+wCztYi1hub/JQ9AAQZNJ0XCX3DmmHNYZ2LMQCG2JDmwgTyzMycPoK9veIgF3IeuAGG694lH4AiEqPC5+ku\ -cLGK0UjNv345zlVPpmpUogjUBo6BN6qc1Q0s3DiOMYo4y5A9V6u6XjtRNV9T2Lya/URf/DI2J0rvRTwMTpXVvR6SDTUKelGgKBXIGRCsDHq5HfMyTiFJg+XFTOqM4NBXjarpuJmCb+sET5QIFm073kykJQgzjPVc\ -j2gqNZzNa+NewtHY3KKy/xBal5LpRBI7UMxY/f5HPHlGYGGCOUMx/xlDvvgVXYAs8rPYJR4RMBC0Lp8yCAwlxDco4ft7GGnzOaox2s5W57I7X6tRmAKh0rlwUtzQOSL5/AfZ+AHcrk0CKDBboJYNFyf8pFxWwXxV\ -FvPL3awq955rd+yoAp5agDg8tLC2poQV9Kk4SkvlmuR8RMgjAbgdPhURY4JLdas/lQwZmFa/4Jy7W7cEG7dmWIorTsUBxYtZw16xZUHd/P3smqvoFSUhKr4uoE6SuyHEIRk/lSsE6Ibvvl59M9hbKigwHyLKaHxg\ -9NdyCeAdeNngNIGmePc56EyGOsNRxiy6/J1LHOcX+yQKP4ZjmXL7RCY7lABycxwVSYQ9Cp4LujKkEzu1QLtClRuG53T1SGWA8iPChCoLXH4gfAwbfSUMVNHCgOxaDr89l9qqds4QhAzQj4zP7h4Xryq5bFJzSI75\ -QyxKb+O6r1RZBjM3fnEfHRUMHMGy17pyI/ewUJdBL1ARDOdDfc4KgzF9f8I+hMYYtTereyM5aFTZwDjxNwY49/J2U24PbLyHxruYKxBsgwAFPTP7q7pfUsqqxgdbtM1xjrjh0wEHoWXkW0jla4QaDnACTlffSXuF\ -ESAUtMp/fEu0MKGZay2o6i8fDkW3frids//u9s2T5A6DZeClX/wXBuxTbruBzBLURSxXLwHzSQR3ePsRIHRISOKaeua6vsSUzy7nwItE458bUtUYjF5iPlBIy2HEBDsWtAfGTRkvgv2LE/HhdQuft/6NjtsLcFiu\ -YqgjoGP4lpMtD8DE22X/1ciL799E41vikrZLFUhwYoTDjBgl7nAKHAkhyN+ksbweZDzq8Bl71ZJNGFm2Fjvb8qm85/T+jh01hJjbDOChXn6Bi90n5Kkts+fst+sSOAfUWMnD+AqoG4J7dPaWDNZ8O3FUgaXo9IKO\ -iks5cEXLar9Zk95IKc+D98js8bwDhmGt3gvYhk0yR15senRbaO2/xHCiruLgGGUnOviX4HoBDws+hw2dQ/TQID3itlAHObuK8XP3x7kEWNGn0xVd0np7Lxkv3Dw0jAnfGsAApOA9LenOjkslNX80vkolKBwckh25\ -TMC4jMpiuCSC9g7NoegboG/Xbi3WXCqgkbAfPpX9yOh8O/twLiS6l2TEeOfVK2R9PwPoLV25wHzKHuWUdtbbKleKnK7WpUIm/kYiHF1xDlVdtDUEzqrW7jiFXfN9rI4qXFf1GV4gx0JwCkYwd9tCp6SCE+VC1pi7\ -Ds2dbB8ZN44gwbHr+FpVrdrkckbFl1YoJrxHUYcEh626a2DtGjOKud0GGAUJVjZKvJbThjcpoYNEMY3cmsebAO4o4g8Us5ohvV4ZSoeCN9JUo5v2irb378mFbrnM16phlu/wGDtc8Ei56leFB/C5l08mmoqbh9NB\ -GQa8KIR1EF+vAAbmbotdiY4zuiQF6R60vIPxKPe+n+fmnH9MpBt0Ul+JtimL4+FKgy++m36qiN4LNFebYD/AX+iWWawVYi2w5RpNyiowLWl383YDORiNbRRuWA6FqnRLXa2KQMkl2AkxfJaCBlRYx4Q/dvOskmL4\ -ED/sxmvtqKt42zxVTknBVtgMF09gxAdaO37tOP7EJEK5nfCaij+5kmf2NmVePImJEO7BTaM5xfh5RDLWUmINe/M9XT3XMEcr/5lBllaMhiaRlfFe7TxY4P+f+fe76/oK/heNNWVWmWVR5OFLd359dTc0lstlGhrb\ -+rqe/Hebvj3Y4S8jQkWaGpP//j8geRE3\ -"""))) -ESP32S3BETA2ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqNW3t31Eay/yozY4wfmF21ZkbqJrnBDslgks1dQ4gxrM9ZWi0pJIf1MWayY3thP/tVvdSlh7n5w/aM1I+q6nr8qqr9n511db3eeTQpds6vzeL82ibn18n8bfMrUV98eHB+HYrHzdc4JjviUeb8ui6an7r5Hp41\ -A5MJvXGu+WubBxlNhGftDEsz2sHe0mB8mdNLD8+TdfOQX1YJ/U2SaTMi6y2Bo9LzhpUKxjYLmbIZksSdk3Y+/DScmaC+xFHwJn4hTqeRTd4Rt2ve1b7zeBe4nTQfXcOzazao0uYJyGCp9ziKHADP1XJMIIvIeyuM\ -SjNRzGpk+rpqZGZhvQWsA8SazoKOhnUl8hJfvX2p+WxohpnlULhrOnub3Ds9prc40v+ZkcOTOJi0Yp8MDgA4FHJQMkG4ajWNdavdlRl0Sh1Rl1yPPJe+ow/xCUr49GZUnT41T1NgZZbAmcKJjGpVckj0VkJsM645\ -DufVEZdKaqFPlusx1KWqv6fjv2SVluQd/GMRvLK2hf5+eCifjmEvnuMW7Woi9aI10gnrnW/Owcybt80b17BWeVJplHKmWMt61uuYG6uFXqR7StvmPJ3F3hnpQG1tZBt+QMtNc8rBMRf8rJ0U0jOe0VDpCm1X6bP+\ -+asN8Jx8pEY2E6ni5xyOa8WDF5FzsWFvyAXhc0/MR8rQPAo1Fddr9MHAmqDDSfKJFoA3xoMvW8EkrXBa8S+0XN35ul2m+/yiO2tNRJeKUFT5AG+UcFiQXQ08YJEtD9ftJ3JNZolfMhIPjg4/ksECKzpcRE/WLJfk\ -5CXNnbNsf9blyyfRE+DQZn4JRC9pHbA4kIR1R/ALFNdNHb1Dh2FgY3YntoR4cMA7e5ia/eZ/e87nXPd37wzsak4c9Gb+ZnbyHSlolVGQLXKmeuCPvyS0aj4kAMNXxj+hE8EGovFd0RDHriOkZoh3z0FIKK4pCQlG\ -l31hhcAkWn7bJY1YBuYj26G8i+1mlQBbg3tlNwpOJ53wwZcjnPcWKDjWtgvw1Ko/dQZmYEQobgaugrYgaU2IaTt/SDN6B6TXzv/k2uHPra1+0HhPyC+G6jEZqauRveNj/EPug5+9PO5wjn6IVdGH39soeBSJBoEX\ -KaOM+V0MsXYvUMPW3Sc4YzkyQ6+46L9fqYHLGJ1jeASa8PRBynP+wWUnHFFT5amr4f4AghLTRZtDu4zCrxMBt0X7Cca5Ssl0GiM2rifYihBnC14LhYfGHV00SttBZCcc8HuHmEYk4b1SPX5u091oP6B4EStVMarC\ -bONl9x/u8qZCyqRHSsVywpV+oMN1KsJZieQ+ZYkYNGaOL1XeIrbGOiyEQzfjEGx5RjBiM3zYjg4elQAgBLgbCE6wha8PQRqz1prI8p3djlwN4XbfqYypDkhPQJrJ9pWa2jEU1jqDlCgNYh0px/T0/IpJbt6UBR8P\ -q3z7PKxIpppWqybxUshPpYhpFyirL1P4SPKPNG4Ak+W7KWYtauW96sVdzPqW2e0I9fRQb8WK/II+vWz91GH7iXApLAR65hnzgC50JDh/aGgUWlvvUMXToOaAPytJ9+7yZa3lVsy/UUDffsGLjUTeim2qLJGuC318\ -wOH8Plv6nAMfaviD1H/ZeTkbWSD7QqyJeoRU1mzKOKCfAPv0STeZGITZsWBjeFvJJuo6/uCAheRnjnFEA+/etZ9IMVrHN9viJAkElIITAJ0tyuiKCs8O0DJEAYsQYACnjkCgAiPY4pyOD8kwWPdMtk32wP4nE85O\ -CsFo8JkNorBb7IfwJShewQAwB1R8wN4DlL54AEGAAyMq1t/Eax7yG86MOsCsuAOYpSvio5U0Lqdn2vHwYJqZSqMQpTNrAV/zs0qlG6afvSLeR3RWkMr/6VQTEwCkQxCLE8TSnNmEziLgHk/gy9b+7t5WVLZKSh5i\ -2I2ClEje2eJkzijdgXiLM0CGb34+OT8/4sCNLG8LcnjXwEif0Yxk8e7er+yO0206pG6WfQ2rNZ8C2n7yChSk+VVk/+IjTRjLqCNIhknFyZq1DN3DyW/Aa7NxMWeplWTVBfsp9Fecu6Dpg6WEDIoFRTq5bAbkkxeN\ -BBgqOUTUj37Z5qS1Pjk7UkhduTjQ+uBA3OI1HKNx1G8+fHRekAqXjHvgs+TQGDvhdI35HQh5S4JoxILuDggF/wRKKhY6TLsSUp8BxlKe+C6ZoPotRjBiW9gLj2YcTxZ7L3fhAB/N9uDP7gIWCknKS3dd2SWpWO0f\ -M65W9SOscDSaVZIOXrefSBsrsu26VsUhg2Y9AarmknQMIONPaJNsf6DkhWTMhhUmjQcn7oqyTFJbn6siSRptVz73KmgIfoC3XtJeCMQqY4gay059co/QUT8K4DHXYymNFSVVTtalkFwgX+FIymeprv3hE7Nn2zzM\ -z/bnydei1unemTtuIcpDdEuoX3Lyy/FMKFZgz/QXmPRv4PyQvCHkxQgoAj8+3OCfbDqlIwHfY5K7TpWVuXXTz3Ux6wIN9El4xFCVUx8CGi2axDgCCq+8UuhlIS1yN1+whjrs9zcZsjCEDT/MDtGKT7cIxXmFugs1\ -GyzaS+hxI3SomhQGsELmbJOo4fQIcQ24w7MMYwf5Xh/eO/3lUn+51l/W3QOHzMZJdWDqY15lfP1aVT+WhTB7AhY3ecFoCbEBqvYHCUVPuQyD0Pixymy5BFMm4/iRbPVDtDh0k/aW7CF2PB5i7PjISYGBzLu+XHcU\ -KVeINUdvshaVAgfvM5XKaOQu+NiA0/yCNrnwRmWbKYbKz/TN6eqjofnCDPAAWZpvs7jGQK5k/4pCRsMMCHDC5JiKcjgBX0GsgPlk/wqtpIz9azEA6Lez219yOqjAZWUKmlf3iTLD/pbw+uUfDELynBwK2HEVeg4M\ -EePqPQOmJLp7J6mmZK8oz4EbPW1meQqAgPvkUNDVZ++JpqKoovMHwA7lBqiU19nTaLfBaoURLm4pPrdFaVNsVuIlPpGZupwATkhAaxNL4shFgTckMihXeFbBuoZAD5KGzdHkmQg3wKoVxTGJRW4Z/YZPtN+oIqZG\ -e3KxEWPgpV+OdyqCf/z346NnAOkoHfwOSMkhFcTAHd5yqEvzwxLSQnjVomH7Foif8jiUZQIDTOxPvpRnsQL61h4yJOgkMr2sZ/BsgevuqBo3VWN7rSnLBRfbCVaHwwXj5iMvsfEibVH8Yhaq/1gnXeJFelE2OKfQ\ -faDa/oRO0lI5cLdNsKEM2Kbe7x/xM8xjDX65pGwSyouG34KxFPTsgNMh+uRk+uL8nD9iV6RQdUle9rrNBIhV/vKO9AwfA2CoqdwEy0GAbrfn5wcvOdxX4R8UBHgD0IsQG4IXM5gcvo2mr7PkTu84ZIwAQ67iNc4C\ -Q0x/nOXgwmxF/LbAGEtcBjFkHt2dt1xdLcH9lFP5YATj799rURwuD5V1OFssq6eQ6lYtNjJUTcimK07bwCpLrlpwvbHNZjgOwMl2MbrysIX6bCSD55p0LB24CCbDGJg0X8EWL1TybR4PEwPcizVXiMUl/R2FYnyf\ -DxfqTB6ECvDExaDpPj+ZRbS8F5GKsSp6WRfTRuxgpib6LiluQZJVqOeqwhJUxsP0FW6MPiNq832XSHgFQK0ap3YdBelCbKQGP4nkSdfV1yMbUy78gvNXM9icCuwjm1tOHgfJnqEYMjAilw6OICWgCBEFVC3MARia\ -RDoh0hqBJMtzcT9hpInbjFTawEotH3bJpRfcVT0v1OeqTd3bmrOh8DhgwOJSz/8LPO9/B+Bx+WDF1Yakj93/0amipLIMgdXsIzk4Lz2nsh05O+61o8q+ZX2OQMyZcdg5fP7hViCC7VxIgfqZ4UqOxcQ56dwB4azc\ -FuMb2cFB66K5Hcka9K0Xll3KfjzQfoq6Rcyg+ekNPJ0d3ZuxBeAJ794AF7OjbYAFzwlMmZBvYCYoVHi6oUWMgD1TywLzK/5AtzbAmC9nk/pbkMTuVldb91hVVDpjwmyGO1ZRSNgrLcT731NeBBwx7UrAnjaevhH5\ -AzjkaiMIuJhAWUjuEMBkY3RJncKJXXS9UQUpX/twSdAR18+kCHilpYcFjx0CjliExNJQsklf179KysNNYLyusdmqZaRn1QfkelEjFOLhVhpI2YNOrfspz8QMOKlf8ddK/GR2XxdA8bBa0ijsoittqIMDqjfxOfal\ -E74f0Sy6JQRMesX2yGcd9ym6IiiW3H0ED0fn/K0mxGZ7RMVfOUgOyLRVJJO9UNpdoWZ6inbWf2KFwUT96q/sanmlaa5FgBrYcsmk7O3sW9IWMiLpjpjq2ab77p40Zhd60FzRAmmjkRcLPTvJrlVbM5/Fbg0oDVQh\ -1I2vZ71hoPCwEAZo1Bpsg0HunN+waYaNOCC/XMt1pHSyjZ+3r+NvhYpsa6oQWjZgVX/AkFPuC5Wr73sCTcwppDdLtlmse0vTOaQUbCSRM2NN5/L84vRWqja57M+TUswHtz9GqOlrXe0/PZ63o3iPsfYVwEYzX70S\ -2u9zEqmcKgg9oNCvt3axlJlP4uWlYnHK930q8jQO4+3pLYe2jCJxp3MOo0uoYoejDWWAhgoXF2MNjXwY37C8NmdZQyW2ThpvVWJVQHU+MdMaKWfglR7OwG0W+7NtGiXhJOOkAspKdGvr9DXVw7QJtTeekCcYttyQ\ -8zKVsBVUr8DrdpMhV9rnsH+/1UlFpcJaKG+ay4MNz1D3GLDbUQ0Zd4rxUt0/QDFW5zsQ+pf7YI+xB4mI2Q1PLbvz1LAyUfZvaeC5jJ1U0k+uRgivfFSpQPbCTqNMVpsRjxFabU6JXTfXox4ykshImKj7WI2AYlH2\ -W8eS+ZUsZEu5cLglCJjbihhr6xhK483gsbUwCNp4wgXnZNSlXFxJ1ikMpaoyLNNZSQr7M/iWrW40xyNRV8M8ufB5I/q8/hJlIfskHoKbr47zl7r6/8gK5L9355GqyS6sVEk34ANXjUp9deVXVIwHe4gQ2AI9YCo7\ -X11GGblMTSSvuNbEZBvScTqr90jJaygMbZE3R83ktqvjq576toWDLUFTpN5X1e3dx1u+O8RIHWKMgVhgca0Ew/QOBHHBTksF4fDG50aQ22aiXmXx0kCDLK/1q5xdLTZoLrl7Y8doN1EmLQ8hOxPDgoykbIXE1z9Q\ -9z6fY7rxmu5ZOr6wqezIbugaDencCymBYhKyewZi/ruqWgXuUDEtcpQxKMP+3ASv7UeIBwAvQVMCtO8LvKUDx4XpQdn3Bp+5Z3ZxuU/HEbLve8kVbnn/WDb7VvL/rW5qaEdcZEKwJlblvMRC5Vc2XPFIV1+r8t3i\ -iCC9mzckfqKOQshiX8zj1SIJyQ4/YOHFs1KY2yE9DiN02obq3T0qZMB5hPaWFF+iwZo4jgNbxuPSTfoyPcDs6wGCOcyiAfn4Sb9oE1ivQUfA7xupiRd8OdRhVK2PlW9N1SX6KKnVvc6RaAeDcp6escezP19vyQW2\ -6St4eMMcBJVfsN8N5meaJkpW2hahtwYuimcZPpVsLKAyBfpBO59IV7XjPSz4C/MTbCHPHcIW6JTm3/wvOQ8s6iy0Tjj//cO2oRu9xv7H619/nN1g2QBoqSf/hQn71OgooCoICAQv5Fm6/kOncIO3prO1QifIE7fo\ -jf/wDdC4yw2RbKb9oJVSBa6Vf3Bc7nPKLLHZQneihO4kp7v5219zR4bv6X8lqeJjRr2AF3ylkkRxRJJemfybDVC5oHwOThBzF0kYMQEi0KkSF7gSgScrKVknuVn9wVnJxTClWn0TwaEv1eFRZmPyF51sw+T/ZtzM\ -kiGjv8KITuG8mjKvdIuZsgfwkaixZm+8rgV0ISpTn2O7XW5Xti03xNBL9uWWPEGn209J/iWZjk05/8egO0aC54tGlVWpxchdC5dHtkvkF5tsHO0jsiFI8XtMwNw8Toy1ipmukEiJAu6rFBM2y4LMErMYqL3Y6jgm\ -L1g2q75cb2F+bJ+fD4zgg5QEUXoYOGd4NYird5YTDSg72FR6LnJLKO3flmQ/XS0fyZ3UKXtu+5SvEDmSGtUfEg5yYMNVIZcTqu7/7HgaajAHFMnMiav27tAA/P7A5UG61OJeISP7c/DMeZONYQVqj6twSToW1C7l\ -zGayHzQ2THI1VmvqAZUrLpeL/3GrTrVkyv9HUEoDuODbX+kN15zxwmLijux9WUE6jYhZXBsMt+V/dijoyUWzkrvgRqJbQuqd8MFiLldKVn1AHXXJlEt9pSUMMy2HCUwBtHm+bm1lEy/GJi1PGOBgJMgnJDGceXsU\ -L416T9PI/4IxQ6sM4w6jKNKu2FlX+4TwOzlXvKdLZZd2PiIlL3eKWgjhl3lHcClm3HCjLeFJ6OVBrWvlXmC7MtvlnjQeIiSF2Y2OI/neLyv9TxXPeEHErYdKrSTqhPAEbPp/OuFz7xd49pUM3906Jchgq23ua3Oz\ -2HPiaCUdKocellLRvoovtRuXBARsD10lZIzGqCKocpF4j6O3XpWodDr7S3/tu64yO3HrbUbBPRL6By+KjiGk3fJKkqvEFEHd/BN1HeJFovs8fHl/xm3dTFU69N3uBG5O0n6weZjJgjXHWNpOomHAEOriTTQc/lBd\ -HlzccZG8lH9kFN6yzhKzSFNXWDsHE/wn4X9+XPsr+Fdhk+T5PHdJnjZvqov11Y08tGZp4GHp157/p1j1qnf4jV4oSXOXZfbz/wH6hAMl\ -"""))) -ESP32S3ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqNW3t31MaS/yrjMTa2gb1qzYzUTbLBDsngJHv3AiGGsD5nabWkkBzWx5jJjs2F+9lX9eouPczmD8OM1I/qev6qquefdzfN9ebuw1l19/zaLM+vbXZ+nS3edP9k6osP986vQ/Wo+5rGFCc8ypxft1X313bfww/d\ -wGxGb5zr/rfdg4ImwrM4w9KMONhbGowvS3rp4Xm26R7yyyaj/7NspxtRDJbAUfl5d5QGxnYLmbobkqWdszgf/rqTmaC+pFHwJn2hk+6kY/KOuF33rvW9xwdw2ln30XVndt0GTd49AR6s9B4n6QRw5mY1xZBlOntk\ -RqMPUc1bPPR10/HMwnpLWAeINb0FHQ3rc+QFvnrzQp+zoxlm1mPmbkj2NrtzdkpvcaT/KyPHkrg/i2yfjQQAJxRykDNBThU1jXUr7soHdEodUZfcgDyXv6UP6Qly+OxmUp0+dU9zOMo8A5mCRCa1KjsmehshthvX\ -icN5JeJacS0MyXKDA/WpGu7p+H+ySkv8Dv6RMF5Z21J/Pz6WT6ewF89xy7iacL2KRjpjvfOdHMyie9u9cd3RGk8qjVwu1NGKgfU6Po3VTK/yQ6VtC57ObO+NdKC2Nh0b/kDLTSfl4PgU/CxOCvkrntFR6SptV/kP\ -Q/mrDVBOPlEjmwlX8XMJ4lrz4GU6udiwN+SC8LmnwyfK0DwqNRXX6/TBwJqgw1n2iRaAN8aDL1vDJK1wWvEvNF/d+SYu039+0Z+1IaJrRSiqfIA3ijnMyKEGNlbc0DGxJX6p0puCmIRzwk9ktnAgHTSSP7vf/VOS\ -rzS3zrLDWZcvHid/gEO7+TWQvqJ1wO6AH9adwD+gvm7H0Tt0GwY2Zqdia4gK93lnD1OL3/3vz1ja7XD33sC+/qRBrxev50+/IzVtCgq1VclUj7zyl5jWLMYEYBAr+C/04tiINb7PGjqx6zGpG+LdM2ASsmuHmASj\ -6yGzQmASLb/tk0ZHhsOnY4f6tmPD+wPlScHv5DOWej1x7P7sc1Yemc4Tm+HEOdiBEX64OfgK2oAYNaPz2sUDmjGQjV67/Itrh7+2tvpj660kSjTg2O0+G5hl74df3FIeg6/ix73Yyerowx8xHp4k6m0AZ8x4Y3Hb\ -yVjDl6hlm/4TnLGamKFXXA7fr9XAVYrTKVACTagEwO4F/+GyM46tufLZzXh/gEOZ6ePOsW0mKbSZwNyKPx3sK27upKiNKwm+ItQZAWylMNG0m0smaQeoDKN6MZZgngCF90oB+bnND/hhIPVLkKlJwRVmGy8E/Hib\ -OxVqTgekNMwkXOlHkqxTgc5KQPc5M8WAI5Ew05QRuHU2YiEqujlHYsszghHLYUk7kjpqACAJ8DcQo2AL3x4DN+bRpiiIOruXTjVG3UPHMqU3wD3BaqY4Ujpqp8BYdAk5URrENHIO7fn5FZPcvakrFg/re3we1sRT\ -TatVk3gpPE+jiIkL1M2XKXwoaUieNoDJ8t1U8wheea92edthfTzsXkJ8eqi3Ykx+SZ+OyZiiu6ozti7PiAdUoMe4xQNDu6CdDWQp3gUVBnxYTSp3m/+KNtvwsY2C+fYLnmsi4jZsSnWNdF1oqYHaLfbZxhcc8FCx\ -7+X+yw7L2XQEMitEmqg+SGXLFowDhumvzx/3U4lhdLFTkcbwtpJLtG36wwHLmJ0FcvyUQWyUa4geb77LGRLwJ4cxoKlVnRxQ5dnzWUYmYAeCB0DoYPPga2y+ywkdy8gwUvdMtc0OwepnM05NKoFmK0Kg8Lmyu+x9\ -8CWEzopxXwmQ+D77DFD16h74fY6FqFf/Ib7ymN9wWtTDY9UteCxf0zkio3E5PdNOxwXTzVQKhRCdjxbwNT9rVK5hhqkrgn0EZRVp/F/OM0nIGEfYszpBK53MZiSLgHs8hi+7RweHu0nXOoh3oay6U48aiXu1fLpg\ -aO6AudUrGPv656fn5yccqfHAewIV3nbY0Rc0I1u+vfMbu+B8j0TUT7CvYbXuU0DDz16CenT/VMX/sEAzBi9KANk4k3i6YR1D3/D0dzhpt3G1YJ7VZNIVOyl0VpywoN2DmYQC6gRVPrvsBpSz5x0HGBs5hNEPf9nj\ -fLV9+upEwXPl30DngwNmi8twDMFRu1n06LkA8NUMdOCzpM8YL0G2xvwBhLwhRnRsQV8HhIJzAhUV+xznWhkpzwhUKTd8G09Q+ZYToDDW9MLDOceQ5eGLAxDgw/khJgFLWChkOS/d92OXVFBr/SNG1Kp0dBxh8wV/\ -7WKK1seGbLttVWXIoFnPgK6FpBsjlPh3XIbtrwnkyCz7a1SZPIlO3BUll6S4vlQVkjzZrnwelM8Q8sDpBhl7JcCqThFqKin12R3CRMMggIJup9IZK2qqnKzLAQbiucKJ1M5yXfjDJ+bQIt+h4OnnR4vsa1Hs/PCV\ -O43A5AG6JdQwkf1qOgtK5ddX+gtkeVSzPZ6xYN/GJ5v4qdjZIYmA8zHZbUJlbY5e+pkuZF2ghT4ODxmfcrJDMCNCSAwjoPHKLYVB3hHhuvmCObThaLjJ+Ahj0PDj/BjN+GyXoJtXULtSs8GkvUQeN0GHqkchEyuZ\ -s0dxB4RHeGt0OhRlmJLjOy27t/rLpf5yrb9serV3lYTs+JRMGd/+qgoeq0pO+hSsbfacgRLiAlTr9xKInnDlBcHwI5XIctWlzqahI9np+2Rt6CTtR7KF1Op4gJHjA6cBBhLt9nLT06JSgdUSPclG9Ancuy9U8qKx\ -ukBjAy7zC6rkwmuVYuYYKD/TN6fLjobmy2HgDJCX+Zi3ddZxJfs3FDC6wwADZ0yOaShrE+AVxAT4nOxboYdUsG+tRtj84/zjLyUJKnA9mULm1T5RZtjXElS//JMBSFmSMwEjbsLAeSFaXL9jsJQlV+8kuZR8Ffk5\ -cqFn3SxP4Q8wnwgF3XzxjmiqqiY5fsDqUF2AEnlbPElGG6xWGDnFR4rOsRptqu1aXMQnslFXErwJGWhtZokdpSjwlljmGhKZQ6uGMA+chs3R3pkIN8KpDcUwiUNulZyGz7TTaBKeRntyqQNj4KVfTbcogn/0j9OT\ -HwDQUQL4HZBSQqEKw3Z4w2EuL49rKGrBq4iE7RsgfofHIS8zGGBSY/KFPEtFzzf2mN1GL4cZJDyjZ0tc925sTUkBdtCTslxisb1AdTxeMG0+8RI7LtIPxS9mqfxdm/WJF+4l3uCcSjeAkCAqfl6r0mDFFcN6P8ZH\ -IaoRiPQ0QqUsFZ8gBqB1HN8hrqBkDmTuMg7cMKeWx5hJSX7YqlTRxg28VRvYJQ95F4c6ySoPVDOhTpMKynSwEhdSH/BiDtAufJsMX6fHvZZxKBj7hVKFapwFZpj/NC/BgdmG8tAIirGkZRA9lsnZecul1BqcT70j\ -H4zg+6M7Eb/h8lBKB8liHT2HJLeJqMhQGaHYWXPCBjZZc7mCS4wxk+Eo4NohPlf+tVKfDYP6jCvRqWbgEowMUzDSfAVbPFdpt3k0TgpwL9ZbIRaX9LdUhfF9OV6oN3kUKMAPV6Ne++LpPOHkwwRSjFWxy7qUMmLj\ -MjfJc0kxCxKsSj1XpZWgsh2mr3JT9BlRm+/7RMIrwGjNNLWbxEgXUv80+FkiT5qtvp3YmPLg55y7mtHmVE2f2Nxy4jhK9AxFkJERuXwkgpwwIsQTULWwAExoMul/SEME0ivPlfyMQSZuM1FiAyu1LOyaiy64q3pe\ -qc9NTNtjjdlQcBwdwOJSz/4FZz76DqDj6t6aKw3ZELb/V69+kssyhFOLD+TJvXSa6jhyfjpoQtVDy/qcYJgz06Bz/Pz9RwEItncPBSpnhms4FpPmrHf1gzNyW01vZEeC1kVyO5Ew6MsuzLucciyUbNmjbplyZ356\ -A0/nJ3fmbAEo4YMbOMX8ZA9AwTOCUiaUW5gJChWebGkRI1DPtLLA4oo/0GUNMObL+az9FjhxsNvX1kNWFZXJmDCf445NYhI2Ryvx/neUFwFHTLsSrKeNd14L/wEacp0RGFzNoCQkVwdgsjG6hE7hxC773qiBbC8+\ -XBFwxPULKf9dae51D/Hykyu5/IhloWyb/9r+JgkPd33xlsZ2t5WRnlUfcOtFiyGfh1tpGBX3ekXuJzwTk9+sfclfG/GTxb4ufaKwImkUdtGVdtSBgNpteo6N6IyvRXSL7goBs0GVPZ2zTftUfRZUK241EiYCOX+r\ -CbHFIVHxNw6SIzJtk8hkL5T3V2iZnirO+mcqLpikX8OVXSuvNM2tMFDDWi6W1IOdfSRtKSOy/ogdPdv0392RLuxSD1ooWiBpNPJiqWdnxbXqZJbz1KYBpWnK3kWvHwbDQOFhIQzQqDXY9oLMubxh0wxbcUB+tZFb\ -SPlsDz/vXad/FSqy0VQhtGzBqv6EIWfcEKrX3w8YmpkzQMkrtlmseEuHOeQUbCSNM1Md5vr84uyjFGxK2Z8n5ZgN7n1IUNO3us5/drqIo3iPqb4VwEazWL8U2vc5hVROFZgekOnXuwdYxCxn6c5StTzjaz4NeRqH\ -8fbsI4e2giJxr00Oo2uoYIeTLeV/hsoWF1OtjHIc37CytmBe1xAass5b1VgTUJ1Oyh4meihFyr9tkfqxMYmScFJQ6ooVJbqsdfYrlcK0CcWLTngmGLbakvMyjRwrqD6B140mQ650eMLhtVYn9ZQGq6C8aSkPtjxD\ -XVrATkczPrhTB6/VlQNkY3N+F0L/6gjsMTUfETG7sdSKW6WGdYl6eCUD5TIlqWyYXE0Q3vikUoHshZ1Gna23Ex4jRG3O6bhuoUc9YCRREDNR97EWAaWi4veeJfMrWcjWcs9wVxAwNxQx1rYplKYLwVNrYRC0ScIV\ -52TUn1xeSdYpB8pVUVims5JU9mfwLbv9aI4iUXfBPLnwRcf6sv0SZaH4JB6C266O85e2+f/ICuS/DxaJqtkBrNRIH+A914xqfVvlN1SMe4eIENgCPWAqu1hfJh65Qk0kr7jRxBRb0nGS1Tuk5FcoC+2SN0fN5Iar\ -4xue+naFgy1BU6Ta17TxyuNHvijESB1ijIFYYHGtDMP0XQjigp1WCsLhRc+tILftTL0q0m2BDlle61clu1pszVxy38ZO0W4ST+IZQvFKDAsykjoyia97oO59Psd0o2OSAf/N9zSVHdktXZshnXsuBVBMQg5eAZv/\ -oWpWgXtTTIuIMgVl2J/b3639APEA4CVoSoDGfYW3ckBcmB7UQ2/wmbtlF5dHJI5QfD9IrnDL/VPZ7FvJ/3f7qaGdcJEZwZpUk/MSC5Vf2XLFI19/rYp3yxOC9G7RkfiJ+gmhSB0xj1eJJCQ7/ICFF89KYT6O6XEY\ -ofMYqg8OqZAB8gjxVhRfmsGKOI4DW0Zx6fZ8nd/H7OsegjnMogH5+NmwaBNYr0FHwO8bqYhXfBvUYVRtT5VvzdXd+cSp9Z2eSLSDQT7vvGKPZ3++3pU7azsv4eENnyCo/IL9bjA/0zRRstpGhB4NXBTPMnyq2VhA\ -ZSr0g3Yxk35qz3tY8Bfm77CFPHcIW6BHWn7zn+Q8sKiz1Drh/PcPYis3eY2jD9e//TS/wbIB0NLO/gUTjqjNUUFVEBAIXsCzdO+HpHCDl6WLjUIneCZuzxv//hug8YDbIcVc+0ErpQpcq3zvuNznlFliq4UuQwnd\ -WUlX8ve+5n4MX8//SlLFR4x6AS/4RiWJ4ogkvTLlN1ugckn5HEgQcxdJGDEBItCpEhe4DoGSlZSsl9ys/+Ss5GKcUq2/SeDQ10p4lNmY8nkv2zDl/zJuZs6Q0V9hRKdw3uzwWenaMmUP4CNRY83hdF0L6EJUpj6n\ -RrvcpowNN8TQK/blljxBr89PSf4lmY7NOf/HoDtFgucrRo1VqcXEPQtXpmPXeF5ssXG0T8iGIMUfKQFzizQx1SrmukIiJQq4q1LN2CwrMkvMYqD2YpvTlLxg2az5cr2Fz2OH53nPCD5ISRC5h4FzjteCuHpnOdGA\ -soPNpeMiN4Ty4e1I9tPN6qHcQd1hz22f8PUhR1yj+kPGQQ5suKnkWkLT/6mOp6EGc0DhzIJOFe8NjcDvj1wepAst7iUe5GgBnrnssjGsQB1yFS7Lp4LapchsLvtBY8NkV1O1pgFQueJyufgft+5VS3b4hwO1tH8r\ -vveV33DNGW8qZu7E7ssK0mdEzOJiMNyTn+pQ0JMrZjX3wI1EN/mFCAsWc7lasur71E+XTLnWl1nCONNymMBgN8vzDWsrm3gxNml4wgAHI4E/IUvhzNuTdFvUe5pG/heM2QeOO4yiSLtSX13tE8If5FzxXi6VXeJ8\ -REpebhNFCOFXZY9xOWbccJst40no5UGtW+VeYLu6OOCONAoRksLiRseR8vCXtTIL+BEmLoi49ViplUSdEB6DTf97L3we/gLPvpLhB7tnBBlss8ddbW4Ve04craRD9djDUio6VPGVduOSgIDtoauEjNEYVQRVLhJv\ -cQzWa9QvJWzxb8O1b7u67MStx4yCeyT0uy6KjiHk/fJKVqrEFEHd4hN1HdIdon0evtqfc1O3UJUOfZc7gzuTtB9sHuayYMsxlraTaBgwhLp0Bw2HP1AXB5e3XByv5feLcrait8Q80dRn1t37M/xt8H9/2Pgr+IWw\ -ycpyUbqszLs3zcXm6kYeWrMy8LD2G88/JVad6rv8Ri+U5aUrCvv5/wDWE/uZ\ -"""))) -ESP32C3ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNqVWmt7EzcW/itpEkjhaXcley4aaINNbZwLsNCHkg1rtsxoZlJomy3BLGG3+e+r91xGYwcb9kNiW9LoHJ3re47mv3uL5nKxd2er2hvPL63dnl/65Gb4N5hfmix8hr8qz8OP5BXmZ/PL2oXhKk9krMon4be7N5+P\ -5peFnV+6ij+b8FQ1GG2H6WIwCbsbTIZ9nQnfXVjthvPLkvYOf2HQDt/PL9s0/Gh5ZREm6xQ0+Glr5Tv+zKsjEA7fsE0RnqBRMF8+Buc/4ixyjAYH8/I0kQust/VpfsTMX3rzEAwswmhyb34R2A8MtYNRNdkJu7td\ -ZqAaHAaOBpP7h9vhQZOW8UROTrQ3P197mqswGog3gWFbhC9tmPGB86rNw3Ng6s/jsK5mIeLZts3zNRNKesxyUW3VdU7H5P3AfCYCG3SSg/zDdlDkEJ8/XAkv7oR0BuankY4Jn65Y0uAq0eLelZBmCqMeD0op/rb+\ -B0ifdw/0rm9NdkiWVQTlFEPeN6gzKKjwx0pZLLUMD/v2ZW5ZnHbISubl1h0EInWwXGcnwQTqjG2TxJBMMAftMZUqYRUZ8wh003tgdtIXnOX9C9CnsbBlHo7RZLyALCwTKw9/RcG2pOO8icriCasAJPFZ5Tc7kd0n\ -pYxn4k14LJ1hKY5TsnNYzzYOIq6RfdwGv7PD3lE8ZDkO/20wqiblUSeu60CswP72K3gALMmwLWBZW5zsY1HPpdOZZydU6briAUaCeGsZaesTVjykAXnbXLa0kbfKwP+8lc2GbGrgr22w6UydpmcY4RGcIxOPM2Jz\ -Ni7RE7c2Uoc+aqJGjBGpAYec1l/fAoz9zoSrfEq2KX6AFS6dwtzYMJ/e84dyMoqgs54l41ReRTTsOajEshqr8aMXQe5jyZjXW+GcZGcwk2FmsAOFy9Yug4HsMJFSj9/fvLBnkR0in0QikGWQdathA3tSmFQdKf8l\ -dlFrNCuHUZOnk6+XAf2WQGISkO7cScIXH0kssNYfOCyT+opngk2yEo3YAZS4Gl5ky7q/ZSMM12SZK7GtEDbhV4hX5Bzi3MQlQqVLNUGMgs5sCkml/MWYTZHTpzkPBEO7mPbZtSJRpnsm8h4iFHwRhyGI1A1ELsnT\ -p/3da/GgT0bfuPVyvIBuyhgqaDJVh63tvTjkaShu3hRsDss+Tg5XRd/2No9biGOmnUquY5PbgeMQ8SqJ91Uq8RjbFAIq1kMQ6E2hB3lqgpjf1D1OUz35xz4IISzxyeRE4ANfZ4o7CF887glT8hIiEdKIUCgbOUpB\ -sgvM3ZrIDDBGcZNjvB2ecvAj8fsD/1PYxujPif8ZTgCfhUXepZR8MLop7tWwma63lnYFtKjV8AlHFD/n9CCwXsmWNyeG5xNWA85Q5KMJpyXCTwKYBDwtYaYqvduwGSq6WwJrtrgrcM03937r29yEWd/kmnUjOQw+\ -2JDtz/goFNXyrX1SysXdPiyZadAafYIa0oJrJekSuJ2uZ4EiVQWh5JI4FU9K2uwJYqzIViMkJXo28R1O7BqherFzwewhkPl+zqOMenbFXgAxegkimIF1uPoOGx5MC5+V5bTvsLja4Qn2+jE8oeA0yMJ4wml0NW68\ -fwtLt1fvsOY1FJjeFNINK6NGZhX8VZdyvvxqwTGliHl2wcSdYhzxGphWW+6zZ7NXbLMo1Xk+rYstTijLm5v0TaRAhlvOxux+jLTOesiB/sBoITGBWVnDYiEsLj/eo9ZA6tufcUbrZYW3sLKU8gsCVuqjwKpydBux\ -rZzMz4Nvtdlp+wICfnHY2Racv/DvsEgj3esjDghQhEsff4YRxLNrUaGpl/bYeBg2fzLGkqMYB4rd8et+pAVr2U+IBvbt1bvnYeshzmL/CWgfHMnXgtfabYS1m3CvI+Sxx/CBH+GeqGCqN/Ch884PVFgZm7ddUQph\ -fSc5tK0/KJjZF99TT2id2Fz5F67BqoF82rsrGHMQPaarVZGxzP4XSAmQMD3zSI0fOHS5tEYNAzbVBJ0WsXmvEljyEizqKuKjTXS3oNSr/yiJ9QTojP4OhxCyYX99ceDigi2dVsmjzh7uS/WaroLOPFLm5WQbMwkt\ -w28Re0GpzQLyNpUCeCS54U8QWimgs7PCoJHxUHJeSYlwowBGqNcpl5XyyeReM/qqhNmqQKHUDoR1mTH53bGkmoQy+geBgTSyxMTzz2ihKpb87BGj0f9LYDvfsCZgrKHWRaR/RJBxoePtZhMkMyyvBEQMpwl/a0qR\ -bL3vR4KKBozemgErlioz8rZVM8r7ZiSDTP9HLlHOuUAhplNmVNFiB+hh3QroqQmFQdRCDVhM1NOTSHs5cFdZz4h7AfyLArc+/GWBu22vyPuntPCweAm92mI1GHCQaFYL1MH+57b3KzmgLZ+8eYaM+uzoFGI+vf0C\ -tvxifv4PTB6/eYjJh0ePMPnoVh995SfjQ/DxNqoL2AjCCLlmXyBjxgZeSvouJX0jmFMrsJGUjvmk970kCM81SMOWAjSCkgnPwqhwuqbZVMSMmDBDI3cv/7BSQ6rgNK6Tq5aet28owN8oIKjpL7ANgpipKKMrapcL\ -0q/O9skwtwQpaiGbu1HXLeQnYHIVrSu193Mk/JUQA60SUQmT59wd9LHqsIOuVeZfTQFAHYM6l06n0w1ygeCIsRSdR2MfaBtC65bNT7exq+uP8+jVWpE31CgwAnerzzCyLqKglmkbUSA3tlCkaENH/ZokD4teqZwR\ -x6afiVdUO5/lxyJ5dJdsvly5clptx61KLPbyCFQVFCLDIReImb/mD1XNG+oLao3h5JXmRrbvrqsjgAf2gyOiuqLxJI6H+oTbEefSjIACkN+ogBuyXLgdOV9gKQ7VyDwSX3+9IQd8RE24VCuGp/RzqD9v4WfR9Fp0\ -RCSJ/SGf70rdKd0VNAqo6rH0bBqfLTywp/9hH3TtPlQxPWBh+/Q73S7pE5K9CwsQZ/KXvHXnzOimwNyQCxqBFf0mw9tkucNw2vtNsL0ZI5CnCaB8rh1LZdcKySpd4zgN82zT6WaDrpt4BzGfz1Z6BQP1H7FDQyVy\ -LkVoDTNVVbLqSi6Bl/WdauvU59/4cwASHA/RmiaoBM3gljTh5hc0LO0/6/xvMpPMFzSDKEvNZXsY0x61DrqqH3Tb7xP9CQjQ3kCtBWVSFs7iY8vcfk9mhoSWT/yvCJyZWgx4avJn4Jx+Urvt+fxCkngh3XgEEdoz\ -/ZTBWAlsnJrEOFOBSLWUp0ibyN+1ZTkXlk5Ozb5dmO4DIZlygEXU9gATJp16DsQtK4xNu3YHO7sa3He2OacYI7mwTFWuYXckHC8SJ0REc8iA+dfwC6XcCuWs31QZeA6IRLxRRw7f6wnFJzqsnU6h3BQAvB5EX5Mr\ -JW8HqkIo2AD9ldLiK4sep0hNq3IA4iJdoRenXNT+IRoKQA+4cSjMAeIbQKWbbMAnzqApVyCEc9eDenTfssfVrBFt4kJkaLeJoYbTRYXBqCWNq1QrlmrB0zBG3wlWGiFk0OlEesiUvumSA6KyZ+QUcAJv0KDCaDiM\ -dK2cQLPCJggcnkAzdYsTqfQMOwWO5Tsv7FjppFrxYOM765ro1USOQB+FWNnvgM8VsWZbdInRHRB2QbeQWYwqcoN00ZlXD/FmZLsXy8qFAEtSLl1+6DVDOpXeaVn3OZCdyUzv6+Co2zOXPZG6hjPOmKJQqktK8pxx\ -7F2XyaGEdNBq+mAtiVcyzs7iEUiFJLxanmg0lTzrR4aJ5vDDfirhuVqMc3BtZiF9+5XkRuWEY1E3SeTQCocAGdRdRi+QwEv7h8AKasooSIGNAAT0MwapsIyYpyYsimeblo9L0MCJ13KArjt6v8dWJ9ZSE28JAv0+\ -THodRs1tQ1atEzGTxVfDMw6XqoSCUBkKkZYy/OAWossY7buivuISpa2vtGiqR1K1ODkyRZhcuofrOCzNGw7ObX3OBVYjTFbDDzc4nlNtl49fR0rIeY4a3Vcf4+hHROWN9LZ+kWBaHDGx7gJhE4+NaeP1H2i1hixg\ -dyydjJy8SG6XDDtSk6ykU7bnp2F5Jb4PG0YI1kAQrzNbTQP+wIslSIbXuISnHOuryuWKrO2Q2gMeoC5JKnWqlV5xLXfa6qJsCr7tAVO5QsDSZrgjTlbFO0hx3O/12oM691PWIwyzkLzZK88l2BDnHWr/tLC9mg7c\ -/oOEJcNskSUOX856iT+JdkyctPVL0F3wLnV9MNnkH0/oauTvsN1kdAV/l2tqvdApjIQ6LwUwngc0c60CVCfBJJ0vxqxrvT8jQWimdcMbR3LhR1dQ4vF0j9IuGcsrjit04WjlvRGK6FQbNoqyCSd8UAArL0yY4de6\ -VuBrCKDiIy0gbaXWovdhTRGDbyNlA/VSM8CamgHOrnQ7paaqqhWbs+axgmjITCXyQNo1rXhINArJwDXF793IspU7rq75Qm4T6J8L0KJPIIjuLieVdlsUIPqWfszSW3JCpyE7lTZhf7LQjEOThxG1wka8oB+TTBWc\ -SqWEDtD6SmnJRu31yomKi1r6yPQ6zeGqJzJLF/GNET/0E1xcWH/C77BoQfsHyYpV1RRRpYW2a3sNLD7tKXPEjwvEqMQeuo54zPGFvrklp0yu43Ek3OQl45/1fncc38ziQ8IrEv+OXqXaFsF3lzKV6QceQ8HbylYs\ -qgUhiefxwlNFyGnCPyFTPY9pFS7nzXv2Mto71b1dFpslqrZ1JzFmRt2B5YtQUUFb9Hk5lDBWyssXkPvyCpUFN+j3xlT+39rEwGiKzl2Ao02vzkzf9oSrCjJrw+BWvvTeHJLo8eobSVJEkWBOpP9O2TB/z2Zcydtn\ -atbSGd9jTggPYIhuSRVLrxWpi4dxZn/9So+9Efhg158qRFTZ9OkkdGlGNf/iXIzUz2/t/FtvWNV2Mm5Nb+gHyttV7b7cdumTVBLglb6w4Tn3Ovn6IyR9vahJIgWTHsidf8sI7OLgPjqfd1iD/XNU+fZscCBvGOn9\ -wZ9SmQpM1laT1b+hhF5TrZPmK/wfnNDh9wRYwG68pgzkF8J4tZwXQaUanCA1EKjg2k474dKGML1XIHzMVBTx5AUCekuIokvJWanJ5CZCjw38VSfSsSnUIwUFSzZZcPOYsLqmIR+JSxrp++VLuXfwkxjc6LFSKf+N\ -HPKab61xI4htPcy9/ZTJEdamyOYk6zgl91dpmnze9LduiAtJjVZRIfykRas/e/YArf7s9CZa/dkLWASa/dlxi3I9e/gAISN7NF903f69b7boTd+f3y3KC7zva02eJ9a6xISZ5nxx8bEbHCbOhcG6XJT0YjDEOiLX\ -2JPh/i7GZklhkqv/AdnBtYo=\ -"""))) -ESP32C6BETAROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNrNWlt7G7cR/SuyJEuJm68FyL3BiSXSpkTJtzqpY9Uu3XoX2FWdC79YpmK5Df97cebCXVIi5cc+UCKxu8Bg5syZC/a/+7P6arZ/f6van1wZO7my8VPl8Ts+5t3jyZUv4rf+5Kp0k6uCRvfiYPk8/sl+iH+SOJTF\ -//V2/OPl6YSenlw14XVOcxzGP+ZpnL8/i6PJ4eRiclWb+LU3qEY7cfZilwWoeqeTq9AbPTzdjg+atIyr9uIn3lsUg/inP9mfTDE9JruMM6TxR8N3uXweR+PidRTYuviliVd8lLxq8sk+CfXHk3hfiPdX/GzT5Pma\ -C7r0kPVC24yfEHLaJs8H4TNRWG+hufiJenPx4/v4/2gushRn2OMAwh+165j4v3BDVsHNi7rDuSzNKww6MuhK7W/rH0H7PHtc7/rUMFeSj6CeaBzX53mjOaOBnH+iK8PY8aEyPuybt7llddo+G5lvt8VJXCSM49x2\ -FCEQ4pO1qiEZ4Rqsx6tUCZvImGdYNz2EsKOu4izP77A+jcUp87iNOuMbCGEZYwK/nWMs6ThPorp4wSbAkvhf5XsLlT0kowyj3M7yFCYd41ZspwScIBtjHIsUtcxTkE63485cb7SkWlGNbsVDl8P410ZQ1SmPFpbV\ -U2Axh/ntHXgAkGQYC7itcWcHuKmdOkrn2QlVu4U7xkhUb5CRJpyx4aEN6NvmMqVtZasM/M9bmazPUIN8TY1Jx+o0HWDER7CPTDzOCOZse4vuuLHt6rBHoNVIMFoq7iZgKX99Cgj2Ky9c5UeETfED3FGkR4AbA/P7\ -Q38qO8tw97iDZOzKq4r6HQcVLgu4Gz86DPIQtwz5fiuSk+4MrmS40tuBwWXqIgNAdniRUrffndzZ81YcWj5pF4Euo64bpQ3MSTSpNlL5S8yiaDQrm1HI087X64B+C5GYBEsv3Enoi7ckCAz6A5vlpe7wlYhJNqIR\ -HMCIq/QiU4bulLUIHASZHGsoZNzIQRRj8HWs4YXCyHPeQ5d+ADiwhYCyBIDjpcoRZqPGvh7JFYQSt8eubPuvGeMUR/yJ/zFOY/TnyP8Le4VpEEceEPOeDPZEizW7pRPtgg5As+TThomk9ivhCRv2qW5yQJ4yoWcn\ -A9ZXnG5CMk/AmH3ehssHIyYgipQSGiVMdqPjRVqz32gU7wTly28lJvv68BcNnXh8xIKv2whtphKisikzRNUb8y4IuvnWAZuktt92o89YsTm4YT14f9EIt8Lre0frhNiKX8BEMbQxOWrOINTYUcFQsxf1AiJzJosd\ -Jm9FYcc/ZiwbwOq7vEaseT5nDkBeg+Dh5QqgUYT7jDrgCv8ry9Re4OZqhy8wLw4RSBxTHWviBVPljZG5DfrLsQSQMhJGejqRkvk6G2Is9Nu7Pd3drmuFVfi58w6N9VbjBZF30caJjUvadknmf2i3ytvUQxIL3uo9\ -cVrx6yqVsA/pXCJhf13ENcikjNxFASE5Qlgjqrn8AOKw84+49B4rp3tizLiFUPNGg2QtoRSJ8jmAUXJmIMQ0Y2UUmhmIsBC8KQ9YUCaZbQanctHNinq3tzqzSX9qpycGKMdDpjJOTs47wZY+kNKJmlmONfI5kW/5\ -8c5qsGe6vZnYSrMjd3h7hC9wMnwzqW+1VZWDe7BTOZpMI0k12evmDbT75nThqiBS5z/iJrXa+8dMrrBCkT6/TRBF2ArD1mFpmu3biRpBGJHGOSXd3eF7Ji/GL6TLfmRuVURrpnOj8xC27IcP84+vQARvwEb/BKQq\ -oRiKjdugwT345mPsBYGtQTkVUCT0f2KuqAWipZhVVbwkR+/PXLNUUG2VMQGBIHzvlq0XUM+5x+gnnrRIg0Kq0DpuM+S3b7eUzef/WT8nIdLfZ1IlGPrrN8eFL/gRol7NhuzpgdRs6Wqqla94EiUSVtLBgECEdZok\ -Zpum8h/Yy4hJIHKZ5hrngdV0CP9K8+cMrvJLwKVRD7M4lMvO+d/fM14q5VWH2qDpidyLK38ast0LkrH/SUpjGlmS4dXtAPfLfvKMc7AvVRjCmGc7NICLPUXki5OUuMfpleZ2OareXHIqKCVN+Edd8pO1O/B/bUGN\ -UFP3HkgRvl5WGiQk/MDZ+JRzcZI1Ba9qMbLIXFHAaeZq7ZgHoVHkGU3yf0CzhJ7ix7Tl2stvPzxY9foNGRMVwcuU/OLeS8Dw5WT6GuKf/gTWKR8/foKLT+49xcWnk+kz8PXbZ52mS5WfDU+RvXxobYDMD9uN3H8g\ -bpIJUUksLSWWgllDIbE2k1ibdL6XlB7Qs7in7nGyhdoEzwIe2B6I0Gebna30mvwVh+CzpUpIsyjNaDBWlbISZrHJXZjEHv2bU8SCtZ0yehbV2XJldef8gGC3JdmwVmRpMdA2Gr51hQDpGnusBa1adNEls+kRTSeB\ -cU3qEH90unSTyfg6OiqaUnVAW8wpgZyw9GvR05Qb6XwqWuYeCgol2okYW3Q8XbTopK8A6eB1pDfA0tJgyl+4K3K0mUBK6pSc509kW2hy2Hw5SUZ+XKTNsFFDtC0lSlSiqDMEZfwtws/5UzXrOjWXEgdcpZGKAbro\ -LOSy74L3h/BN40k7HssnLomnUhDDPOAl/MfNPteW2GSGW7GjWq6DZ7v3G/KgZ9QIqqSiyb6nn05/fo2fru60iWiRpE3ufb4rTiMVfnBSkll6Nm2fdR7JnH90wJ5rUUyU9ugEyn6gdK5zF925nW22MftbnnrhBWAn\ -lH6NSviFxcyAGxLLlcwmEu2mSpRAbyha0CtwYKLUcr+yyrUfp4qwFAq4OvFODcWGuWTALVszpeYcErr8G4ChyRihlrt24LQ88xVfiEi5oGHxElv4X+RKMpnRFYiZf0V5Txt3qGvRaIxP+EcVDnTE8UiZHrx2EgGN\ -PHkNfg9aWI38ryC1TCEBvq/zlxB+LFLW+avJhQRQJz2eRkGQ3oQIK5zHwUPQl0pGEiRXSe9+J50GImTaOTpHmMSlx7JeyjU7yMojipv0yDOZNExzDNxQnOzsKp2ieqnp2yWvXaaq15DvIRg0onFE10DXUBhC56XV\ -lRtZOes2c3pe0JBzSWF66i4jpZ51mIaG6I46JHegAABNPYzOM+zBXOwMwxs7kqgOs3YawLvIbFXKnkgJs5EBQboqXfAI+MVTyHgC452A1UZQ9GhzLl94lOoOxM3tGKncrQTKYFuNwuE81+EC4wgLurzoDno2iOq8\ -Cq21udfsF2qXKUkN6ajbPqUmO7Rlz/3PGEOBb9A2w2jckvTSCuEak37Hae1MG6CJVFCG3Rk786zYqiPKQrciX+0X2Bu12Ju2qrxMUE4U2gnfog76YneADB2BKeD6i+OLC6Hz0OlXGSaPi2X7Qnsl2ddUbRISnUHs\ -UqZdCWRmJGDouvLgYDFnInMiZvXHHCeFwTR1iU41bOveMjkVLmd66ORYSVslF3bcboHsV0sUpSdqjSEvu4wx0sh92o0hfC0IPnvXrsykfFiJarXwDlRdJ62EViV00nNKRwBF3fwmqQQ1N9R7AQ9IvZqYxP8zZqxA\ -6SM36XriqfDZi8X0v7Yd18ZIM3Fpus/9pNPpFK8iXQfhTSPorvrn7Pmqc0dpmb3LDXEf0IxswhBNLxfm3IFswlzrmDDgobqQPVZUKkkXc52ExqBVAJcOU4ZMLUJW/U93mdapvMqH79uV/FSqRTP/3I5+Bj/fsl5h\ -ZiK5e8zrNdpIXP/Y4KNEOlmrMWTw3aF0GXJyGjnJsOw3dbISWBm+6L9V4uc+MOmq07dHZ40GBH/SDSN1y0Hzgo1V5VJuNot07JgHqDuRSmPAcn5Aew0dd2Qc+KaTfcohBmi27u+IQ1XtYZc46QM9eKGDgyM2IofY\ -sYwsymMhFooGi7z8BjX/xq8F8GHfJ+EfwzI1lJO8HXcif9IimMRowlssesmzhHAyWrfSO1Qt1o/+DswmgzncWo5C9TTJ4ZzOSTrTyNNg86LRBLQQzkgnsyHbOOgpJ3RQyo+if/cxde2l/ywlDJ3gNEsgeScFQRCL\ -4d0EKoWoeV1rFk2ZwidNI+VQ3vS/0nulIow8qXil+lGBos3w2rUcS8jV89UMiU3gFGdXzh2M7KdagZs1zzWV5aDKGjmWc5ZGPKPFgxE8EFR3W5GtHLAt+h/kLnH9qaRa9B+JwuJMIEh/q1XglhyDpNJ/6/pfoQfo\ -N110pvOkPe3WP9Z7DYXJkaanUuVXxaZiaAmk9npxRBVM4DF+a+N01Q85Nb5oX0zwfT/aAkn4M35VQgvW30hdbK3atVZFy48ooNNG4t2+Zon4cUkmtAT0Ot5Gc3nLAPPQLpPrGTlCa/KWs9z1IemsfQGINwnHSPxH\ -emNnWxTfpzJjxlGypR1DpG2Fy1lVM8oZXrUHrqpCjhD+BaF1Kjwq5Y0vLxlBNHeqcxdZ20lRs62hkL9R6b98BCv6b1xXkFMhsVIO+KH05TtUEdwD3R9Sef/1ptUR07+XtypiOVd3+jXph45+1UZmtCkEP1p6SQtR\ -9Mnq6y9STJF6zqT3bQnPlwzmSl51UnBXXJ7vC69QQtCXs9q8bTjeDJFH7X4Kc7BJCYfMgJW/ufZQk4No0R9A/goE63jZsJIKq2+J/K6nvQqijF+X2NC2k7d5mgM5J9InqQRAhR8nnHJjkg8eIsHrqUjSrmDSE3n5\ -oOEs7OLkIdqU91lEFvkvMMT2uHcir7MwnIr0DylShcO1p2T10xcORiRfp00PvRc99s99yS+oSNPwQXnagGM97RcJVNU7Q5ig81Gq3/TgJZXDa9N5F8O3UYuoT15joLdSiGZKjlB1JmcAain8Dz3poTh1Tck5KLIQ\ -XVD/Vc8S8vb0x+SLkLLsoxSye1LeK9Hpk2Z9soJPdt3z1iN1LeC3ss8MAErDa0IIxaTiFgGMSb7ITwba4E+kFUUl8ovmJfD68jjGgSp7vfcGYe0N4PMPXH7SoJzPnh4/w+Vnk1mniU+UYPa/2aLXPf/1cVZe4KVP\ -a/I8sbZITLxST2cXnxeD/X6viIOhnJX6dihAFZ1pX4a7sxibJc4k8/8BksMRng==\ -"""))) -ESP32H2BETA1ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNrFWmtbG8cV/isYMCRunnZG2ts4MUi2QFyM66SOKa7cend2lzoXnoBFjNvov3fec9GsAMn+1g8CaXZ35sw573nPZfa/29PmZrr9eK3antwYO7mx4VPl4Ts+5t3R5MYX4Vt/clO6yU1Bo1thsHwR/mQ/hD9JGMrC\ -/2Y9/PHydEJPT27a+iynOXbDH/M8zN+fhtFkd3I1uWlM+NobVKONMHuxyQJUvcPJTd0bPT1cDw+atAyr9sIn3FsUg/CnP9meXGB6THYdZkjDj5bvcvksjIbFmyCwdeFLG674IHnV5pNtEuqP43BfHe6v+Nm2zfMl\ -F3TpIeuFthk+dZ3TNnk+CJ+JwnpzzYVP0JsLH9/H/2czkaU4xR4HEH4vrmPC/8INWQX3L+p2Z7I0rzDoyKArxd/WP4P2efaw3t2pYa4kH0E9wTiuz/MGcwYDOX+sK8PY4aEyPOzbt7llddo+G5lvt8VBWKQeh7nt\ -KECgDk82qoZkhGuwHq9SJWwiY06wbroLYUddxVme32F9GgtT5mEbTcY3EMIyxgR+O8dY0nGeRHXxkk2AJfG/yrfmKntKRhkGuZ3lKUw6xq3YTgk4QTbGOBYpGpmnIJ2uh5253mhBtaIa3YqHLofhrw2galIeLSyr\ -p8BiDvPbB/AAIMkwFnBb6053cFOcOkjn2QlVu4Xbx0hQby0jbX3Khoc2oG+by5Q2ylYZ+J+3MlmfoQb52gaTjtVpOsAIj2AfmXicEczZeIvuuLVxddijptVIMFoq7KbGUv7uFBDsV164yvcIm+IHuKNI9wA3Bub3\ -u/5Qdpbh7nEHydiVVxX1Ow4qXFbjbvzoMMhT3DLk+61ITrozuJLhSm8DBpepiwwA2eBFSt1+d3Jnz6M4tHwSF4Eug65bpQ3MSTSpNlL5S8yiaDS3NqOQp50v1wH9FiIxCZaeu5PQF29JEFjrD2yWl3rAVwIm2YhG\ -cAAj3qYXmbLuTtmIwLUgk2MNhYx7OYhiDL6ONbxQGHnBe+jSDwAHthBQlgBwuFQ5wmzQ2NcjuYJQ4rbYlW3/jDFOccQf+B/DNEZ/jvy/sFeYBnHkCTHvwWBLtNiwWzrRLugANEs+bZhIGn8rPGHDPtVNDshTJvTs\ -ZMD6CtNNSOYJGLPP23D5YMQERJFSQqOEyW50vEob9huN4p2gfP2txGTf7P6ioVN8R2Lksr3QfirhKpsySVS9MW+E0Juv7bBVGvttNwCNFZ6D+5cEBxStMCx8v7e3TI618AV8FAIcU6RmDkKQHUUMNYdRXyBKZ8rY\ -YApXLHa8ZMriAbK+y27EneczZgJkNwghXq4AIEX9mLEHdOF/ZZngC9xcbfAFZschwoljwmNlvGTCvDc+x9C/GFEALCPBpBe1ypS+zIwYq/vxbk93x3WtcAs/d94hs97tqEEUXsRosXJJG5fkKADtVnlMQCS94K0+\ -EtcV765SCf6QziUS/JfFXYN8yshdjLM9BDcinOtL0IedfcCl91g53RJjhi3UDW+0ltylLkWifAZglJwfCD1NWRmF5gciLARvyx0WlKlmncGpjLQM2tu3pzbpT3F+IoJyPGRG4xzlvBNz6QMxneiZBVkioBMBFx/v\ -rAaDpuur+O3dplz2dg9f4GL4ZlIfdVWVg0ewUjmaXASiarOz9g10++Zw7qggU+c/4Ca12fsjJljYoEhfrGbZco6vWyzb1AvTrH9+GkRDRBvnlHg3h++ZvRi9kC77kfl1TmOS7dzrOoQse3k5+/AaNPAGXPRPAKoS\ -gqH4uA4S3IJnHmEvCG4tSqoa8vR/YqZoBKCl2FRVvCBH789ct1RQbZUx/YAefO8zWweHpeceox950iKtFU+F1nKrAb8aL6CL2X+WT0hY9I+ZTwmA/u7NYdUrfoRYV9Mhe7gjRVt6O9fKb/kQZRJW8sF6hImQOiQh\ -3TSVv2T/IhKBXso010APoKZDeFaav2BklV+CLC8xD7M41MvO+d/fM1gqpVSH4qDtidzzK38astELkrH/UWpjGlmQ4fXnUxG/6CQnnIR9qcIQwbwE7QKh7RBBL0xS4h6nV9rPy1H1ZpJUQSlpwj+akp9s3I7/a0Q0\ -okzTeyJV+HJZaZCQ8AOn4xecjJOsKRhVq5F56ooKTlNXa8c8CI0ixWiT/zvBDibTH9PIsdffXj657e2rFU018CIbv3z0CiB8Nbk4g/CHP4FwyqOjY1w8fvQcF59PLk5A1W9POj2XKj8dHoImLqMFkPVhs4H2d8RJ\ -MuEoCaKlBFGQal1IkM0kyCad7yXlBfQs7ml6nGWhNMGzAAd2CA702epco/Sa9RW7oLKFQkjTJ01lMFaVshJmsclDGMTu/Ztzw4IVnjJ25sXZYmH14HyHQLcmmbAWZGkx0C4avnWFQOZk7L7Ws2rUeZPMpns0ncTE\ -pelw62OTbjIZ3wVIRVOqDmiLOWWOE5Z+FYDacgWZm0r0zE0UVEq0FzG3aPli3qOTxgLkg9eR3ACmpcGUv3BbZG+1WCW1Ss7zY9kYuhw2X8yPkRoXaTts1RSxp0RZShB1ioiMv0X9c/5cDbtsu6XEAVdppGKIzlsL\ -uey74P0hdtN4EsdD8cQ18YVUxDAQeAn/cbPPtSc2meJW7KiR6+DZ7v2GfOiEOkGVFDPZ9/TT6c+v8dM1nT4RLZLEvN7nm+I2UuLXTqoxS8+m8Vnnkcn5ZzvsuxZ1RGn3DqDsJ0rnOnfRndvZdh2zv+Wp534AfkLV\ -16qEX1jHDLgjsVjErKpcu3kSMWOzOlw7cFFquWFZ5dqQU0VYCgVcmHinhmLDXDPgFq2ZUncO2Vz+DcDQZoxQy207sFqe+YovBKRc0bB4iS38L3IlmUzpCsTMv6K8J8Ydalu0GuMT/lHVOzrieKRMd86cREAjT96B\ -35MIq5H/FbSWKSTA+E3+CsKPRcomfz25kgDqpMnTKgjS+xBhhfU4fAj6UslIaslV0offSZ+BKJl2jtYRJnHpvqyXcrkOrvKI4ibd80wmLRMdA7cuDjY2lVA31jmmGHPNa5ep6rXOtxAOWtE4QmxN11ATQuel1ZVb\ -WTnrdnN6XtCQc2PP9NRdRko9yzANDdEdTZ08gAIANPUwOtCwOzOxMwxv7EjiOsza6QBvIrNVKXsiJcxGBgTpqnS1R8gvnkPGAxjvAKw2gqJHqwuGwqNKdyBu7sRI0W4lVNY2ahQO57kEFxgHWNDleXvQs0FU51Ud\ -rc3NZj9Xu0xJakhH3f4pddmhLXvuf8YYanuDvhlGw5akmVYI15j0O05rp9oBTaR8MuzO2JlnxVYdUea6FfkaP8feKGLvIqryOkE5UWgrfI1a6PPdATIUbhVw/fn5xZXQed1pVRkmj6tF+0J7JdkXgVnTkOAMYpcy\ -7UogMyMFQ9uVBwfzOROZEzGrP+Y4KQymyUtwqmEsesvkULic6aGTZSWxRC7sOG6B7NdIFKUnGo0hr7qMMdLIfdiNIXytFnz27lyZSvlwK6o1wjtQdZNECa1K6KTdlI4Aiqb9TVIJ6myo91rDPePFxGRKT4COKHvk\ -5lxP3BQOezWf+9fYbG2NNBEX5vrUTzodTnEpUnQtpGkE2lX/nN1eFe4oJ7MPuR3uazQh23qIZperZ1zpt/VMi5h6wENNIRusqE6S7uUyCY1BkwD+XF8wXhoRsup/fMicTrVVPnwfV/IXUiqa2ac4+gnk/Jn1CjMV\ -yd0Rr9dqA3H5Y4MPEuZkrdaQtTeH0mLIyWPkHMOy0zTJrajK2EXbrRIn9zUzrnp8PDhrNRr4g24MaSIBzQo2VpVLrdnOc7F9HqDWRCpdAcvJAe217vgi48C3ndRTjjDAsU1/Q7ypikdd4qFP9NiFjg322IgcX8cy\ -Mq+NhVUoFMyT8nvU/Bu/FMBHfR+FfDouYvtvx52wn0QEkxht/RaLXvMsdX0wWrbSOxQt1o/+Dswmgxl8Wg5C9SzJ4ZTOSS7TytOg8qLV7LMQwkgn0yHbuNYzTuiglB9F/+ERdeul7yz1C53ftAsgeSfVQC0Ww5sJ\ -VAdR07rRFJrShI+aQ8qRvOl/pfdKQRhIUvFK5aMCRZvgjYsES8jV09UMWU3N+c2mnDcY2U91C27WvNA8liMqa2Rfzlda8YyIByN4IKhuRpGtiw0uan6Qu4T1LyTPov/IEuZnAbU0t6IC1+T4I5XmW9f/Cj0+v++i\ -M50n7WG3+LHeaxxM9jQ3lSK/KlZVQgsgtXcrIypfah7jdzYOb/sh58VX8bUE3/ejNZCEP+UXJbRa/Y3UxdZqXLQq+n1EAZ0eEu/2jCXixyWT0PrP63gM5fKOAeahXSZ303HE1eQtp7jLQ9JpfP2HNwnHSPwHel9n\ -XRTfpxpjyhlUpB1DpG2Fy1lVU0oYXsfjVlUhRwj/ktB6ITwqtY0vrxlBNHeqcxdZbKSo2ZZQyN+o7l88gBX9t64ryKGQWCnH+1D64h2qCG6Abg+ptv961eqI6d/LOxWhlms67Zr0sqNftZEZrQrBzxZe0UIUPb79\ -8otUUqSeU2l8W8LzNYO5khedFNwV1+bbwiuUEPTljDaPLcf7IfIs7qcwO6uUsMsMWPn7Cw81OYgWzQEkr0CwjpctK6mw+o7I73rKqyDK+GWJFV07eZen3ZETIn2S8n+U92HCC+5L8qlDIHg9D0niCiY9kFcPWs7C\ -rg6eokv5mEVkkf8CQ6yPewfyMgvDqUj/kApVOFwbSlY/feFgRPJl2vTQe9Fj/9yW/IIqNA0flKcNONbTfpFAVb1ThAk6F6XiTU9dUjm0Np03MXyMWkR98hIDvZNCNFNyhGoyOQBQS+F/3ZMGilPXlJyDIgvRBbVf\ -9SAhj0c/Jp+HlEUfpZDdk9peiU6fNMuTFXyyu563HKlLAb+WfWIAUBreEEIoJhWfEcCY5Iv8ZKAt/kT6UFQfv2xfAa+v9kMcqLKzrTcIa28An3/g8nGLWj57vn+CyyeTaaeHT5Rgtr9Zo5c9//VhWl7hlU9r8jyx\ -tkhMuNJcTK8+zQf7/V4RButyWuq7oQBVcKZtGe7OYmyWOJPM/gf0hhEn\ -"""))) -ESP32H2BETA2ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNrNWmtb20YW/isECLTZ24yt26QbsFMbY0iyaTcpSx/TVhpJbLotz0JMQ3br/77znoskG+zk434w2KPRmTNn3vOei/Tf/Xl1N99/ulXsz+6Mnd3Z8CnS8B0f89PJ7M5n4Vt/dpe72V1Go3thMH8V/iTfhj9RGErC\ -/2o7/PFyd0R3z+7q8jwlGYfhj3kR5PfnYTQ6nN3M7ioTvvYGxWgnSM92WYGiN53dlb3R8+l2uNHEeVi1Fz5hbpYNwp/+bH92BfEQdhskxOFHzbNcugijYfEqKGxd+FKHKz5oXtTpbJ+U+v00zCvD/ILvres0XXNB\ -lx6yXWib4VOWKW2T5UH5RAzWaywXPsFuLnx8H/+/Xogu2Rn2OIDy43YdE/5nbsgmeHhRd7iQpXmFQUcHXan9bf3XsD5LD+vdF43jitIRzBMOx/VZbjjOcEDOn+rKOOxwUx5u9vVFatmcts+HzNNtdhwWKSdBth0F\ -CJThzkrNEI1wDafHqxQRH5ExL7FufAhlR13DWZbvsD6NBZFp2EaV8ARCWMKYwG/nGEs6zkLUFq/5CLAk/hfpXmOy53Qow6C3syzCxBNMxXZywAm6McaxSFaJnIxsuh125nqjJdOKaXQrHrYchr82gKqKeTSzbJ4M\ -iznIt4/gAUCSYSxgWu3ODjCpFR208+yEat3MHWEkmLeUkbo844OHNWBvm4pI2+pWGPiftyKsz1CDfnUFoRN1mg4wwi3YRyIeZwRztp2iO65tuzrOo6TVSDFaKuymxFL+vggo9isvXKRjwqb4AWZk8RhwY2B+c+in\ -srMEsycdJGNXXk3U7ziocFmJ2fjRYZDnmDLk+VY0J9sZXElwpbeDAxfRWQKA7PAiuW6/K9zZy1YdWj5qF4Etg61rpQ3IJJrUM1L9c0hRNJqVzSjkaefrbUC/hUhMhKUbdxL64i0JAkv9gc3yUo/4SsAkH6IRHOAQ\ -V+lFRJZdkZUoXAoyOdZQyHiQgyjG4OtEwwuFkVe8hy79AHBgCwFlDgCHS4UjzAaLfTmSKwglbo9d2fbPGeMUR/yxfxvEGP058j9irzgaxJFnxLzHgz2xYsVu6cS6oAPQLPk0mKXyK7EJu/Wx7nBAbjKjG2cDNlaQ\ -NSOFZ6DLPu/BpYMRsw+FSYmLEiO7ofEmrthpNIR3IvLtVxKQfXX4i8ZNcRwJkA9vhMeqQojKxswQRW/CGyHoplsHfCSV/aobfSaKzcHDS4IAslroFY7fG6/XgwAEtIcAxxSpmYMQZMcWQ81h1BeI0pkydpjCFYsd\ -L5mzhoCs77IbceflgpkA2Q1CiJcrAEhWPmXsAV34X1gm+AyTix2+wOw4RDhxTHhsj9dMmA/G5zb0L0cUYMtIMOm1hmVKX2dBeELZme1pdruuFW7h+y5FCCxyL2oQhWdttNi4ZOfkOQrAukXaJiCSXvBWn4jrincX\ -sQR/aOciCf7r4q5BPmVkFkNtjOBGhHN7Dfqwi/e49A4rx3tymGELZcXWKSV3KXPRKF0AGDnnB0JPczZGpvmBKAvF6/yAFWWq2WZwKiOtoYudVckm/rkVT1SQT4ZMaJyiXHZCLn2gpRMzsx5r9HOi3/LtndVwnvH2\ -JnqDA27JDG/H+AInwzcT+9ZaRT54gnPKR7OrwFZ1cl5/D+t+P21cFXTq/HtM0lN7d8IUi1PI4lebFNlScK7wbFUuyfjEZmBR5GYINogLTL27w3fMXwxeqJa8ZYZtiEySnQc9BzmEt9fXi/ffgQW+BxX9ADwVwi8U\ -HrdBg8EIZf8Ee0Fsq1FRlagT+j8zUVSCz1zOVO27pEfvz1y2FLBrkTD7gB187xNbB2LiS4/RDyw0i0vFU6al3Ga8fxIvyJoX/1kvk+DonzKjEgb9/clh4Ru+hXhXEyI7PZCyLV7NttIVN6JcwkpGWI4gCMlDFBJO\ -U/hrdjGiEaicx6mGegA1HpKp0lcMrvxzwEWBz7AUh4rZOf/bO8ZLoaTqUB7UPdG7ufKHIZ97Rjr2P0h1TCNLOnz3iWTELzvJS87BPtdaCGBewnaGyDZFzAtCcsxxeqX+NASK3kJyKjhHHPGPKuc7K3fg/9YiGkGm\ -6j2TIny9rjRIMPiWs/ErzsVJ1xiMqsVIk7migNPM1doJD8KclQMY/g8Ilku9t3HLsrdfXT9bdfkNvGj698j49ZM3wOCb2dU51J/+DMrJT05OcfH0yQtcfDG7egmmvnjZaboU6dlwen7dHgDSPuw1UP6BOIiQbY4Q\ -Gkny32NOLQX+XkKslxBL13LWHTCnFLLHyS4KExAXsOHNFU/YlGbkhSZ82SFobKkG0sxJsxiMFcB0JV0KGz3GYdjxPzktzNjOMeOmqcuWa6pHlwcEuC3Jg7UWi7OBNtDwrasEkiZjj7SU1bNs+mM2HpM4CYZrHbpu\ -d/XTbDa5j4uCRKoNaIspEdGMtV+Lmzrd7MLEV1TdUv8ERRLtJefzFCtfNe056SlAP3gcWQ6QtDQY8xfuiIw3bDinFslleiq7QnfDpst5MWg2i+threfQ9pIoNwl6zhGK8Tcr/5W+0FPdEBxzqfVcoSGK8dt0FVLZ\ -d8b7Q9ym8agdD6UTl8NXUgwTX1o+KEoTUm2HzeaYSmWWXM/7y/PxKZOX1AQqpI5JvqGfTn9+iZ+u6rSIaJGo7U/4dFcKYqnuSye1mKV74/Ze55HC+a8P2Gltid3Z8Rew9zOlcpWddWU7W29D+gWLbvwAPQfUfLVq\ -+NklDEm9V8I8PHuwnCNR2lxtJlyHciW23Kss0p0W8bwdCgNck3inB8UHc8uYWz7NWBtzPn0CMNQJg9Ryx64iw/mCLwSk3LTz0WXzv8iVaDanK5kaFxFYYw51LGqN7xH/KMoDHXE8kscH506in5E778HvWQur5/5X\ -kEGkkADdV+m3UJ5+EkLezG4keDrp79QKgvghRFhhPY4dgr5YspFS8pT48V+ly0CUfCSLUyuJsHkkS8Y8CLL0COImHnvuJhAdV4LdMjve2VVO3dnmmEJlpJTseazHEfJxBIVa7I74Wh6JSUo0jXOri9eyeNLt6PSw\ -finrJ+qsGBspB21ANkxFk6oyegRLAHHqavRQwx4s5MCBAGNHEtpxvowpL0VFXqqiPVEU50cniRhUS1e79Ij62QsE7WOc4jHobQSsjTYEicyjTHegb27FSNVuKWC+VJMxsHypMB4eCU2t4Btn0egrLZia2p6CLiM5\ -B51hF/xNuzlmp/V8lHI4JpoqPCXOo5LK+hOOAl5Mn3IbtqFzJy0HajekuzuMJVO0veM8IvM/5u1zj3uLeuNo+5QUaT1zeAOkfvNggublomLSXrJNb8UVfBVIzenQjO+gKh4/UR+a3oqfkAyRTSB4roODRqoXqdmK\ -EZI2OQkeM2wLWtln4/6dLKpj/MxO2k0QOtH8xLFX4occI950GWGkwXnajRF8rRTY9e5dmUtpsBK1KH0XmFVRq6FVDR3Dw8SjsbSKBWLUw2sTjd/7kUJ6Kt1UKhTF3JRrUnP2khdUczjKiCwXKze9PyFBGaLH5MoF\ -N/zqcqHFQzngoSoTf88p3EjT8GHN8PkIOJVXDMxKctOi/+ExkykVNOnwXbuMv5L6zCw+tqMfQYmfWMyYDxLd3AmvV2vTbtNt3txqUKQT2B0yp8OQRNE4MAqfzNcjCUgCbhIp7PMWuU/cubWdHbWznT/2Engktnp/\ -LOxVo+7I9FlDc3fOd1dVc7fyUyWnqyKkA59JilLajCvhuT4ziaTjIs/zilSqyLrJtI7Eu6xk+6k0hytpSpZK5fGYn65zzJvICCks8YSqZOyrSZQfPribZ/rQ7oNQhtTSaG1BAXaQi0knJEctvkmdurzAPb+xTmV9\ -PFq34uAHelbyD0A6GizgjvJ4Up/wOCNM5JXEa06asloTw0x8PRTrQ3bcUp88WunX0NPj/uMT6qFLN5hLC6T09VJY+Em6cla6GHhbgAiXWF1LPmbeD10DSZe+JMb6Qu+Rio1YrtATptpCfKrOBp5bB1VHmtEnnxly\ -jpKzj115FmDE6YsVxFjzShNNzqnYLkcsnuL8MjjEppTd9ndbla08+mo6E8SEYf0ryYLoPwK4Zh94GlMUS4ZEG6HpiXXDLkv75oErzug9dtotSqynPJeC8nglKOPB5voKZQmg9n7F4oT7TaqvUUwfiOXB+27aNwV8\ -34+2gBB/xu8uaCH5b7ISH1LlOtDw4rxJ29fhrZ6zRny75ABal3kdb0OwPPaHHNpldD9NRjyMLjiMrwlT5+3rOLzDISVa76k22Bar9ynxn3NHuI3mhgjdSlBhO80pyn/XPv5U+3H08K8JoVeSGkvB4f0tZ+4kO1bZ\ -WdJ2N/TM1rFVZd6Q/y4/FhX7166ry1TCby5P3GH05RlqC25K7g+p5v5ykwJbf+c0pQgFVtXpocTXHfvqAZnRprg3WnplCl5/uvoyipQ3ZJ4zoTVLYL5lJBfy4pEiu+CCeV+4BLSPIXpsmrbtv4cUys243U9mDtYi\ -aRigVPiH0389bOppmJxf29HBvOaGXWb1VY3f9GGrYidh197QQZNXauoDbgw2qKOgilI7CLxqHiHe0Gnpc4moXcHEx/IGQM052c3xc2j3VHqJpPJf4Pbbk96xvFPCEAoonXHioAmsdnesfvrCtygA1gRBPALrndHW\ -9yXnAGT8QA4RIZyyvlJ2S/3h3hniAeUBVEDpg49YnhybzusQopSTQllfJqAXQzR2IShVibTh9Zzwv4ykleHUH0vONCiEEEdQVNR2fsrdI11cYseyV9JLHD0psZXa9E6zPkUZZPd9bQ02o03EQY2YXFyvInBQ/Mk3\ -ro758Wd5BnYp7TYXfRQkJ6/30EJPUMkkaKIn0xpN9OTkCO6enO6hnE5e4DLa6L2LqtNGJxow+3/cohcuf3w/z2/w2qU1aRpZm0UmXKmu5jcfm8F+v5eFwTKf5/p+JjAVPGlfhrtSjE0iZ6LF/wCAbuTq\ -"""))) -ESP32C2ROM.STUB_CODE = eval(zlib.decompress(base64.b64decode(b""" -eNq1Wmt7E8cV/iuObXBC8/SZ0V4HgpFARrbBFFKCCxVNdmd2XUhwYyMH00b/vfOei3YlWyb90A+WpdmZM2fO5T2X2f/szJrL2c7djXpnemns9NLGv7qI3/FnfjqcXvoyfkuml5WbXpY0ejsOVs/iR/59/EjjUB7/\ -N5vxw8vqlFZPL9vwugCN6kH8ME8j/WQWR9MH0/PpZWPi18GwHm9F6uU2M1APDqaXYTB+eLAZF5qsirsO4l+cW5bD+JFMd6anIA9iF5FCFn+0PMsV8zgaN28iw9bFL2184iPndVtMd4ip35/EeSHOr3lt2xbFmge6\ -9YjlQseMfyEUdEymB+ZzEdhgIbn4F+Xm4p9P8P/RXHgpj3HGIZjf6/Yx8X/pRiyC6zd1D+ayNe8w7PGgO3W/rX8E6TP1uN9V0lBXWozjZx2V4xKmG9UZFeT8E90Zyo6LqrjYt28Ly+K0CSuZp9tyP24SJpG2HUcT\ -CHFlo2JIx3gG7fEudcoqMuYI+2YPwOy4LzjL9B32p7FIsojHaHKeQBaWs03gt3NsSzrORFQWz1kF2BL/6+L2QmQPSSmjyLezTMJkE0zFcSqYE3hjG8cmZSN0SpLpZjyZG4yXRCui0aN4yHIUP200qibj0dKyeEps\ -5kDffgUPgCUZtgVMa93xLiZ1pCN3np1QpVu6xxiJ4g0y0oZjVjykAXnbQkjajrfawP+8FWIJmxr4axsQnajT9AwjLsE5cvE4IzZnuyl64tZ2u0MfgXYjxmireJqArfxVEmDsA29cF3tkm+IHmFFmezA3NswXD/yB\ -nCzH7EnPknEqryJKeg4qWBYwGz96CPIQU0Y83wrnJDuDJzmeDLagcCFd5jCQLd6k0uP3iTt70rFD26fdJpBllHWrsAGaBJOqI+W/AhW1RrNyGDV5Ovl6GdBvARKTYuuFOwl88ZHEAoP+wGF5q6/4SbRJVqIRO4AS\ -V+FFSIY+yUYYDmKZHGsoZFyLQRRj8HWi4YVC0TM+Qx9+YHBACzHKCgYcH9WObDZK7JuxPEEocbfZlW3ymm2c4ojf9z9EMkZ/jv2POCtUgzhyn5B3f3hbpNiwWzqRLuAAMEs+bRhImrASnnBgn+khh+QpU1o7HbK8\ -Irkp8TwFYiZ8DFcMxwxAFCklNEqY7EfH86xhv9Eo3gvKF/ckJvvmwS8aOrF8zIyvO4iRgxBQ2YwRoh5M+BRkusXGLquksff60Weitjm8Zj94f9kKtsLrB3vrmSDrqSCRQvBR0wZBx54URprAqCMQnjNebDF+qyH2\ -XGTG7MFefR/aCDhP5gwDSG0QP7w8gXWU4S4bHkwL/2vL6F5icr3FDxgaR4gljtGOhfGc0fLa4NzF/eVwAtc1EkkGSkjxfJ0E4QahN9vT7G5fK8DC606ECCRyJWQQfpddqLhxS9NtySEA0q2LLvuQ3IKPekf8Vly7\ -ziTygzuXSuRfF3QNkikjsygmpHsFG29dXJwBO+z8Ix69w87ZbVFmPEJoWDpBEpdQCUfFHIZRcXIg2DRjYZSaHAizYLytdplRxplNNk6FI1esMW2Em2XiJnvf7UA4UE1GDGicopz0Qi79zS96rGRim0RAWFqevsJ/\ -JoviWAVxZrtszNeyDA5KI4fzdg9f4Gf4ZjLfCayuhnegqmo8PY1Q1eav2zcQ8JuDhbcCTp3/iEmquHeHDLFQRJk9uxlnq4Vdr+BsE5bIbCqZjVUaG79zmEFEYMTdHr1j5GLRgKn8BwZWFZamOde6DdTp7dnZ/OMr\ -QMAbBJl/wJhqARcKjJvAwHj8kBzCyxDVWtRSARVC8p5RohHjJHuqOsku8TH4MxcsNSRa5ww9gAY/uClAUfZ54jH0iSmWWYC9L9KV9IuWvl6s2GE2//d6amSP/i5bat1wFrw6OW55zks6e4Z+D3alTstW06tixW8o\ -ebCSAgYEH+zTpjHDNLU/Y58i6IApVVmhsR2WmY3IMYpnbErVF0xp+CsvdqiMnfO/vWPrqBU/HcqAdiDsLp78acRaLom15JNUwTSytPWrLycdftkZjjjd+qNyQrjyLP62RBw7QISLRCrMcfqk/bJT1oO5pE/whizl\ -HwjiWNm4Xf+XzoQRUprBfam31/NKg2QA33PifcppN/GaATy17lgkqajVNEm1dsKDkGjjYAb/TywVDGVAXeMk3jQ/ZB2UXtw7u7/q3evkvHHrCtw+v/MS1vdyevoaDBy8B7RUh4dP8PDJnad4+HR6egQsfnvUa6vU\ -xfHoAMnJWSd65HZw9Yjru+IUuaCRhMpKQiXgM5QSSnMJpWnve8WZANZiTjPgXArVB9bCKnA2oJ3Pb85FK6+5XfUAuLVU62iSpAkLxmqsaKT8sOktaMLu/ZMzwJJFnbHRLOqv5drpq5NdsrYNyXe15srKoTbK8M3Y\ -x8ucWE0xM1Xnog9msz0iJ0Hv+gMjia66Ptx0Olk1jeJJTwB0voKSwymzvsZuOAklIVKmXpY/QhJ7GDskgmdw9orzfZtk/OVGRitELVSpaDvYYjlnRbpaZu2oVcF1TR5KGiL3M+yLzzL8XDxVNazdrRLJivGJzk+1\ -KUggXGuMYWNb9AEKWVMyMCDe0njajcdihwvYUylf4YWAFvyn8F5oA2s6w1SctpHngMr+fEPecERtm1qKj/wF/XT68xv8dE2vqUObpF1HwRfb4gBSjwcnBZSltVm31nkkXf7RLnnh+T30D/b2WQ0VgML0iZd94s62\ -myD/lmkvrBltAlRqrbL4PxUe7krhcZOH92dTsru2xhgy7vnMcXuxLrR9ppLAYYsP/NQ71RRr5oKtcVmdGfXSYMzFt7CGNme5WW6yAaCK3Nf8IJrKOQ1nQqL0v8iTdDqjJ+C5+JpSli6mUJOh1TiNfdt3uf5EyGxf\ -5EdW4peRNVcs735nUWP/AdiUqzUAtpviJdieCH9N8Wp6LuHPCRq2qv7sOluwAl0cA8TwMsknglSxhKapdAXoBx0bXR7Qcdlj2TLj4hqI5xGGTbbneX3LmMVmG8r9rW0Fxq1Njg3GXPD2VaZCDcVtwHor4kaQDPQM\ -FRwEXlnduZWd837jZeDFFAruwRkJWRYpIoPSDQYNOdGkEL6DzN105jovo/uHW/lcFA3NGzuWGN3CB7uG7TayUuV0IJxCnqRHRHblMHiE7/Ip+NyHDveBa2MIe3wD1JctimoHEOfGidTYVmJesJ1I4WueK2Yx4mga\ -9HjRyvOsERV6HTp1c2PYL+QuJEkG2bjf66SOOERlT/zPGEMpbtDjwmg8jzS+CHoG2Xeclc60VZlKuWPYk3EszyKte3wspCrMNX5heePO8k47ITbfoQgotWe9Qb3uxdEGkkUszC1ZXDScC5SHXlvJMG6cL2sWoqtI\ -s6bukonoCqKUKutzIJSRSKE/yoPDBc1UaCJeJROOnwJei+zDo0miRWqVHgiMMz70cqW0K2lLO+mOQMprJILSikbDx8s+ZIw1oh/0wwc/C2KZgytPZpL9r0S0RoAHom7SjkOrHDppDWVjGEXT/iopBjUg1HdbI026\ -nu+WEUhmDFaBckAsC9ldcVC46vmC9oeuMXodrcZ8TtJeN1L8iQQdBDWN2HWdnLDDq8AdJV/2Fvet24CGYRtGaEy5MOcErQ1zLSfCkIegazpgTWWOdBrXn/YSgAZKp2wvjTBZJ59uMahTaVSM3nU7+VOp9Mz8czf6\ -GdD8hf2M+U04d4e8X6vNvvXLhhcS52Sv1pC2t0fSGCjIY+TCwbLTNOlKQGXbRYOsFif3gbFWPb674Wo1Fvj9fgRpOvRBbWhYX3Uh1WK7SMUe8wD1FDKp6y2nBnTc0HNHNgXf9jJP17XUm2RLHKrurqXESe/rFQm1\ -+PdYjxxgJzKyqG4FWIjz8mbzP+c7fL6Z+yQQZJitljKSt5Ne9E87OyZO2vAW+14wlRD2x+s223hLdyh/g+GmwzkcW64t9ebH4U7NSUbTymLgedlq9lkKasTKfsSKDnojCSlU8qNMbh1Se10axXKNSbct7ZKl/CTl\ -QBCd4T0CKiKoy9xoDk2ZwifNIeUC3SRf61yp9SJSqtFSJaimol3rxnUoS+ard6E5EpvAKc62XBAYOU+9YnDWPNM8lmMqS+Qxk6d0YtkijFgEGet2x7KVy7BFY4N8Ju5/KqkW/UeeoIk43dMlSwLckPuKTPpmfScs\ -9bL7uofO9Fbag371Y73XYJjuaYYqbw/U5U2l0JKN2qulEZUvgcf4DYuDVU/k7Pi8e4nAJ36MCtn6Y36tQUvZX0lcrK3GdVpFz45AoNcX4tO+Zo54uaQTWgB6He/iubwRADp0yvRqUo7gmr7lLHd9XDruXtbhQ8Ix\ -Uv+R3q7ZFMEnVILMOI3qgMcQclvBCxbVjLKGV93lqIqQw4R/TtZ6KmBq2Ot8dcEWRLQzpV3mXU9E1Xb9SX76KzUFlq9LRf6t6zNyIBhWyWU8hL48QwXBTcydERX339y0OwL7C3kDItZyTa/zkp315Ks6MuP1lLx5\ -tPRCFULpk9VXVaSeIvEcS8/akj1fsDHX8lqSGnfNtfmO4AplBYncqxZd3/AawY57jUqzu3bakLGv9tdXHKps8IJVyF1huzz+L1ZdafVFjt/0NlZtJ+c3Gm7ou8kLN+2uXOLoSsr98ZZXJHi6uGM8J1zX64u028Fk\ -+17zLM7X9x+iz3iX1afnaChb2JwM9uWlE+3c/i7lqaC39pKs/iWCvojia3IcyGzAbrkjiQUk5zVqUI425CBP50XyVA+OER3o/pKqNr0nyeRy2fRel/BdsCLEkzcN6MURQpeKA1OTS+9ej43GXUikb+LUIyXZoIBC\ -KIFWbaN3AEV3WWOKRSRZdk2K1AOp6hXfdOWNSbrBNeiqw62x0WRt/lF8Zu1T/t2QeVAcKr9YIqR/yD3ApzT4SFmBt2vz5+1L2OvLxxH+6/z17TeIZm9gO3/H4yctKvj86eMjPD6aznpdeEICs/PtBr2R+ePHWXWO\ -9zKtKYrU2jI18UlzOjv/vBhMkkEZB0M1q/QFThhVdKYdGe5TMQOXuSKf/xdxa/YZ\ -"""))) - - -def _main(): - try: - main() - except FatalError as e: - print('\nA fatal error occurred: %s' % e) - sys.exit(2) - - -if __name__ == '__main__': - _main() diff --git a/tools/platformio-build-esp32.py b/tools/platformio-build-esp32.py index 975b99cca04..08d74826a54 100644 --- a/tools/platformio-build-esp32.py +++ b/tools/platformio-build-esp32.py @@ -55,6 +55,7 @@ ], CCFLAGS=[ + "-Os", "-mlongcalls", "-ffunction-sections", "-fdata-sections", @@ -64,7 +65,6 @@ "-Wno-unused-parameter", "-Wno-sign-compare", "-ggdb", - "-Os", "-freorder-blocks", "-Wwrite-strings", "-fstack-protector", @@ -287,7 +287,6 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dsp", "modules", "common", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dsp", "modules", "kalman", "ekf", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dsp", "modules", "kalman", "ekf_imu13states", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_littlefs", "src"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_littlefs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dl", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dl", "include", "tool"), @@ -298,23 +297,24 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dl", "include", "layer"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dl", "include", "detect"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-dl", "include", "model_zoo"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-sr", "src", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-sr", "esp-tts", "esp_tts_chinese", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp-sr", "include", "esp32"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp32-camera", "driver", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp32-camera", "conversions", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "fb_gfx", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi"), "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi")), "include"), join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) ], LIBPATH=[ join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "lib"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "ld"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")) + join(FRAMEWORK_DIR, "tools", "sdk", "esp32", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi"))) ], LIBS=[ - "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-lulp", "-lwifi_provisioning", "-lrmaker_common", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lgpio_button", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-sr", "-lesp32-camera", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_lcd", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lperfmon", "-lesp_adc_cal", "-lesp_hid", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lesp_rainmaker", "-lesp_local_ctrl", "-lesp_https_server", "-lwifi_provisioning", "-lprotocomm", "-lbt", "-lbtdm_app", "-lprotobuf-c", "-lmdns", "-lrmaker_common", "-lmqtt", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-lcat_face_detect", "-lhuman_face_detect", "-lcolor_detect", "-lmfn", "-ldl", "-lwakenet", "-lmultinet", "-lesp_audio_processor", "-lesp_audio_front_end", "-lesp-sr", "-lwakenet", "-lmultinet", "-lesp_audio_processor", "-lesp_audio_front_end", "-ljson", "-lspiffs", "-ldl_lib", "-lc_speech_features", "-lhilexin_wn5", "-lhilexin_wn5X2", "-lhilexin_wn5X3", "-lnihaoxiaozhi_wn5", "-lnihaoxiaozhi_wn5X2", "-lnihaoxiaozhi_wn5X3", "-lnihaoxiaoxin_wn5X3", "-lcustomized_word_wn5", "-lmultinet2_ch", "-lesp_tts_chinese", "-lvoice_set_xiaole", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lesp_phy", "-lphy", "-lrtc", "-lesp_phy", "-lphy", "-lrtc", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" + "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-lulp", "-lwifi_provisioning", "-lrmaker_common", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lgpio_button", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-sr", "-lesp32-camera", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_lcd", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lperfmon", "-lesp_adc_cal", "-lesp_hid", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lesp_rainmaker", "-lesp_local_ctrl", "-lesp_https_server", "-lwifi_provisioning", "-lprotocomm", "-lbt", "-lbtdm_app", "-lprotobuf-c", "-lmdns", "-lrmaker_common", "-lmqtt", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-lcat_face_detect", "-lhuman_face_detect", "-lcolor_detect", "-lmfn", "-ldl", "-lmultinet", "-lesp_audio_processor", "-lesp_audio_front_end", "-lwakenet", "-lesp-sr", "-lmultinet", "-lesp_audio_processor", "-lesp_audio_front_end", "-lwakenet", "-ljson", "-lspiffs", "-ldl_lib", "-lc_speech_features", "-lwakeword_model", "-lmultinet2_ch", "-lesp_tts_chinese", "-lvoice_set_xiaole", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lesp_phy", "-lphy", "-lrtc", "-lesp_phy", "-lphy", "-lrtc", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" ], CPPDEFINES=[ @@ -323,7 +323,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4.2-1-gce1fde4b3b\\"'), + ("IDF_VER", '\\"v4.4.3\\"'), "ESP_PLATFORM", "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", diff --git a/tools/platformio-build-esp32c3.py b/tools/platformio-build-esp32c3.py index 73543ed41fe..05cc75557d1 100644 --- a/tools/platformio-build-esp32c3.py +++ b/tools/platformio-build-esp32c3.py @@ -55,6 +55,7 @@ ], CCFLAGS=[ + "-Os", "-ffunction-sections", "-fdata-sections", "-Wno-error=unused-function", @@ -66,7 +67,6 @@ "-Wno-error=format=", "-nostartfiles", "-Wno-format", - "-Os", "-freorder-blocks", "-Wwrite-strings", "-fstack-protector", @@ -284,7 +284,6 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp-dsp", "modules", "common", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp-dsp", "modules", "kalman", "ekf", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp-dsp", "modules", "kalman", "ekf_imu13states", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_littlefs", "src"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_littlefs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp-dl", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp-dl", "include", "tool"), @@ -298,14 +297,14 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp32-camera", "driver", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp32-camera", "conversions", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "fb_gfx", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi"), "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi")), "include"), join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) ], LIBPATH=[ join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "lib"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "ld"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")) + join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi"))) ], LIBS=[ @@ -318,7 +317,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4.2-1-gce1fde4b3b\\"'), + ("IDF_VER", '\\"v4.4.3\\"'), "ESP_PLATFORM", "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", diff --git a/tools/platformio-build-esp32s2.py b/tools/platformio-build-esp32s2.py index e94de6c5c14..7c325f14210 100644 --- a/tools/platformio-build-esp32s2.py +++ b/tools/platformio-build-esp32s2.py @@ -54,6 +54,7 @@ ], CCFLAGS=[ + "-Os", "-mlongcalls", "-ffunction-sections", "-fdata-sections", @@ -63,7 +64,6 @@ "-Wno-unused-parameter", "-Wno-sign-compare", "-ggdb", - "-Os", "-freorder-blocks", "-Wwrite-strings", "-fstack-protector", @@ -270,7 +270,6 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "freertos", "include", "freertos"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "arduino_tinyusb", "tinyusb", "src"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "arduino_tinyusb", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_littlefs", "src"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_littlefs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp-dl", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp-dl", "include", "tool"), @@ -283,21 +282,22 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp-dl", "include", "model_zoo"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp-sr", "esp-tts", "esp_tts_chinese", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp-sr", "include", "esp32"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp-sr", "src", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp32-camera", "driver", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp32-camera", "conversions", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "fb_gfx", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi"), "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi")), "include"), join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) ], LIBPATH=[ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "lib"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "ld"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")) + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi"))) ], LIBS=[ - "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-lusb", "-ltouch_element", "-lulp", "-lwifi_provisioning", "-lrmaker_common", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lgpio_button", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-sr", "-lesp32-camera", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_lcd", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lperfmon", "-lusb", "-ltouch_element", "-lesp_adc_cal", "-lesp_hid", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lesp_rainmaker", "-lesp_local_ctrl", "-lesp_https_server", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-lmdns", "-lrmaker_common", "-lmqtt", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-larduino_tinyusb", "-lcat_face_detect", "-lhuman_face_detect", "-lcolor_detect", "-lmfn", "-ldl", "-ljson", "-lspiffs", "-lesp_tts_chinese", "-lvoice_set_xiaole", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lesp_phy", "-lphy", "-lesp_phy", "-lphy", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" + "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-lusb", "-ltouch_element", "-lulp", "-lwifi_provisioning", "-lrmaker_common", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lgpio_button", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp32-camera", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_lcd", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lperfmon", "-lusb", "-ltouch_element", "-lesp_adc_cal", "-lesp_hid", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lesp_rainmaker", "-lesp_local_ctrl", "-lesp_https_server", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-lmdns", "-lrmaker_common", "-lmqtt", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-larduino_tinyusb", "-lcat_face_detect", "-lhuman_face_detect", "-lcolor_detect", "-lmfn", "-ldl", "-ljson", "-lspiffs", "-lesp_tts_chinese", "-lvoice_set_xiaole", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lesp_phy", "-lphy", "-lesp_phy", "-lphy", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" ], CPPDEFINES=[ @@ -306,7 +306,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4.2-1-gce1fde4b3b\\"'), + ("IDF_VER", '\\"v4.4.3\\"'), "ESP_PLATFORM", "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", diff --git a/tools/platformio-build-esp32s3.py b/tools/platformio-build-esp32s3.py index 4bce13eb7cb..e33cbde59f8 100644 --- a/tools/platformio-build-esp32s3.py +++ b/tools/platformio-build-esp32s3.py @@ -53,6 +53,7 @@ ], CCFLAGS=[ + "-Os", "-mlongcalls", "-ffunction-sections", "-fdata-sections", @@ -62,7 +63,6 @@ "-Wno-unused-parameter", "-Wno-sign-compare", "-ggdb", - "-Os", "-freorder-blocks", "-Wwrite-strings", "-fstack-protector", @@ -286,7 +286,6 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "freertos", "include", "freertos"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "arduino_tinyusb", "tinyusb", "src"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "arduino_tinyusb", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp_littlefs", "src"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp_littlefs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-dl", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-dl", "include", "tool"), @@ -297,23 +296,24 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-dl", "include", "layer"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-dl", "include", "detect"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-dl", "include", "model_zoo"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-sr", "src", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-sr", "esp-tts", "esp_tts_chinese", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp-sr", "include", "esp32s3"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp32-camera", "driver", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "esp32-camera", "conversions", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "include", "fb_gfx", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi"), "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi")), "include"), join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) ], LIBPATH=[ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "lib"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", "ld"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")) + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s3", env.BoardConfig().get("build.arduino.memory_type", (env.BoardConfig().get("build.flash_mode", "dio") + "_qspi"))) ], LIBS=[ - "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-lusb", "-lulp", "-lwifi_provisioning", "-lrmaker_common", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lgpio_button", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-sr", "-lesp32-camera", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_lcd", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lperfmon", "-lusb", "-lesp_adc_cal", "-lesp_hid", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lesp_rainmaker", "-lesp_local_ctrl", "-lesp_https_server", "-lwifi_provisioning", "-lprotocomm", "-lbt", "-lbtdm_app", "-lprotobuf-c", "-lmdns", "-lrmaker_common", "-lmqtt", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-larduino_tinyusb", "-lcat_face_detect", "-lhuman_face_detect", "-lcolor_detect", "-lmfn", "-ldl", "-lwakenet", "-lhufzip", "-lesp_audio_front_end", "-lesp_audio_processor", "-lmultinet", "-lesp-sr", "-lwakenet", "-lhufzip", "-lesp_audio_front_end", "-lesp_audio_processor", "-lmultinet", "-ljson", "-lspiffs", "-ldl_lib", "-lc_speech_features", "-lesp_tts_chinese", "-lvoice_set_xiaole", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lbtbb", "-lesp_phy", "-lphy", "-lbtbb", "-lesp_phy", "-lphy", "-lbtbb", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" + "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-lusb", "-lulp", "-lwifi_provisioning", "-lrmaker_common", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lgpio_button", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-sr", "-lesp32-camera", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_lcd", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lperfmon", "-lusb", "-lesp_adc_cal", "-lesp_hid", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lesp_rainmaker", "-lesp_local_ctrl", "-lesp_https_server", "-lwifi_provisioning", "-lprotocomm", "-lbt", "-lbtdm_app", "-lprotobuf-c", "-lmdns", "-lrmaker_common", "-lmqtt", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-larduino_tinyusb", "-lcat_face_detect", "-lhuman_face_detect", "-lcolor_detect", "-lmfn", "-ldl", "-lhufzip", "-lesp_audio_front_end", "-lesp_audio_processor", "-lmultinet", "-lwakenet", "-lesp-sr", "-lhufzip", "-lesp_audio_front_end", "-lesp_audio_processor", "-lmultinet", "-lwakenet", "-ljson", "-lspiffs", "-ldl_lib", "-lc_speech_features", "-lesp-dsp", "-lesp_tts_chinese", "-lvoice_set_xiaole", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lesp_ringbuf", "-lefuse", "-lesp_ipc", "-ldriver", "-lesp_pm", "-lmbedtls", "-lapp_update", "-lbootloader_support", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-lconsole", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lxtensa", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls_2", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lbtbb", "-lesp_phy", "-lphy", "-lbtbb", "-lesp_phy", "-lphy", "-lbtbb", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" ], CPPDEFINES=[ @@ -322,7 +322,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4.2-1-gce1fde4b3b\\"'), + ("IDF_VER", '\\"v4.4.3\\"'), "ESP_PLATFORM", "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", diff --git a/tools/platformio-build.py b/tools/platformio-build.py index 5690c046d61..39bda3a8829 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -24,7 +24,7 @@ # Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py -from os.path import abspath, isdir, isfile, join +from os.path import abspath, basename, isdir, isfile, join from SCons.Script import DefaultEnvironment, SConscript @@ -32,6 +32,9 @@ platform = env.PioPlatform() board_config = env.BoardConfig() build_mcu = board_config.get("build.mcu", "").lower() +partitions_name = board_config.get( + "build.partitions", board_config.get("build.arduino.partitions", "") +) FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") assert isdir(FRAMEWORK_DIR) @@ -41,25 +44,23 @@ # Helpers # + def get_partition_table_csv(variants_dir): fwpartitions_dir = join(FRAMEWORK_DIR, "tools", "partitions") + variant_partitions_dir = join(variants_dir, board_config.get("build.variant", "")) - custom_partition = board_config.get( - "build.partitions", board_config.get("build.arduino.partitions", "") - ) + if partitions_name: + # A custom partitions file is selected + if isfile(join(variant_partitions_dir, partitions_name)): + return join(variant_partitions_dir, partitions_name) - if custom_partition: - partitions_csv = board_config.get("build.partitions", board_config.get( - "build.arduino.partitions", "default.csv")) return abspath( - join(fwpartitions_dir, partitions_csv) - if isfile(join(fwpartitions_dir, partitions_csv)) - else partitions_csv + join(fwpartitions_dir, partitions_name) + if isfile(join(fwpartitions_dir, partitions_name)) + else partitions_name ) - variant_partitions = join( - variants_dir, board_config.get("build.variant", ""), "partitions.csv" - ) + variant_partitions = join(variant_partitions_dir, "partitions.csv") return ( variant_partitions if isfile(variant_partitions) @@ -68,9 +69,16 @@ def get_partition_table_csv(variants_dir): def get_bootloader_image(variants_dir): + bootloader_image_file = "bootloader.bin" + if partitions_name.endswith("tinyuf2.csv"): + bootloader_image_file = "bootloader-tinyuf2.bin" + variant_bootloader = join( - variants_dir, board_config.get("build.variant", ""), "bootloader.bin" + variants_dir, + board_config.get("build.variant", ""), + board_config.get("build.arduino.custom_bootloader", bootloader_image_file), ) + return ( variant_bootloader if isfile(variant_bootloader) @@ -85,6 +93,78 @@ def get_bootloader_image(variants_dir): ) +def get_patched_bootloader_image(original_bootloader_image, bootloader_offset): + patched_bootloader_image = join(env.subst("$BUILD_DIR"), "patched_bootloader.bin") + bootloader_cmd = env.Command( + patched_bootloader_image, + original_bootloader_image, + env.VerboseAction( + " ".join( + [ + '"$PYTHONEXE"', + join( + platform.get_package_dir("tool-esptoolpy") or "", "esptool.py" + ), + "--chip", + build_mcu, + "merge_bin", + "-o", + "$TARGET", + "--flash_mode", + "${__get_board_flash_mode(__env__)}", + "--flash_freq", + "${__get_board_f_flash(__env__)}", + "--flash_size", + board_config.get("upload.flash_size", "4MB"), + "--target-offset", + bootloader_offset, + bootloader_offset, + "$SOURCE", + ] + ), + "Updating bootloader headers", + ), + ) + env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", bootloader_cmd) + + return patched_bootloader_image + + +def add_tinyuf2_extra_image(): + tinuf2_image = board_config.get( + "upload.arduino.tinyuf2_image", + join(variants_dir, board_config.get("build.variant", ""), "tinyuf2.bin"), + ) + + # Add the UF2 image only if it exists and it's not already added + if not isfile(tinuf2_image): + print("Warning! The `%s` UF2 bootloader image doesn't exist" % tinuf2_image) + return + + if any( + "tinyuf2.bin" == basename(extra_image[1]) + for extra_image in env.get("FLASH_EXTRA_IMAGES", []) + ): + print("Warning! An extra UF2 bootloader image is already added!") + return + + env.Append( + FLASH_EXTRA_IMAGES=[ + ( + board_config.get( + "upload.arduino.uf2_bootloader_offset", + ( + "0x2d0000" + if env.subst("$BOARD").startswith("adafruit") + else "0x410000" + ), + ), + tinuf2_image, + ), + ] + ) + + # # Run target-specific script to populate the environment with proper build flags # @@ -99,32 +179,6 @@ def get_bootloader_image(variants_dir): ) ) -# -# Process framework extra images -# - -env.Append( - LIBSOURCE_DIRS=[ - join(FRAMEWORK_DIR, "libraries") - ], - - FLASH_EXTRA_IMAGES=[ - ( - "0x1000" if build_mcu in ("esp32", "esp32s2") else "0x0000", - get_bootloader_image(board_config.get( - "build.variants_dir", join(FRAMEWORK_DIR, "variants"))) - ), - ("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")), - ("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin")) - ] - + [ - (offset, join(FRAMEWORK_DIR, img)) - for offset, img in board_config.get( - "upload.arduino.flash_extra_images", [] - ) - ], -) - # # Target: Build Core Library # @@ -137,23 +191,68 @@ def get_bootloader_image(variants_dir): variants_dir = join("$PROJECT_DIR", board_config.get("build.variants_dir")) if "build.variant" in board_config: - env.Append( - CPPPATH=[ - join(variants_dir, board_config.get("build.variant")) - ] - ) + env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))]) env.BuildSources( join("$BUILD_DIR", "FrameworkArduinoVariant"), - join(variants_dir, board_config.get("build.variant")) + join(variants_dir, board_config.get("build.variant")), ) -libs.append(env.BuildLibrary( - join("$BUILD_DIR", "FrameworkArduino"), - join(FRAMEWORK_DIR, "cores", board_config.get("build.core")) -)) +libs.append( + env.BuildLibrary( + join("$BUILD_DIR", "FrameworkArduino"), + join(FRAMEWORK_DIR, "cores", board_config.get("build.core")), + ) +) env.Prepend(LIBS=libs) +# +# Process framework extra images +# + +# Starting with v2.0.4 the Arduino core contains updated bootloader images that have +# innacurate default headers. This results in bootloops if firmware is flashed via +# OpenOCD (e.g. debugging or uploading via debug tools). For this reason, before +# uploading or debugging we need to adjust the bootloader binary according to +# the values of the --flash-size and --flash-mode arguments. +# Note: This behavior doesn't occur if uploading is done via esptoolpy, as esptoolpy +# overrides the binary image headers before flashing. + +bootloader_patch_required = bool( + env.get("PIOFRAMEWORK", []) == ["arduino"] + and ( + "debug" in env.GetBuildType() + or env.subst("$UPLOAD_PROTOCOL") in board_config.get("debug.tools", {}) + or env.IsIntegrationDump() + ) +) + +bootloader_image_path = get_bootloader_image(variants_dir) +bootloader_offset = "0x1000" if build_mcu in ("esp32", "esp32s2") else "0x0000" +if bootloader_patch_required: + bootloader_image_path = get_patched_bootloader_image( + bootloader_image_path, bootloader_offset + ) + +env.Append( + LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")], + FLASH_EXTRA_IMAGES=[ + (bootloader_offset, bootloader_image_path), + ("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")), + ("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin")), + ] + + [ + (offset, join(FRAMEWORK_DIR, img)) + for offset, img in board_config.get("upload.arduino.flash_extra_images", []) + ], +) + +# Add an extra UF2 image if the 'TinyUF2' partition is selected +if partitions_name.endswith("tinyuf2.csv") or board_config.get( + "upload.arduino.tinyuf2_image", "" +): + add_tinyuf2_extra_image() + # # Generate partition table # diff --git a/tools/sdk/esp32/bin/bootloader_dio_40m.bin b/tools/sdk/esp32/bin/bootloader_dio_40m.bin index 551473009c5..455e42b3b26 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dio_40m.elf b/tools/sdk/esp32/bin/bootloader_dio_40m.elf new file mode 100755 index 00000000000..169f28df732 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_dio_40m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_dio_80m.bin b/tools/sdk/esp32/bin/bootloader_dio_80m.bin index 7543bfbbe98..d4438b12f8f 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dio_80m.elf b/tools/sdk/esp32/bin/bootloader_dio_80m.elf new file mode 100755 index 00000000000..42ff5c30984 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_dio_80m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_40m.bin b/tools/sdk/esp32/bin/bootloader_dout_40m.bin index 551473009c5..455e42b3b26 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_40m.elf b/tools/sdk/esp32/bin/bootloader_dout_40m.elf new file mode 100755 index 00000000000..169f28df732 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_dout_40m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_80m.bin b/tools/sdk/esp32/bin/bootloader_dout_80m.bin index 7543bfbbe98..d4438b12f8f 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_80m.elf b/tools/sdk/esp32/bin/bootloader_dout_80m.elf new file mode 100755 index 00000000000..42ff5c30984 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_dout_80m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_40m.bin b/tools/sdk/esp32/bin/bootloader_qio_40m.bin index 2872dbfbd5d..6e83f2cb9b5 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_40m.elf b/tools/sdk/esp32/bin/bootloader_qio_40m.elf new file mode 100755 index 00000000000..9b65a2208f9 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_qio_40m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_80m.bin b/tools/sdk/esp32/bin/bootloader_qio_80m.bin index e3637561a79..c7d14d6f99f 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_80m.elf b/tools/sdk/esp32/bin/bootloader_qio_80m.elf new file mode 100755 index 00000000000..9003ecb1397 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_qio_80m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_40m.bin b/tools/sdk/esp32/bin/bootloader_qout_40m.bin index 6e579a25787..7167242f9c6 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_40m.elf b/tools/sdk/esp32/bin/bootloader_qout_40m.elf new file mode 100755 index 00000000000..35e5d3b09ae Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_qout_40m.elf differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_80m.bin b/tools/sdk/esp32/bin/bootloader_qout_80m.bin index 737f2b122cd..aae7905b2e3 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_80m.elf b/tools/sdk/esp32/bin/bootloader_qout_80m.elf new file mode 100755 index 00000000000..6cf4ccc9443 Binary files /dev/null and b/tools/sdk/esp32/bin/bootloader_qout_80m.elf differ diff --git a/tools/sdk/esp32/dio_qspi/include/sdkconfig.h b/tools/sdk/esp32/dio_qspi/include/sdkconfig.h index c83ba79e6dc..888089d3b24 100644 --- a/tools/sdk/esp32/dio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32/dio_qspi/include/sdkconfig.h @@ -59,11 +59,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -159,6 +161,7 @@ #define CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BLE_MESH 1 #define CONFIG_BLE_MESH_HCI_5_0 1 #define CONFIG_BLE_MESH_USE_DUPLICATE_SCAN 1 @@ -195,6 +198,10 @@ #define CONFIG_COAP_MBEDTLS_PSK 1 #define CONFIG_COAP_LOG_DEFAULT_LEVEL 0 #define CONFIG_ADC_DISABLE_DAC 1 +#define CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC 1 +#define CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT 1 #define CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4 1 #define CONFIG_EFUSE_MAX_BLK_LEN 192 #define CONFIG_ESP_TLS_USING_MBEDTLS 1 @@ -229,7 +236,7 @@ #define CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM 1 #define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1 #define CONFIG_SPIRAM_BANKSWITCH_RESERVE 8 -#define CONFIG_SPIRAM_OCCUPY_VSPI_HOST 1 +#define CONFIG_SPIRAM_OCCUPY_HSPI_HOST 1 #define CONFIG_D0WD_PSRAM_CLK_IO 17 #define CONFIG_D0WD_PSRAM_CS_IO 16 #define CONFIG_D2WD_PSRAM_CLK_IO 9 @@ -283,6 +290,8 @@ #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 #define CONFIG_ESP_IPC_ISR_ENABLE 1 @@ -625,6 +634,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -752,5 +762,5 @@ #define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED #define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32/dio_qspi/libspi_flash.a b/tools/sdk/esp32/dio_qspi/libspi_flash.a index 63c40deaffa..ae00247f6d6 100644 Binary files a/tools/sdk/esp32/dio_qspi/libspi_flash.a and b/tools/sdk/esp32/dio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32/dout_qspi/include/sdkconfig.h b/tools/sdk/esp32/dout_qspi/include/sdkconfig.h index 49f90eb9c6d..74711f63e23 100644 --- a/tools/sdk/esp32/dout_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32/dout_qspi/include/sdkconfig.h @@ -59,11 +59,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -159,6 +161,7 @@ #define CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BLE_MESH 1 #define CONFIG_BLE_MESH_HCI_5_0 1 #define CONFIG_BLE_MESH_USE_DUPLICATE_SCAN 1 @@ -195,6 +198,10 @@ #define CONFIG_COAP_MBEDTLS_PSK 1 #define CONFIG_COAP_LOG_DEFAULT_LEVEL 0 #define CONFIG_ADC_DISABLE_DAC 1 +#define CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC 1 +#define CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT 1 #define CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4 1 #define CONFIG_EFUSE_MAX_BLK_LEN 192 #define CONFIG_ESP_TLS_USING_MBEDTLS 1 @@ -229,7 +236,7 @@ #define CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM 1 #define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1 #define CONFIG_SPIRAM_BANKSWITCH_RESERVE 8 -#define CONFIG_SPIRAM_OCCUPY_VSPI_HOST 1 +#define CONFIG_SPIRAM_OCCUPY_HSPI_HOST 1 #define CONFIG_D0WD_PSRAM_CLK_IO 17 #define CONFIG_D0WD_PSRAM_CS_IO 16 #define CONFIG_D2WD_PSRAM_CLK_IO 9 @@ -283,6 +290,8 @@ #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 #define CONFIG_ESP_IPC_ISR_ENABLE 1 @@ -625,6 +634,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -752,5 +762,5 @@ #define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED #define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32/dout_qspi/libspi_flash.a b/tools/sdk/esp32/dout_qspi/libspi_flash.a index 04aa772b5b8..8548b5e284c 100644 Binary files a/tools/sdk/esp32/dout_qspi/libspi_flash.a and b/tools/sdk/esp32/dout_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h index 2f4e9062200..1a641be10ec 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h @@ -26,7 +26,7 @@ extern "C" { #endif -/// Type of hold a GPIO in low state +// Type of hold a GPIO in low state typedef enum { GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */ GPIO_SHORT_HOLD = -1, /*!< The short hold GPIO */ diff --git a/tools/sdk/esp32/include/bt/common/api/include/api/esp_blufi_api.h b/tools/sdk/esp32/include/bt/common/api/include/api/esp_blufi_api.h index 7c99f658206..63109b20f12 100644 --- a/tools/sdk/esp32/include/bt/common/api/include/api/esp_blufi_api.h +++ b/tools/sdk/esp32/include/bt/common/api/include/api/esp_blufi_api.h @@ -114,9 +114,9 @@ typedef struct { } esp_blufi_ap_record_t; /// Bluetooth address length -#define ESP_BD_ADDR_LEN 6 +#define ESP_BLUFI_BD_ADDR_LEN 6 /// Bluetooth device address -typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN]; +typedef uint8_t esp_blufi_bd_addr_t[ESP_BLUFI_BD_ADDR_LEN]; /** * @brief BLUFI callback parameters union @@ -147,7 +147,7 @@ typedef union { * @brief ESP_BLUFI_EVENT_CONNECT */ struct blufi_connect_evt_param { - esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ + esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ uint8_t server_if; /*!< server interface */ uint16_t conn_id; /*!< Connection id */ } connect; /*!< Blufi callback param of ESP_BLUFI_EVENT_CONNECT */ @@ -156,7 +156,7 @@ typedef union { * @brief ESP_BLUFI_EVENT_DISCONNECT */ struct blufi_disconnect_evt_param { - esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ + esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ } disconnect; /*!< Blufi callback param of ESP_BLUFI_EVENT_DISCONNECT */ /* ESP_BLUFI_EVENT_REQ_WIFI_CONNECT */ /* No callback param */ diff --git a/tools/sdk/esp32/include/bt/common/osi/include/osi/fixed_pkt_queue.h b/tools/sdk/esp32/include/bt/common/osi/include/osi/fixed_pkt_queue.h new file mode 100644 index 00000000000..f4235ca5d99 --- /dev/null +++ b/tools/sdk/esp32/include/bt/common/osi/include/osi/fixed_pkt_queue.h @@ -0,0 +1,79 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _FIXED_PKT_QUEUE_H_ +#define _FIXED_PKT_QUEUE_H_ + + +#include "osi/pkt_queue.h" +#include "osi/semaphore.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef FIXED_PKT_QUEUE_SIZE_MAX +#define FIXED_PKT_QUEUE_SIZE_MAX 254 +#endif + +#define FIXED_PKT_QUEUE_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT + +struct fixed_pkt_queue_t; + +typedef struct fixed_pkt_queue_t fixed_pkt_queue_t; + +typedef void (*fixed_pkt_queue_free_cb)(pkt_linked_item_t *data); +typedef void (*fixed_pkt_queue_cb)(fixed_pkt_queue_t *queue); + +// Creates a new fixed queue with the given |capacity|. If more elements than +// |capacity| are added to the queue, the caller is blocked until space is +// made available in the queue. Returns NULL on failure. The caller must free +// the returned queue with |fixed_pkt_queue_free|. +fixed_pkt_queue_t *fixed_pkt_queue_new(size_t capacity); + +// Freeing a queue that is currently in use (i.e. has waiters +// blocked on it) results in undefined behaviour. +void fixed_pkt_queue_free(fixed_pkt_queue_t *queue, fixed_pkt_queue_free_cb free_cb); + +// Returns a value indicating whether the given |queue| is empty. If |queue| +// is NULL, the return value is true. +bool fixed_pkt_queue_is_empty(fixed_pkt_queue_t *queue); + +// Returns the length of the |queue|. If |queue| is NULL, the return value +// is 0. +size_t fixed_pkt_queue_length(fixed_pkt_queue_t *queue); + +// Returns the maximum number of elements this queue may hold. |queue| may +// not be NULL. +size_t fixed_pkt_queue_capacity(fixed_pkt_queue_t *queue); + +// Enqueues the given |data| into the |queue|. The caller will be blocked or immediately return or wait for timeout according to the parameter timeout. +// If enqueue failed, it will return false, otherwise return true +bool fixed_pkt_queue_enqueue(fixed_pkt_queue_t *queue, pkt_linked_item_t *linked_pkt, uint32_t timeout); + +// Dequeues the next element from |queue|. If the queue is currently empty, +// this function will block the caller until an item is enqueued or immediately return or wait for timeout according to the parameter timeout. +// If dequeue failed, it will return NULL, otherwise return a point. +pkt_linked_item_t *fixed_pkt_queue_dequeue(fixed_pkt_queue_t *queue, uint32_t timeout); + +// Returns the first element from |queue|, if present, without dequeuing it. +// This function will never block the caller. Returns NULL if there are no +// elements in the queue or |queue| is NULL. +pkt_linked_item_t *fixed_pkt_queue_try_peek_first(fixed_pkt_queue_t *queue); + +// Registers |queue| with |reactor| for dequeue operations. When there is an element +// in the queue, ready_cb will be called. The |context| parameter is passed, untouched, +// to the callback routine. Neither |queue|, nor |reactor|, nor |read_cb| may be NULL. +// |context| may be NULL. +void fixed_pkt_queue_register_dequeue(fixed_pkt_queue_t *queue, fixed_pkt_queue_cb ready_cb); + +// Unregisters the dequeue ready callback for |queue| from whichever reactor +// it is registered with, if any. This function is idempotent. +void fixed_pkt_queue_unregister_dequeue(fixed_pkt_queue_t *queue); + +void fixed_pkt_queue_process(fixed_pkt_queue_t *queue); + +#endif diff --git a/tools/sdk/esp32/include/bt/common/osi/include/osi/pkt_queue.h b/tools/sdk/esp32/include/bt/common/osi/include/osi/pkt_queue.h new file mode 100644 index 00000000000..96277c3e182 --- /dev/null +++ b/tools/sdk/esp32/include/bt/common/osi/include/osi/pkt_queue.h @@ -0,0 +1,88 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _PKT_LIST_H_ +#define _PKT_LIST_H_ + +#include "sys/queue.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct pkt_queue; + +typedef struct pkt_linked_item { + STAILQ_ENTRY(pkt_linked_item) next; + uint8_t data[]; +} pkt_linked_item_t; + +#define BT_PKT_LINKED_HDR_SIZE (sizeof (pkt_linked_item_t)) + +typedef void (*pkt_queue_free_cb)(pkt_linked_item_t *item); + +/* + * brief: create a pkt_queue instance. pkt_queue is a wrapper class of a FIFO implemented by single linked list. + * The enqueue and dequeue operations of the FIFO are protected against race conditions of multiple tasks + * return: NULL if not enough memory, otherwise a valid pointer + */ +struct pkt_queue *pkt_queue_create(void); + +/* + * brief: enqueue one item to the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * param item: the item to be enqueued to the FIFO + * return: true if enqueued successfully, false when the arguments passed in are invalid + */ +bool pkt_queue_enqueue(struct pkt_queue *queue, pkt_linked_item_t *item); + +/* + * brief: dequeue one item for the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * return: pointer of type pkt_linked_item_t dequeued, NULL if the queue is empty or upon exception + */ +pkt_linked_item_t *pkt_queue_dequeue(struct pkt_queue *queue); + +/* + * brief: get the pointer of the first item from the FIFO but not get it dequeued + * param queue: pkt_queue instance created using pkt_queue_create + * return: pointer of the first item in the FIFO, NULL if the FIFO is empty + */ +pkt_linked_item_t *pkt_queue_try_peek_first(struct pkt_queue *queue); + +/* + * brief: retrieve the number of items existing in the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * return: total number of items in the FIFO + */ +size_t pkt_queue_length(const struct pkt_queue *queue); + +/* + * brief: retrieve the status whether the FIFO is empty + * param queue: pkt_queue instance created using pkt_queue_create + * return: false if the FIFO is not empty, otherwise true + */ +bool pkt_queue_is_empty(const struct pkt_queue *queue); + +/* + * brief: delete the item in the FIFO one by one + * param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default + */ +void pkt_queue_flush(struct pkt_queue *queue, pkt_queue_free_cb free_cb); + +/* + * brief: delete the items in the FIFO and then destroy the pkt_queue instance. + * param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default + */ +void pkt_queue_destroy(struct pkt_queue *queue, pkt_queue_free_cb free_cb); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tools/sdk/esp32/include/bt/common/osi/include/osi/thread.h b/tools/sdk/esp32/include/bt/common/osi/include/osi/thread.h index fdabed1cf68..c9be3375ddc 100644 --- a/tools/sdk/esp32/include/bt/common/osi/include/osi/thread.h +++ b/tools/sdk/esp32/include/bt/common/osi/include/osi/thread.h @@ -28,6 +28,7 @@ #define OSI_THREAD_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT struct osi_thread; +struct osi_event; typedef struct osi_thread osi_thread_t; @@ -48,7 +49,7 @@ typedef enum { * param work_queue_num: speicify queue number, the queue[0] has highest priority, and the priority is decrease by index * return : if create successfully, return thread handler; otherwise return NULL. */ -osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num); +osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num, const size_t work_queue_len[]); /* * brief: Destroy a thread or task @@ -88,4 +89,42 @@ const char *osi_thread_name(osi_thread_t *thread); */ int osi_thread_queue_wait_size(osi_thread_t *thread, int wq_idx); +/* + * brief: Create an osi_event struct and register the handler function and its argument + * An osi_event is a kind of work that can be posted to the workqueue of osi_thread to process, + * but the work can have at most one instance the thread workqueue before it is processed. This + * allows the "single post, multiple data processing" jobs. + * param func: the handler to process the job + * param context: the argument to be passed to the handler function when the job is being processed + * return: NULL if no memory, otherwise a valid struct pointer + */ +struct osi_event *osi_event_create(osi_thread_func_t func, void *context); + +/* + * brief: Bind an osi_event to a specific work queue for an osi_thread. + * After binding is completed, a function call of API osi_thread_post_event will send a work + * to the workqueue of the thread, with specified queue index. + * param func: event: the pointer to osi_event that is created using osi_event_create + * param thread: the pointer to osi_thread that is created using osi_thread_create + * param queue_idx: the index of the workqueue of the specified osi_thread, with range starting from 0 to work_queue_num - 1 + * return: true if osi_event binds to the thread's workqueue successfully, otherwise false + */ +bool osi_event_bind(struct osi_event* event, osi_thread_t *thread, int queue_idx); + +/* + * brief: Destroy the osi_event struct created by osi_event_create and free the allocated memory + * param event: the pointer to osi_event + */ +void osi_event_delete(struct osi_event* event); + +/* + * brief: try sending a work to the binded thread's workqueue, so that it can be handled by the worker thread + * param event: pointer to osi_event, created by osi_event_create + * param timeout: post timeout, OSI_THREAD_MAX_TIMEOUT means blocking forever, 0 means never blocking, others means block millisecond + * return: true if the message is enqueued to the thread workqueue, otherwise failed + * note: if the return value of function is false, it is the case that the workqueue of the thread is full, and users + * are expected to post the event sometime later to get the work handled. + */ +bool osi_thread_post_event(struct osi_event *event, uint32_t timeout); + #endif /* __THREAD_H__ */ diff --git a/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/mesh.h b/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/mesh.h index 33155aa555c..cb6efd0dc03 100644 --- a/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/mesh.h +++ b/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/mesh.h @@ -20,7 +20,7 @@ extern "C" { #define BLE_MESH_KEY_ANY 0xffff #define BLE_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000) -#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) <= 0xff00) +#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00) #define BLE_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000) #define BLE_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfffb) diff --git a/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/net.h b/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/net.h index 8a1b9b343a3..f982c41cee4 100644 --- a/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/net.h +++ b/tools/sdk/esp32/include/bt/esp_ble_mesh/mesh_core/net.h @@ -95,7 +95,6 @@ struct bt_mesh_friend { uint8_t fsn:1, send_last:1, pending_req:1, - sec_update:1, pending_buf:1, valid:1, established:1; diff --git a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h index f81ad21800e..0f0a1935d31 100644 --- a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h +++ b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h @@ -25,8 +25,8 @@ extern "C" { #endif -/**@{ - * BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag +/** + * @brief BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag */ #define ESP_BLE_ADV_FLAG_LIMIT_DISC (0x01 << 0) #define ESP_BLE_ADV_FLAG_GEN_DISC (0x01 << 1) @@ -34,104 +34,102 @@ extern "C" { #define ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT (0x01 << 3) #define ESP_BLE_ADV_FLAG_DMT_HOST_SPT (0x01 << 4) #define ESP_BLE_ADV_FLAG_NON_LIMIT_DISC (0x00 ) -/** - * @} - */ -/* relate to BTM_LE_KEY_xxx in stack/btm_api.h */ -#define ESP_LE_KEY_NONE 0 /* relate to BTM_LE_KEY_NONE in stack/btm_api.h */ -#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ /* relate to BTM_LE_KEY_PENC in stack/btm_api.h */ -#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ /* relate to BTM_LE_KEY_PID in stack/btm_api.h */ -#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ /* relate to BTM_LE_KEY_PCSRK in stack/btm_api.h */ -#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ /* relate to BTM_LE_KEY_PLK in stack/btm_api.h */ -#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /* relate to BTM_LE_KEY_LLK in stack/btm_api.h */ -#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ /* relate to BTM_LE_KEY_LENC in stack/btm_api.h */ -#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ /* relate to BTM_LE_KEY_LID in stack/btm_api.h */ -#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ /* relate to BTM_LE_KEY_LCSRK in stack/btm_api.h */ + +/// relate to BTM_LE_KEY_xxx in stack/btm_api.h +#define ESP_LE_KEY_NONE 0 /*!< No encryption key */ +#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ +#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ +#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ +#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ +#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /*!< peer link key*/ +#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ +#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ +#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ typedef uint8_t esp_ble_key_type_t; -/* relate to BTM_LE_AUTH_xxx in stack/btm_api.h */ -#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)/*!< 0101*/ -#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM_BOND in stack/btm_api.h */ +/// relate to BTM_LE_AUTH_xxx in stack/btm_api.h +#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0 no bondingv*/ +#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 device in the bonding with peer */ +#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 man in the middle attack */ +#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM) /*!< 0101 banding with man in the middle attack */ +#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 secure connection */ +#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 secure connection with band*/ +#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 secure conn with MITM */ +#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 SC with MITM and Bonding*/ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit pattern */ -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 - -#define ESP_BLE_OOB_DISABLE 0 -#define ESP_BLE_OOB_ENABLE 1 - -/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */ -#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */ -#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */ -#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */ -#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */ -#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in stack/btm_api.h */ - -#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /* relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /* relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /* relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /* relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /* relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /* relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /* relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /* relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /* relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /* relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /* relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /* relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /* relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /* relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /* relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /* relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /* relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /* relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /* relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /* relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /* relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /* relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /* relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /* relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /* relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /* relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /* relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /* relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /* relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /* relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /* relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /* relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /* relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /* relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /* relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /* relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /* relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /* relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ +#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 /*!< authentication disable*/ +#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 /*!< authentication enable*/ + +#define ESP_BLE_OOB_DISABLE 0 /*!< disbale the out of bond*/ +#define ESP_BLE_OOB_ENABLE 1 /*!< enable the out of bond*/ + +/// relate to BTM_IO_CAP_xxx in stack/btm_api.h +#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ +#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ +#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ +#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ +#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ + +#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /*!< relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /*!< relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /*!< relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /*!< relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /*!< relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /*!< relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /*!< relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /*!< relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /*!< relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /*!< relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /*!< relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /*!< relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /*!< relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */ @@ -147,15 +145,15 @@ typedef enum { ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */ ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */ #endif // #if (BLE_42_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */ - ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */ - ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */ - ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /* passkey notification event */ - ESP_GAP_BLE_PASSKEY_REQ_EVT, /* passkey request event */ - ESP_GAP_BLE_OOB_REQ_EVT, /* OOB request event */ - ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */ - ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */ - ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */ + ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */ + ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */ + ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */ + ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /*!< passkey notification event */ + ESP_GAP_BLE_PASSKEY_REQ_EVT, /*!< passkey request event */ + ESP_GAP_BLE_OOB_REQ_EVT, /*!< OOB request event */ + ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */ + ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */ + ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */ #if (BLE_42_FEATURE_SUPPORT == TRUE) ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */ ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */ @@ -174,45 +172,45 @@ typedef enum { #endif //#if (BLE_42_FEATURE_SUPPORT == TRUE) ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */ #if (BLE_50_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, - ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, - ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, - ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, - ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, - ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_REPORT_EVT, - ESP_GAP_BLE_SCAN_TIMEOUT_EVT, - ESP_GAP_BLE_ADV_TERMINATED_EVT, - ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, - ESP_GAP_BLE_CHANNEL_SELETE_ALGORITHM_EVT, - ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, + ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */ + ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */ + ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */ + ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, /*!< when extended set random address complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when extended advertising parameter complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, /*!< when extended advertising data complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< when extended scan response data complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, /*!< when extended advertising start complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, /*!< when extended advertising stop complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, /*!< when extended advertising set remove complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, /*!< when extended advertising set clear complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when periodic advertising parameter complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, /*!< when periodic advertising data complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, /*!< when periodic advertising start complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, /*!< when periodic advertising stop complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, /*!< when periodic advertising create sync complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, /*!< when extended advertising sync cancel complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, /*!< when extended advertising sync terminate complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, /*!< when extended advertising add device complete , the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, /*!< when extended advertising remove device complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, /*!< when extended advertising clear device, the event comes */ + ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, /*!< when extended scan parameter complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, /*!< when extended scan start complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, /*!< when extended scan stop complete, the event comes */ + ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, /*!< when extended prefer connection parameter set complete, the event comes */ + ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, /*!< when ble phy update complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_REPORT_EVT, /*!< when extended advertising report complete, the event comes */ + ESP_GAP_BLE_SCAN_TIMEOUT_EVT, /*!< when scan timeout complete, the event comes */ + ESP_GAP_BLE_ADV_TERMINATED_EVT, /*!< when advertising terminate data complete, the event comes */ + ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, /*!< when scan req received complete, the event comes */ + ESP_GAP_BLE_CHANNEL_SELETE_ALGORITHM_EVT, /*!< when channel select algorithm complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */ #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_EVT_MAX, + ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */ } esp_gap_ble_cb_event_t; -#define ESP_GAP_BLE_CHANNELS_LEN 5 +#define ESP_GAP_BLE_CHANNELS_LEN 5 /*!< channel length*/ typedef uint8_t esp_gap_ble_channels[ESP_GAP_BLE_CHANNELS_LEN]; /// This is the old name, just for backwards compatibility @@ -296,46 +294,47 @@ typedef enum { /* relate to BTA_DM_BLE_SEC_xxx in bta/bta_api.h */ typedef enum { - ESP_BLE_SEC_ENCRYPT = 1, /* relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already - bonded, the stack will used LTK to encrypt with the remote device directly. + ESP_BLE_SEC_ENCRYPT = 1, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already + bonded, the stack will used Long Term Key (LTK) to encrypt with the remote device directly. Else if the device hasn't bonded, the stack will used the default authentication request used the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_NO_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used NO MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ + ESP_BLE_SEC_ENCRYPT_NO_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has been already + bonded, the stack will check the LTK (Long Term Key) Whether the authentication request has been met, and if met, use the LTK + to encrypt with the remote device directly, else re-pair with the remote device. + Else if the device hasn't been bonded, the stack will use NO MITM authentication request in the current link instead of + using the authreq in the esp_ble_gap_set_security_param function set by the user. */ + ESP_BLE_SEC_ENCRYPT_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has been already + bonded, the stack will check the LTK (Long Term Key) whether the authentication request has been met, and if met, use the LTK + to encrypt with the remote device directly, else re-pair with the remote device. + Else if the device hasn't been bonded, the stack will use MITM authentication request in the current link instead of + using the authreq in the esp_ble_gap_set_security_param function set by the user. */ }esp_ble_sec_act_t; typedef enum { ESP_BLE_SM_PASSKEY = 0, - /* Authentication requirements of local device */ + /*!< Authentication requirements of local device */ ESP_BLE_SM_AUTHEN_REQ_MODE, - /* The IO capability of local device */ + /*!< The IO capability of local device */ ESP_BLE_SM_IOCAP_MODE, - /* Initiator Key Distribution/Generation */ + /*!< Initiator Key Distribution/Generation */ ESP_BLE_SM_SET_INIT_KEY, - /* Responder Key Distribution/Generation */ + /*!< Responder Key Distribution/Generation */ ESP_BLE_SM_SET_RSP_KEY, - /* Maximum Encryption key size to support */ + /*!< Maximum Encryption key size to support */ ESP_BLE_SM_MAX_KEY_SIZE, - /* Minimum Encryption key size requirement from Peer */ + /*!< Minimum Encryption key size requirement from Peer */ ESP_BLE_SM_MIN_KEY_SIZE, - /* Set static Passkey */ + /*!< Set static Passkey */ ESP_BLE_SM_SET_STATIC_PASSKEY, - /* Reset static Passkey */ + /*!< Reset static Passkey */ ESP_BLE_SM_CLEAR_STATIC_PASSKEY, - /* Accept only specified SMP Authentication requirement */ + /*!< Accept only specified SMP Authentication requirement */ ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH, - /* Enable/Disable OOB support */ + /*!< Enable/Disable OOB support */ ESP_BLE_SM_OOB_SUPPORT, - /* Appl encryption key size */ + /*!< Appl encryption key size */ ESP_BLE_APP_ENC_KEY_SIZE, + /*!< authentication max param */ ESP_BLE_SM_MAX_PARAM, } esp_ble_sm_param_t; @@ -681,90 +680,97 @@ typedef uint8_t esp_duplicate_info_t[ESP_BD_ADDR_LEN]; #endif //#if (BLE_42_FEATURE_SUPPORT == TRUE) #if (BLE_50_FEATURE_SUPPORT == TRUE) -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) // Non-Connectable and Non-Scannable Undirected advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) // Connectable advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) // Scannable advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) // Directed advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) // High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertis- ing Interval) -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) // Use legacy advertising PDUs -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) // Omit advertiser's address from all PDUs ("anonymous advertising") -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) // Include TxPower in the extended header of the advertising PDU -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) // Reserved for future use - -/* If extended advertising PDU types are being used (bit 4 = 0) then: +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) /*!< Non-Connectable and Non-Scannable Undirected advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) /*!< Connectable advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) /*!< Scannable advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) /*!< Directed advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) /*!< High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval) */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) /*!< Use legacy advertising PDUs */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) /*!< Omit advertiser's address from all PDUs ("anonymous advertising") */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) /*!< Include TxPower in the extended header of the advertising PDU */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) /*!< Reserved for future use */ + +/*!< If extended advertising PDU types are being used (bit 4 = 0) then: The advertisement shall not be both connectable and scannable. High duty cycle directed connectable advertising (<= 3.75 ms advertising interval) shall not be used (bit 3 = 0) */ -// ADV_IND +/*!< ADV_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) -// ADV_DIRECT_IND (low duty cycle) +/*!< ADV_DIRECT_IND (low duty cycle) */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_LD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED) -// ADV_DIRECT_IND (high duty cycle) +/*!< ADV_DIRECT_IND (high duty cycle) */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_HD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED) -// ADV_SCAN_IND +/*!< ADV_SCAN_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_SCAN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) -// ADV_NONCONN_IND +/*!< ADV_NONCONN_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_NONCONN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY) typedef uint16_t esp_ble_ext_adv_type_mask_t; -#define ESP_BLE_GAP_PHY_1M 1 -#define ESP_BLE_GAP_PHY_2M 2 -#define ESP_BLE_GAP_PHY_CODED 3 +#define ESP_BLE_GAP_PHY_1M 1 /*!< Secondery Advertisement PHY is LE1M */ +#define ESP_BLE_GAP_PHY_2M 2 /*!< Secondery Advertisement PHY is LE2M */ +#define ESP_BLE_GAP_PHY_CODED 3 /*!< Secondery Advertisement PHY is LE Coded */ typedef uint8_t esp_ble_gap_phy_t; -#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) -#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) +#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) /*!< No Prefer TX PHY supported by controller */ +#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) /*!< No Prefer RX PHY supported by controller */ typedef uint8_t esp_ble_gap_all_phys_t; -// Primary phy only support 1M and LE coded phy -#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M -#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED +/// Primary phy only support 1M and LE coded phy +#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M /*!< Primary Phy is LE1M */ +#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED /*!< Primary Phy is LE CODED */ typedef uint8_t esp_ble_gap_pri_phy_t; // primary phy -#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) -#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) -#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) +#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or reciever PHY */ +#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or reciever PHY */ +#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or reciever PHY */ typedef uint8_t esp_ble_gap_phy_mask_t; -#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 // The Host has no preferred coding when transmitting on the LE Coded PHY -#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 // The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY -#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 // The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY +#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 /*!< The Host has no preferred coding when transmitting on the LE Coded PHY */ +#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 /*!< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY */ +#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 /*!< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY */ typedef uint16_t esp_ble_gap_prefer_phy_options_t; -#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 -#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 +#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 /*!< Scan Advertisements on the LE1M PHY */ +#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 /*!< Scan advertisements on the LE coded PHY */ typedef uint8_t esp_ble_ext_scan_cfg_mask_t; -#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 -#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 -#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 +/// Advertising data +#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 /*!< extended advertising data compete */ +#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 /*!< extended advertising data incomplete */ +#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 /*!< extended advertising data truncated mode */ typedef uint8_t esp_ble_gap_ext_adv_data_status_t; -#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 -#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 +/// Advertising SYNC policy +#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 /*!< sync policy by advertising info */ +#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 /*!< periodic advertising sync policy */ typedef uint8_t esp_ble_gap_sync_t; -/* Advertising report */ -#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) -#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) -#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) -#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) -/* Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */ -#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) -#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) -#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) +/// Advertising report +#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) /*!< advertising report with extended advertising indication type */ +#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) /*!< advertising report with extended scan indication type */ +#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) /*!< advertising report with extended direct advertising indication type */ +#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) /*!< advertising report with extended scan response indication type */ + +/*!< Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */ +#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) /*!< advertising report with legacy advertising indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) /*!< advertising report with legacy direct indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) /*!< advertising report with legacy scan indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) /*!< advertising report with legacy non connectable indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) /*!< advertising report with legacy scan response indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) /*!< advertising report with legacy advertising with scan response indication type */ + typedef uint8_t esp_ble_gap_adv_type_t; +/// Extend advertising tx power, range: [-127, +126] dBm +#define EXT_ADV_TX_PWR_NO_PREFERENCE (127) /*!< host has no preference for tx power */ + /** * @brief ext adv parameters */ @@ -1762,8 +1768,8 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis * SMP in response to ESP_GAP_BLE_OOB_REQ_EVT * * @param[in] bd_addr: BD address of the peer device. -* @param[in] TK: TK value, the TK value shall be a 128-bit random number -* @param[in] len: length of tk, should always be 128-bit +* @param[in] TK: Temporary Key value, the TK value shall be a 128-bit random number +* @param[in] len: length of temporary key, should always be 128-bit * * @return - ESP_OK : success * - other : failed diff --git a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h index de90ff8efc6..c9278fbed29 100644 --- a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h +++ b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h @@ -256,7 +256,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); +typedef void (*esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); /** * @brief This function is called to init callbacks with HID device module. diff --git a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h index 07abdece2d0..cf4a5a8f1e3 100644 --- a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h +++ b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h @@ -287,7 +287,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); +typedef void (*esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); /** * @brief This function is called to init callbacks with HID host module. diff --git a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_spp_api.h b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_spp_api.h index 9df1e58a717..be827649745 100644 --- a/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_spp_api.h +++ b/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_spp_api.h @@ -205,7 +205,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); +typedef void (*esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); /** * @brief This function is called to init callbacks with SPP module. diff --git a/tools/sdk/esp32/include/bt/include/esp32/include/esp_bt.h b/tools/sdk/esp32/include/bt/include/esp32/include/esp_bt.h index fad01b97bf3..f74c3df7bfd 100644 --- a/tools/sdk/esp32/include/bt/include/esp32/include/esp_bt.h +++ b/tools/sdk/esp32/include/bt/include/esp32/include/esp_bt.h @@ -183,7 +183,7 @@ the adv packet will be discarded until the memory is restored. */ .pcm_polar = CONFIG_BTDM_CTRL_PCM_POLAR_EFF, \ .hli = BTDM_CTRL_HLI, \ .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ -}; +} #else #define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h"); diff --git a/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h b/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h index fdb434f9e92..8d11076f08b 100644 --- a/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h +++ b/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h @@ -121,8 +121,11 @@ esp_err_t touch_pad_isr_register(intr_handler_t fn, void *arg); * @brief Set touch sensor measurement and sleep time. * Excessive total time will slow down the touch response. * Too small measurement time will not be sampled enough, resulting in inaccurate measurements. - * + * @note The touch sensor on ESP32 will fix measuring cycles (specified by the second parameter) + * and then record the count of charge and discharge cycles during the sensing period as the raw value. + * That means the raw value will decrease as the capacity of the touch pad increasing. * @note The greater the duty cycle of the measurement time, the more system power is consumed. + * * @param sleep_cycle The touch sensor will sleep after each measurement. * sleep_cycle decide the interval between each measurement. * t_sleep = sleep_cycle / (RTC_SLOW_CLK frequency). diff --git a/tools/sdk/esp32/include/driver/include/driver/i2s.h b/tools/sdk/esp32/include/driver/include/driver/i2s.h index 389b631ba7e..d231ad396bb 100644 --- a/tools/sdk/esp32/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32/include/driver/include/driver/i2s.h @@ -113,6 +113,7 @@ typedef struct { * We assume that the current 'dma_buf_len' is 100, then the real length of the DMA buffer is 8 * 100 = 800 bytes. * Note that the length of an internal real DMA buffer shouldn't be greater than 4092. */ + bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */ bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */ int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value. If fixed_mclk set, mclk_multiple won't take effect */ diff --git a/tools/sdk/esp32/include/esp-dl/include/dl_define.hpp b/tools/sdk/esp32/include/esp-dl/include/dl_define.hpp index 734c0b80a4a..3f285f39206 100644 --- a/tools/sdk/esp32/include/esp-dl/include/dl_define.hpp +++ b/tools/sdk/esp32/include/esp-dl/include/dl_define.hpp @@ -38,11 +38,6 @@ } #endif -#define DL_Q16_MIN (-32768) -#define DL_Q16_MAX (32767) -#define DL_Q8_MIN (-128) -#define DL_Q8_MAX (127) - #ifndef DL_MAX #define DL_MAX(x, y) (((x) < (y)) ? (y) : (x)) #endif @@ -60,13 +55,24 @@ #endif #ifndef DL_RIGHT_SHIFT -#define DL_RIGHT_SHIFT(x, shift) ((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift)) +#define DL_RIGHT_SHIFT(x, shift) (((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift))) #endif #ifndef DL_LEFT_SHIFT -#define DL_LEFT_SHIFT(x, shift) ((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift)) +#define DL_LEFT_SHIFT(x, shift) (((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift))) +#endif + +#ifndef DL_SCALE +#define DL_SCALE(exponent) (((exponent) > 0) ? (1 << (exponent)) : ((float)1.0 / (1 << -(exponent)))) #endif +#ifndef DL_RESCALE +#define DL_RESCALE(exponent) (((exponent) > 0) ? ((float)1.0 / (1 << (exponent))) : (1 << -(exponent))) +#endif + +#define QIQO 0 +#define QIFO 1 + namespace dl { typedef enum @@ -75,9 +81,6 @@ namespace dl ReLU, /**/ LeakyReLU, /**/ PReLU, /**/ - // TODO: Sigmoid, /**/ - // TODO: Softmax, /**/ - PADDING_SAME_BEGIN, /**/ + PADDING_SAME_BEGIN, /**/ PADDING_SAME_END, /**/ } padding_type_t; - + typedef enum { PADDING_EMPTY, PADDING_CONSTANT, - PADDING_EDGE, + PADDING_EDGE, PADDING_REFLECT, PADDING_SYMMETRIC, } padding_mode_t; diff --git a/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_sigmoid.hpp b/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_sigmoid.hpp new file mode 100644 index 00000000000..e8d147d78cd --- /dev/null +++ b/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_sigmoid.hpp @@ -0,0 +1,147 @@ +#pragma once + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Sigmoid(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Sigmoid : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Sigmoid object + * + * @param output_exponent exponent of output + * @param name name of Sigmoid + */ + Sigmoid(const int output_exponent, const char *name = "Sigmoid") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Sigmoid object + * + */ + ~Sigmoid() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Sigmoid result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Sigmoid operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Sigmoid result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + temp = temp / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "sigmoid"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_softmax.hpp b/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_softmax.hpp new file mode 100644 index 00000000000..9e845af00c8 --- /dev/null +++ b/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_softmax.hpp @@ -0,0 +1,175 @@ +#pragma once + +#include +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Softmax(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Softmax : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int loop; /**/ + int channel; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Softmax object + * + * @param output_exponent exponent of output + * @param name name of Softmax + * @param inplace true: the output will store to input + * false: the output will store to a separate memory + */ + Softmax(const int output_exponent, const char *name = "Softmax") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Softmax object + * + */ + ~Softmax() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->channel = input.shape[2]; + this->loop = input.get_size() / this->channel; + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Softmax result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Softmax operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Softmax result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + std::unique_ptr buf(new float[this->channel]); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->loop; i++) + { + I max_input = input_ptr[0]; + for (size_t j = 1; j < this->channel; j++) + max_input = DL_MAX(max_input, input_ptr[j]); + + float summary = 0.0; + for (size_t j = 0; j < this->channel; j++) + { + buf[j] = dl::math::exp_fast(((float)input_ptr[j] - max_input) * this->scale); + // buf[j] = exp(((float)input_ptr[j] - max_input) * this->scale); + summary += buf[j]; + } + + if constexpr (type == QIQO) + { + summary = this->rescale / summary; + for (size_t j = 0; j < this->channel; j++) + dl::tool::truncate(output_ptr[j], buf[j] * summary); + } + else if constexpr (type == QIFO) + { + summary = 1.0 / summary; + for (size_t j = 0; j < this->channel; j++) + output_ptr[j] = buf[j] * summary; + } + + input_ptr += this->channel; + output_ptr += this->channel; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "softmax"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_tanh.hpp b/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_tanh.hpp new file mode 100644 index 00000000000..12eae71e55e --- /dev/null +++ b/tools/sdk/esp32/include/esp-dl/include/layer/dl_layer_tanh.hpp @@ -0,0 +1,150 @@ +#pragma once + +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief TanH(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class TanH : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new TanH object + * + * @param output_exponent exponent of output + * @param name name of TanH + */ + TanH(const int output_exponent, const char *name = "TanH") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the TanH object + * + */ + ~TanH() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent + 1); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& TanH result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call TanH operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return TanH result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + // float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + float temp = exp((float)input_ptr[i] * this->scale); + temp = (temp - 1.0f) / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "tanh"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32/include/esp-dl/include/math/dl_math.hpp b/tools/sdk/esp32/include/esp-dl/include/math/dl_math.hpp index d3f2b94d3de..dfe89c89931 100644 --- a/tools/sdk/esp32/include/esp-dl/include/math/dl_math.hpp +++ b/tools/sdk/esp32/include/esp-dl/include/math/dl_math.hpp @@ -1,6 +1,7 @@ #pragma once #include "dl_define.hpp" +#include "dl_tool.hpp" namespace dl { @@ -8,7 +9,7 @@ namespace dl { /** * @brief x^a. - * + * * @param x as a base * @param a as an exponent * @return x^a @@ -31,7 +32,7 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ @@ -43,7 +44,7 @@ namespace dl /** * @brief 1/sqrt(x). - * + * * @param x as a base * @return 1/sqrt(x) */ @@ -61,15 +62,15 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ inline float sqrt_newton(float x) { /** - * Use Newton iteration method to find the square root - * */ + * Use Newton iteration method to find the square root + * */ if (x == 0.f) return 0.f; float result = x; @@ -84,7 +85,7 @@ namespace dl /** * @brief n-th root of x. - * + * * @param x as a base * @param n root times * @return n-th root of x @@ -112,7 +113,7 @@ namespace dl /** * @brief atan(x). - * + * * @param x as an input * @return atan(x) in range [-pi/2, pi/2] */ @@ -125,10 +126,10 @@ namespace dl // TODO:@yuanjiong /** - * @brief - * + * @brief + * * @param x - * @param y + * @param y * @return in range [-pi, pi] */ inline float atan2(float x, float y) @@ -150,7 +151,7 @@ namespace dl /** * @brief acos(x). - * + * * @param x as an input * @return acos(x) in range [-pi/2, pi/2] */ @@ -161,7 +162,7 @@ namespace dl /** * @brief asin(x). - * + * * @param x as an input * @return asin(x) in range [0, pi] */ @@ -172,12 +173,12 @@ namespace dl /** * @brief e^x - * + * * @param x exponent * @param steps iteration steps * @return e^x */ - inline float exp_fast(double x, int steps) + inline float exp_fast(float x, int steps = 8) { x = 1.0 + x / (1 << steps); for (int i = 0; i < steps; i++) diff --git a/tools/sdk/esp32/include/esp-dl/include/tool/dl_tool.hpp b/tools/sdk/esp32/include/esp-dl/include/tool/dl_tool.hpp index e5490e073d1..6566e535b85 100644 --- a/tools/sdk/esp32/include/esp-dl/include/tool/dl_tool.hpp +++ b/tools/sdk/esp32/include/esp-dl/include/tool/dl_tool.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "esp_system.h" @@ -26,7 +27,7 @@ namespace dl { /** * @brief Set memory zero. - * + * * @param ptr pointer of memory * @param n byte number */ @@ -34,8 +35,8 @@ namespace dl /** * @brief Set array value. - * - * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction + * + * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction * @param ptr pointer of array * @param value value to set * @param len length of array @@ -59,7 +60,7 @@ namespace dl /** * @brief Copy memory. - * + * * @param dst pointer of destination * @param src pointer of source * @param n byte number @@ -68,7 +69,7 @@ namespace dl /** * @brief Apply memory without initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -76,7 +77,7 @@ namespace dl */ inline void *malloc_aligned(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); @@ -99,7 +100,7 @@ namespace dl /** * @brief Apply memory with zero-initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -116,7 +117,7 @@ namespace dl /** * @brief Free the calloc_aligned() and malloc_aligned() memory - * + * * @param address pointer of memory to free */ inline void free_aligned(void *address) @@ -129,7 +130,7 @@ namespace dl /** * @brief Apply memory without initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -137,14 +138,16 @@ namespace dl */ inline void *malloc_aligned_prefer(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); - if (NULL == res){ + if (NULL == res) + { res = heap_caps_malloc(total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); } #if DL_SPIRAM_SUPPORT - if (NULL == res){ + if (NULL == res) + { res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_SPIRAM); } #endif @@ -163,7 +166,7 @@ namespace dl /** * @brief Apply memory with zero-initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -179,7 +182,7 @@ namespace dl /** * @brief Free the calloc_aligned_prefer() and malloc_aligned_prefer() memory - * + * * @param address pointer of memory to free */ inline void free_aligned_prefer(void *address) @@ -192,7 +195,7 @@ namespace dl /** * @brief Truncate the input into int8_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -200,17 +203,12 @@ namespace dl template void truncate(int8_t &output, T input) { - if (input >= DL_Q8_MAX) - output = DL_Q8_MAX; - else if (input <= DL_Q8_MIN) - output = DL_Q8_MIN; - else - output = input; + output = DL_CLIP(input, INT8_MIN, INT8_MAX); } /** * @brief Truncate the input into int16_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -218,17 +216,24 @@ namespace dl template void truncate(int16_t &output, T input) { - if (input >= DL_Q16_MAX) - output = DL_Q16_MAX; - else if (input <= DL_Q16_MIN) - output = DL_Q16_MIN; - else - output = input; + output = DL_CLIP(input, INT16_MIN, INT16_MAX); + } + + template + void truncate(int32_t &output, T input) + { + output = DL_CLIP(input, INT32_MIN, INT32_MAX); + } + + template + void truncate(int64_t &output, T input) + { + output = DL_CLIP(input, INT64_MIN, INT64_MAX); } /** * @brief Calculate the exponent of quantizing 1/n into max_value range. - * + * * @param n 1/n: value to be quantized * @param max_value the max_range */ @@ -248,7 +253,7 @@ namespace dl /** * @brief Print vector in format "[x1, x2, ...]\n". - * + * * @param array to print */ inline void print_vector(std::vector &array, const char *message = NULL) @@ -266,7 +271,7 @@ namespace dl /** * @brief Get the cycle object - * + * * @return cycle count */ inline uint32_t get_cycle() @@ -293,8 +298,8 @@ namespace dl public: /** * @brief Construct a new Latency object. - * - * @param size + * + * @param size */ Latency(const uint32_t size = 1) : size(size), period(0), @@ -307,7 +312,7 @@ namespace dl /** * @brief Destroy the Latency object. - * + * */ ~Latency() { @@ -317,7 +322,7 @@ namespace dl /** * @brief Record the start timestamp. - * + * */ void start() { @@ -330,7 +335,7 @@ namespace dl /** * @brief Record the period. - * + * */ void end() { @@ -355,7 +360,7 @@ namespace dl /** * @brief Return the period. - * + * * @return this->timestamp_end - this->timestamp */ uint32_t get_period() @@ -365,8 +370,8 @@ namespace dl /** * @brief Get the average period. - * - * @return average latency + * + * @return average latency */ uint32_t get_average_period() { @@ -375,7 +380,7 @@ namespace dl /** * @brief Clear the period - * + * */ void clear_period() { @@ -396,7 +401,7 @@ namespace dl /** * @brief Print in format "{message}: {this->period} {unit}\n". - * + * * @param message message of print */ void print(const char *message) @@ -410,7 +415,7 @@ namespace dl /** * @brief Print in format "{prefix}::{key}: {this->period} {unit}\n". - * + * * @param prefix prefix of print * @param key key of print */ diff --git a/tools/sdk/esp32/include/esp-dsp/modules/common/include/dsp_types.h b/tools/sdk/esp32/include/esp-dsp/modules/common/include/dsp_types.h index 1f11ea4520b..807608477a9 100644 --- a/tools/sdk/esp32/include/esp-dsp/modules/common/include/dsp_types.h +++ b/tools/sdk/esp32/include/esp-dsp/modules/common/include/dsp_types.h @@ -2,6 +2,7 @@ #define _dsp_types_H_ #include #include +#include // union to simplify access to the 16 bit data typedef union sc16_u diff --git a/tools/sdk/esp32/include/esp-dsp/modules/common/include/esp_dsp.h b/tools/sdk/esp32/include/esp-dsp/modules/common/include/esp_dsp.h index 419ed299965..9ce979e9955 100644 --- a/tools/sdk/esp32/include/esp-dsp/modules/common/include/esp_dsp.h +++ b/tools/sdk/esp32/include/esp-dsp/modules/common/include/esp_dsp.h @@ -22,6 +22,7 @@ extern "C" // Common includes #include "dsp_common.h" +#include "dsp_types.h" // Signal processing #include "dsps_dotprod.h" diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_afe_config.h b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_afe_config.h index 01ef439c27d..3bf55f78e18 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_afe_config.h +++ b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_afe_config.h @@ -31,6 +31,7 @@ typedef struct { int total_ch_num; // total channel num. It must be: total_ch_num = mic_num + ref_num int mic_num; // mic channel num int ref_num; // reference channel num + int sample_rate; // sample rate of audio } afe_pcm_config_t; typedef struct { @@ -75,6 +76,7 @@ typedef struct { .pcm_config.total_ch_num = 2, \ .pcm_config.mic_num = 1, \ .pcm_config.ref_num = 1, \ + .pcm_config.sample_rate = 16000, \ } #elif CONFIG_IDF_TARGET_ESP32S3 #define AFE_CONFIG_DEFAULT() { \ @@ -97,5 +99,6 @@ typedef struct { .pcm_config.total_ch_num = 3, \ .pcm_config.mic_num = 2, \ .pcm_config.ref_num = 1, \ + .pcm_config.sample_rate = 16000, \ } #endif \ No newline at end of file diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_iface.h b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_iface.h index 63e5a4d4b48..6f3e5eadb34 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_iface.h +++ b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_iface.h @@ -7,6 +7,10 @@ #define ESP_MN_MAX_PHRASE_LEN 63 #define ESP_MN_MIN_PHRASE_LEN 2 +#define ESP_MN_PREFIX "mn" +#define ESP_MN_ENGLISH "en" +#define ESP_MN_CHINESE "cn" + typedef enum { ESP_MN_STATE_DETECTING = 0, // detecting ESP_MN_STATE_DETECTED = 1, // detected @@ -84,6 +88,14 @@ typedef int (*esp_mn_iface_op_set_det_threshold_t)(model_iface_data_t *model, fl */ typedef int (*esp_mn_iface_op_get_samp_rate_t)(model_iface_data_t *model); +/** + * @brief Get the language of model + * + * @param model The language name + * @return Language name string defined in esp_mn_models.h, eg: ESP_MN_CHINESE, ESP_MN_ENGLISH + */ +typedef char * (*esp_mn_iface_op_get_language_t)(model_iface_data_t *model); + /** * @brief Feed samples of an audio stream to the speech recognition model and detect if there is a speech command found. * diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_models.h b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_models.h index c65e0aabdb5..15d7ddd4ca1 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_models.h +++ b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_models.h @@ -5,11 +5,6 @@ //a specific phrase or word. - -#define ESP_MN_PREFIX "mn" -#define ESP_MN_ENGLISH "en" -#define ESP_MN_CHINESE "cn" - /** * @brief Get the multinet handle from model name * @@ -29,9 +24,8 @@ char *esp_mn_language_from_name(char *model_name); /* Configure wake word to use based on what's selected in menuconfig. */ -#if defined CONFIG_USE_MULTINET -#if CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION +#ifdef CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION #include "multinet2_ch.h" #define MULTINET_COEFF get_coeff_multinet2_ch #define MULTINET_MODEL_NAME "mn2_cn" @@ -41,10 +35,6 @@ char *esp_mn_language_from_name(char *model_name); #define MULTINET_MODEL_NAME "NULL" #endif -#else -#define MULTINET_COEFF "COEFF_NULL" -#define MULTINET_MODEL_NAME "NULL" -#endif /* example diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_ns.h b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_ns.h index 1932600b72f..c113aedca58 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_ns.h +++ b/tools/sdk/esp32/include/esp-sr/include/esp32/esp_ns.h @@ -46,13 +46,14 @@ ns_handle_t ns_create(int frame_length); * @warning frame_length only supports be 10 ms. * * @param frame_length The length of the audio processing can only be 10ms. - * @param mode 0: Mild, 1: Medium, 2: Aggressive + * @param mode 0: Mild, 1: Medium, 2: Aggressive + * @param sample_rate The sample rate of the audio. * * @return * - NULL: Create failed * - Others: The instance of NS */ -ns_handle_t ns_pro_create(int frame_length, int mode); +ns_handle_t ns_pro_create(int frame_length, int mode, int sample_rate); /** * @brief Feed samples of an audio stream to the NS and get the audio stream after Noise suppression. diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_speech_commands.h b/tools/sdk/esp32/include/esp-sr/src/include/esp_mn_speech_commands.h similarity index 99% rename from tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_speech_commands.h rename to tools/sdk/esp32/include/esp-sr/src/include/esp_mn_speech_commands.h index 2ef3c164578..c7b29274096 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_speech_commands.h +++ b/tools/sdk/esp32/include/esp-sr/src/include/esp_mn_speech_commands.h @@ -117,7 +117,7 @@ esp_mn_phrase_t *esp_mn_commands_get_from_string(const char *phoneme_string); * - NULL Success * - others The list of error phrase which can not be parsed by multinet. */ -esp_mn_error_t *esp_mn_commands_update(const esp_mn_iface_t *multinet, const model_iface_data_t *model_data); +esp_mn_error_t *esp_mn_commands_update(const esp_mn_iface_t *multinet, model_iface_data_t *model_data); /** * @brief Print the MultiNet Speech Commands. diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_process_sdkconfig.h b/tools/sdk/esp32/include/esp-sr/src/include/esp_process_sdkconfig.h similarity index 80% rename from tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_process_sdkconfig.h rename to tools/sdk/esp32/include/esp-sr/src/include/esp_process_sdkconfig.h index aca5c50eab4..9743dcad7da 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_process_sdkconfig.h +++ b/tools/sdk/esp32/include/esp-sr/src/include/esp_process_sdkconfig.h @@ -20,4 +20,4 @@ void check_chip_config(void); * - ESP_OK Success * - ESP_ERR_INVALID_STATE Fail */ -esp_err_t esp_mn_commands_update_from_sdkconfig(esp_mn_iface_t *multinet, const model_iface_data_t *model_data); +esp_mn_error_t* esp_mn_commands_update_from_sdkconfig(const esp_mn_iface_t *multinet, model_iface_data_t *model_data); diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/model_path.h b/tools/sdk/esp32/include/esp-sr/src/include/model_path.h similarity index 88% rename from tools/sdk/esp32s3/include/esp-sr/include/esp32s3/model_path.h rename to tools/sdk/esp32/include/esp-sr/src/include/model_path.h index 4900dbb7eda..0c685cdd310 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/model_path.h +++ b/tools/sdk/esp32/include/esp-sr/src/include/model_path.h @@ -76,4 +76,19 @@ void srmodel_spiffs_deinit(srmodel_list_t *models); * * @return the base path od srmodel spiffs */ -char *get_model_base_path(void); \ No newline at end of file +char *get_model_base_path(void); + + +#ifdef ESP_PLATFORM +#include "dl_lib_coefgetter_if.h" +/** + * @brief Return model_coeff_getter_t pointer base on model_name + * + * @warning Just support ESP32 to load old wakenet + * + * @param model_name The model name + * + * @return model_coeff_getter_t pointer or NULL + */ +model_coeff_getter_t* srmodel_get_model_coeff(char *model_name); +#endif \ No newline at end of file diff --git a/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h b/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h index 2025bb403a9..ee84b307baf 100755 --- a/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h +++ b/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h @@ -18,8 +18,8 @@ .pin_pwdn = PIN_PWDN, .pin_reset = PIN_RESET, .pin_xclk = PIN_XCLK, - .pin_sscb_sda = PIN_SIOD, - .pin_sscb_scl = PIN_SIOC, + .pin_sccb_sda = PIN_SIOD, + .pin_sccb_scl = PIN_SIOC, .pin_d7 = PIN_D7, .pin_d6 = PIN_D6, .pin_d5 = PIN_D5, @@ -112,8 +112,14 @@ typedef struct { int pin_pwdn; /*!< GPIO pin for camera power down line */ int pin_reset; /*!< GPIO pin for camera reset line */ int pin_xclk; /*!< GPIO pin for camera XCLK line */ - int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ - int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ + union { + int pin_sccb_sda; /*!< GPIO pin for camera SDA line */ + int pin_sscb_sda __attribute__((deprecated("please use pin_sccb_sda instead"))); /*!< GPIO pin for camera SDA line (legacy name) */ + }; + union { + int pin_sccb_scl; /*!< GPIO pin for camera SCL line */ + int pin_sscb_scl __attribute__((deprecated("please use pin_sccb_scl instead"))); /*!< GPIO pin for camera SCL line (legacy name) */ + }; int pin_d7; /*!< GPIO pin for camera D7 line */ int pin_d6; /*!< GPIO pin for camera D6 line */ int pin_d5; /*!< GPIO pin for camera D5 line */ @@ -141,6 +147,8 @@ typedef struct { #if CONFIG_CAMERA_CONVERTER_ENABLED camera_conv_mode_t conv_mode; /*!< RGB<->YUV Conversion mode */ #endif + + int sccb_i2c_port; /*!< If pin_sccb_sda is -1, use the already configured I2C bus by number */ } camera_config_t; /** diff --git a/tools/sdk/esp32/include/esp32-camera/driver/include/sensor.h b/tools/sdk/esp32/include/esp32-camera/driver/include/sensor.h index d5ec7463fd3..6ab12a21aa5 100755 --- a/tools/sdk/esp32/include/esp32-camera/driver/include/sensor.h +++ b/tools/sdk/esp32/include/esp32-camera/driver/include/sensor.h @@ -30,6 +30,7 @@ typedef enum { BF20A6_PID = 0x20a6, SC101IOT_PID = 0xda4a, SC030IOT_PID = 0x9a46, + SC031GS_PID = 0x0031, } camera_pid_t; typedef enum { @@ -46,6 +47,7 @@ typedef enum { CAMERA_BF20A6, CAMERA_SC101IOT, CAMERA_SC030IOT, + CAMERA_SC031GS, CAMERA_MODEL_MAX, CAMERA_NONE, } camera_model_t; @@ -64,6 +66,7 @@ typedef enum { BF20A6_SCCB_ADDR = 0x6E, SC101IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 + SC031GS_SCCB_ADDR = 0x30, } camera_sccb_addr_t; typedef enum { @@ -209,7 +212,7 @@ typedef struct _sensor { // Sensor function pointers int (*init_status) (sensor_t *sensor); - int (*reset) (sensor_t *sensor); + int (*reset) (sensor_t *sensor); // Reset the configuration of the sensor, and return ESP_OK if reset is successful int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); int (*set_framesize) (sensor_t *sensor, framesize_t framesize); int (*set_contrast) (sensor_t *sensor, int level); diff --git a/tools/sdk/esp32/include/esp_common/include/esp_idf_version.h b/tools/sdk/esp32/include/esp_common/include/esp_idf_version.h index ef308895c9d..74dda44cbdc 100644 --- a/tools/sdk/esp32/include/esp_common/include/esp_idf_version.h +++ b/tools/sdk/esp32/include/esp_common/include/esp_idf_version.h @@ -23,7 +23,7 @@ extern "C" { /** Minor version number (x.X.x) */ #define ESP_IDF_VERSION_MINOR 4 /** Patch version number (x.x.X) */ -#define ESP_IDF_VERSION_PATCH 2 +#define ESP_IDF_VERSION_PATCH 3 /** * Macro to convert IDF version number into an integer diff --git a/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h index 1c8b78583ff..1f790b5ff86 100644 --- a/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h @@ -40,6 +40,8 @@ initializer that should be kept in sync .global_user_ctx_free_fn = NULL, \ .global_transport_ctx = NULL, \ .global_transport_ctx_free_fn = NULL, \ + .enable_so_linger = false, \ + .linger_timeout = 0, \ .open_fn = NULL, \ .close_fn = NULL, \ .uri_match_fn = NULL \ @@ -185,6 +187,9 @@ typedef struct httpd_config { */ httpd_free_ctx_fn_t global_transport_ctx_free_fn; + bool enable_so_linger; /*!< bool to enable/disable linger */ + int linger_timeout; /*!< linger timeout (in seconds) */ + /** * Custom session opening callback. * diff --git a/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_clk.h b/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_clk.h index 5a4666fdddf..8846f9272d9 100644 --- a/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_clk.h +++ b/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_clk.h @@ -82,6 +82,19 @@ int esp_clk_xtal_freq(void); */ uint64_t esp_clk_rtc_time(void); +/** + * @brief obtain internal critical section used esp_clk implementation. + * + * This is used by the esp_light_sleep_start() to avoid deadlocking when it + * calls esp_clk related API after stalling the other CPU. + */ +void esp_clk_private_lock(void); + +/** + * @brief counterpart of esp_clk_private_lock + */ +void esp_clk_private_unlock(void); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_sleep_internal.h b/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_sleep_internal.h new file mode 100644 index 00000000000..ee0b72953f0 --- /dev/null +++ b/tools/sdk/esp32/include/esp_hw_support/include/esp_private/esp_sleep_internal.h @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief Enables the use of ADC and temperature sensor in monitor (ULP) mode + * + * @note This state is kept in RTC memory and will keep its value after a deep sleep wakeup + * + */ +void esp_sleep_enable_adc_tsens_monitor(bool enable); + + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32/include/esp_hw_support/include/esp_sleep.h b/tools/sdk/esp32/include/esp_hw_support/include/esp_sleep.h index 75d2f9726c3..8090fe85211 100644 --- a/tools/sdk/esp32/include/esp_hw_support/include/esp_sleep.h +++ b/tools/sdk/esp32/include/esp_hw_support/include/esp_sleep.h @@ -69,7 +69,7 @@ typedef enum { ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program - ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only) + ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3) ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only) ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only) ESP_SLEEP_WAKEUP_COCPU, //!< Wakeup caused by COCPU int diff --git a/tools/sdk/esp32/include/esp_ipc/include/esp_ipc_isr.h b/tools/sdk/esp32/include/esp_ipc/include/esp_ipc_isr.h index 22fa5b10b03..70290ba5618 100644 --- a/tools/sdk/esp32/include/esp_ipc/include/esp_ipc_isr.h +++ b/tools/sdk/esp32/include/esp_ipc/include/esp_ipc_isr.h @@ -62,6 +62,7 @@ void esp_ipc_isr_asm_call_blocking(esp_ipc_isr_func_t func, void* arg); * - If the stall feature is paused using esp_ipc_isr_stall_pause(), this function will have no effect * * @note This function is not available in single-core mode. + * @note It is the caller's responsibility to avoid deadlocking on spinlocks */ void esp_ipc_isr_stall_other_cpu(void); diff --git a/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_io.h b/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_io.h index 57f27ac96aa..2f2c613f1a8 100644 --- a/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_io.h +++ b/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_io.h @@ -47,7 +47,7 @@ esp_err_t esp_lcd_panel_io_rx_param(esp_lcd_panel_io_handle_t io, int lcd_cmd, v * this function will wait until they are finished and the queue is empty before sending the command(s). * * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()` - * @param[in] lcd_cmd The specific LCD command + * @param[in] lcd_cmd The specific LCD command (set to -1 if no command needed - only in SPI and I2C) * @param[in] param Buffer that holds the command specific parameters, set to NULL if no parameter is needed for the command * @param[in] param_size Size of `param` in memory, in bytes, set to zero if no parameter is needed for the command * @return diff --git a/tools/sdk/esp32/include/esp_littlefs/include/esp_littlefs.h b/tools/sdk/esp32/include/esp_littlefs/include/esp_littlefs.h index 07f35231291..6337f7b17b5 100644 --- a/tools/sdk/esp32/include/esp_littlefs/include/esp_littlefs.h +++ b/tools/sdk/esp32/include/esp_littlefs/include/esp_littlefs.h @@ -2,22 +2,16 @@ #define ESP_LITTLEFS_H__ #include "esp_err.h" -#include "littlefs/lfs.h" -#include "sdkconfig.h" +#include #ifdef __cplusplus extern "C" { #endif -/** - * @brief Last Modified Time - * - * Use 't' for LITTLEFS_ATTR_MTIME to match example: - * https://github.com/ARMmbed/littlefs/issues/23#issuecomment-482293539 - * And to match other external tools such as: - * https://github.com/earlephilhower/mklittlefs - */ -#define LITTLEFS_ATTR_MTIME ((uint8_t) 't') +#define ESP_LITTLEFS_VERSION_NUMBER "1.5.0" +#define ESP_LITTLEFS_VERSION_MAJOR 1 +#define ESP_LITTLEFS_VERSION_MINOR 5 +#define ESP_LITTLEFS_VERSION_PATCH 0 /** *Configuration structure for esp_vfs_littlefs_register. @@ -88,14 +82,6 @@ esp_err_t esp_littlefs_format(const char* partition_label); */ esp_err_t esp_littlefs_info(const char* partition_label, size_t *total_bytes, size_t *used_bytes); -#if CONFIG_LITTLEFS_HUMAN_READABLE -/** - * @brief converts an enumerated lfs error into a string. - * @param lfs_errno The enumerated littlefs error. - */ -const char * esp_littlefs_errno(enum lfs_error lfs_errno); -#endif - #ifdef __cplusplus } // extern "C" #endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/lfs_config.h b/tools/sdk/esp32/include/esp_littlefs/src/lfs_config.h deleted file mode 100644 index 809d2ccc517..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/lfs_config.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_CFG_H -#define LFS_CFG_H - -// System includes -#include -#include -#include -#include -#include "esp_heap_caps.h" - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return heap_caps_malloc(size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h b/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h deleted file mode 100644 index 1a9456c5196..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Block device emulated in a file - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_FILEBD_H -#define LFS_FILEBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_FILEBD_YES_TRACE -#define LFS_FILEBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_FILEBD_TRACE(...) -#endif - -// filebd config (optional) -struct lfs_filebd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; -}; - -// filebd state -typedef struct lfs_filebd { - int fd; - const struct lfs_filebd_config *cfg; -} lfs_filebd_t; - - -// Create a file block device using the geometry in lfs_config -int lfs_filebd_create(const struct lfs_config *cfg, const char *path); -int lfs_filebd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_filebd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_filebd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_filebd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h b/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h deleted file mode 100644 index 3a70bc6e134..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Block device emulated in RAM - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_RAMBD_H -#define LFS_RAMBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_RAMBD_YES_TRACE -#define LFS_RAMBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_RAMBD_TRACE(...) -#endif - -// rambd config (optional) -struct lfs_rambd_config { - // 8-bit erase value to simulate erasing with. -1 indicates no erase - // occurs, which is still a valid block device - int32_t erase_value; - - // Optional statically allocated buffer for the block device. - void *buffer; -}; - -// rambd state -typedef struct lfs_rambd { - uint8_t *buffer; - const struct lfs_rambd_config *cfg; -} lfs_rambd_t; - - -// Create a RAM block device using the geometry in lfs_config -int lfs_rambd_create(const struct lfs_config *cfg); -int lfs_rambd_createcfg(const struct lfs_config *cfg, - const struct lfs_rambd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_rambd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_rambd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h b/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h deleted file mode 100644 index 61679e5e026..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Testing block device, wraps filebd and rambd while providing a bunch - * of hooks for testing littlefs in various conditions. - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_TESTBD_H -#define LFS_TESTBD_H - -#include "lfs.h" -#include "lfs_util.h" -#include "bd/lfs_rambd.h" -#include "bd/lfs_filebd.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_TESTBD_YES_TRACE -#define LFS_TESTBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_TESTBD_TRACE(...) -#endif - -// Mode determining how "bad blocks" behave during testing. This simulates -// some real-world circumstances such as progs not sticking (prog-noop), -// a readonly disk (erase-noop), and ECC failures (read-error). -// -// Not that read-noop is not allowed. Read _must_ return a consistent (but -// may be arbitrary) value on every read. -enum lfs_testbd_badblock_behavior { - LFS_TESTBD_BADBLOCK_PROGERROR, - LFS_TESTBD_BADBLOCK_ERASEERROR, - LFS_TESTBD_BADBLOCK_READERROR, - LFS_TESTBD_BADBLOCK_PROGNOOP, - LFS_TESTBD_BADBLOCK_ERASENOOP, -}; - -// Type for measuring wear -typedef uint32_t lfs_testbd_wear_t; -typedef int32_t lfs_testbd_swear_t; - -// testbd config, this is required for testing -struct lfs_testbd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; - - // Number of erase cycles before a block becomes "bad". The exact behavior - // of bad blocks is controlled by the badblock_mode. - uint32_t erase_cycles; - - // The mode determining how bad blocks fail - uint8_t badblock_behavior; - - // Number of write operations (erase/prog) before forcefully killing - // the program with exit. Simulates power-loss. 0 disables. - uint32_t power_cycles; - - // Optional buffer for RAM block device. - void *buffer; - - // Optional buffer for wear - void *wear_buffer; -}; - -// testbd state -typedef struct lfs_testbd { - union { - struct { - lfs_filebd_t bd; - struct lfs_filebd_config cfg; - } file; - struct { - lfs_rambd_t bd; - struct lfs_rambd_config cfg; - } ram; - } u; - - bool persist; - uint32_t power_cycles; - lfs_testbd_wear_t *wear; - - const struct lfs_testbd_config *cfg; -} lfs_testbd_t; - - -/// Block device API /// - -// Create a test block device using the geometry in lfs_config -// -// Note that filebd is used if a path is provided, if path is NULL -// testbd will use rambd which can be much faster. -int lfs_testbd_create(const struct lfs_config *cfg, const char *path); -int lfs_testbd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_testbd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_testbd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_testbd_sync(const struct lfs_config *cfg); - - -/// Additional extended API for driving test features /// - -// Get simulated wear on a given block -lfs_testbd_swear_t lfs_testbd_getwear(const struct lfs_config *cfg, - lfs_block_t block); - -// Manually set simulated wear on a given block -int lfs_testbd_setwear(const struct lfs_config *cfg, - lfs_block_t block, lfs_testbd_wear_t wear); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/lfs.h b/tools/sdk/esp32/include/esp_littlefs/src/littlefs/lfs.h deleted file mode 100644 index 3fc1e982f1a..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/lfs.h +++ /dev/null @@ -1,701 +0,0 @@ -/* - * The little filesystem - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_H -#define LFS_H - -#include -#include -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/// Version info /// - -// Software library version -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_VERSION 0x00020005 -#define LFS_VERSION_MAJOR (0xffff & (LFS_VERSION >> 16)) -#define LFS_VERSION_MINOR (0xffff & (LFS_VERSION >> 0)) - -// Version of On-disk data structures -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_DISK_VERSION 0x00020000 -#define LFS_DISK_VERSION_MAJOR (0xffff & (LFS_DISK_VERSION >> 16)) -#define LFS_DISK_VERSION_MINOR (0xffff & (LFS_DISK_VERSION >> 0)) - - -/// Definitions /// - -// Type definitions -typedef uint32_t lfs_size_t; -typedef uint32_t lfs_off_t; - -typedef int32_t lfs_ssize_t; -typedef int32_t lfs_soff_t; - -typedef uint32_t lfs_block_t; - -// Maximum name size in bytes, may be redefined to reduce the size of the -// info struct. Limited to <= 1022. Stored in superblock and must be -// respected by other littlefs drivers. -#ifndef LFS_NAME_MAX -#define LFS_NAME_MAX 255 -#endif - -// Maximum size of a file in bytes, may be redefined to limit to support other -// drivers. Limited on disk to <= 4294967296. However, above 2147483647 the -// functions lfs_file_seek, lfs_file_size, and lfs_file_tell will return -// incorrect values due to using signed integers. Stored in superblock and -// must be respected by other littlefs drivers. -#ifndef LFS_FILE_MAX -#define LFS_FILE_MAX 2147483647 -#endif - -// Maximum size of custom attributes in bytes, may be redefined, but there is -// no real benefit to using a smaller LFS_ATTR_MAX. Limited to <= 1022. -#ifndef LFS_ATTR_MAX -#define LFS_ATTR_MAX 1022 -#endif - -// Possible error codes, these are negative to allow -// valid positive return values -enum lfs_error { - LFS_ERR_OK = 0, // No error - LFS_ERR_IO = -5, // Error during device operation - LFS_ERR_CORRUPT = -84, // Corrupted - LFS_ERR_NOENT = -2, // No directory entry - LFS_ERR_EXIST = -17, // Entry already exists - LFS_ERR_NOTDIR = -20, // Entry is not a dir - LFS_ERR_ISDIR = -21, // Entry is a dir - LFS_ERR_NOTEMPTY = -39, // Dir is not empty - LFS_ERR_BADF = -9, // Bad file number - LFS_ERR_FBIG = -27, // File too large - LFS_ERR_INVAL = -22, // Invalid parameter - LFS_ERR_NOSPC = -28, // No space left on device - LFS_ERR_NOMEM = -12, // No more memory available - LFS_ERR_NOATTR = -61, // No data/attr available - LFS_ERR_NAMETOOLONG = -36, // File name too long -}; - -// File types -enum lfs_type { - // file types - LFS_TYPE_REG = 0x001, - LFS_TYPE_DIR = 0x002, - - // internally used types - LFS_TYPE_SPLICE = 0x400, - LFS_TYPE_NAME = 0x000, - LFS_TYPE_STRUCT = 0x200, - LFS_TYPE_USERATTR = 0x300, - LFS_TYPE_FROM = 0x100, - LFS_TYPE_TAIL = 0x600, - LFS_TYPE_GLOBALS = 0x700, - LFS_TYPE_CRC = 0x500, - - // internally used type specializations - LFS_TYPE_CREATE = 0x401, - LFS_TYPE_DELETE = 0x4ff, - LFS_TYPE_SUPERBLOCK = 0x0ff, - LFS_TYPE_DIRSTRUCT = 0x200, - LFS_TYPE_CTZSTRUCT = 0x202, - LFS_TYPE_INLINESTRUCT = 0x201, - LFS_TYPE_SOFTTAIL = 0x600, - LFS_TYPE_HARDTAIL = 0x601, - LFS_TYPE_MOVESTATE = 0x7ff, - - // internal chip sources - LFS_FROM_NOOP = 0x000, - LFS_FROM_MOVE = 0x101, - LFS_FROM_USERATTRS = 0x102, -}; - -// File open flags -enum lfs_open_flags { - // open flags - LFS_O_RDONLY = 1, // Open a file as read only -#ifndef LFS_READONLY - LFS_O_WRONLY = 2, // Open a file as write only - LFS_O_RDWR = 3, // Open a file as read and write - LFS_O_CREAT = 0x0100, // Create a file if it does not exist - LFS_O_EXCL = 0x0200, // Fail if a file already exists - LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size - LFS_O_APPEND = 0x0800, // Move to end of file on every write -#endif - - // internally used flags -#ifndef LFS_READONLY - LFS_F_DIRTY = 0x010000, // File does not match storage - LFS_F_WRITING = 0x020000, // File has been written since last flush -#endif - LFS_F_READING = 0x040000, // File has been read since last flush -#ifndef LFS_READONLY - LFS_F_ERRED = 0x080000, // An error occurred during write -#endif - LFS_F_INLINE = 0x100000, // Currently inlined in directory entry -}; - -// File seek flags -enum lfs_whence_flags { - LFS_SEEK_SET = 0, // Seek relative to an absolute position - LFS_SEEK_CUR = 1, // Seek relative to the current file position - LFS_SEEK_END = 2, // Seek relative to the end of the file -}; - - -// Configuration provided during initialization of the littlefs -struct lfs_config { - // Opaque user provided context that can be used to pass - // information to the block device operations - void *context; - - // Read a region in a block. Negative error codes are propagated - // to the user. - int (*read)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - - // Program a region in a block. The block must have previously - // been erased. Negative error codes are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*prog)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - - // Erase a block. A block must be erased before being programmed. - // The state of an erased block is undefined. Negative error codes - // are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*erase)(const struct lfs_config *c, lfs_block_t block); - - // Sync the state of the underlying block device. Negative error codes - // are propagated to the user. - int (*sync)(const struct lfs_config *c); - -#ifdef LFS_THREADSAFE - // Lock the underlying block device. Negative error codes - // are propagated to the user. - int (*lock)(const struct lfs_config *c); - - // Unlock the underlying block device. Negative error codes - // are propagated to the user. - int (*unlock)(const struct lfs_config *c); -#endif - - // Minimum size of a block read in bytes. All read operations will be a - // multiple of this value. - lfs_size_t read_size; - - // Minimum size of a block program in bytes. All program operations will be - // a multiple of this value. - lfs_size_t prog_size; - - // Size of an erasable block in bytes. This does not impact ram consumption - // and may be larger than the physical erase size. However, non-inlined - // files take up at minimum one block. Must be a multiple of the read and - // program sizes. - lfs_size_t block_size; - - // Number of erasable blocks on the device. - lfs_size_t block_count; - - // Number of erase cycles before littlefs evicts metadata logs and moves - // the metadata to another block. Suggested values are in the - // range 100-1000, with large values having better performance at the cost - // of less consistent wear distribution. - // - // Set to -1 to disable block-level wear-leveling. - int32_t block_cycles; - - // Size of block caches in bytes. Each cache buffers a portion of a block in - // RAM. The littlefs needs a read cache, a program cache, and one additional - // cache per file. Larger caches can improve performance by storing more - // data and reducing the number of disk accesses. Must be a multiple of the - // read and program sizes, and a factor of the block size. - lfs_size_t cache_size; - - // Size of the lookahead buffer in bytes. A larger lookahead buffer - // increases the number of blocks found during an allocation pass. The - // lookahead buffer is stored as a compact bitmap, so each byte of RAM - // can track 8 blocks. Must be a multiple of 8. - lfs_size_t lookahead_size; - - // Optional statically allocated read buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *read_buffer; - - // Optional statically allocated program buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *prog_buffer; - - // Optional statically allocated lookahead buffer. Must be lookahead_size - // and aligned to a 32-bit boundary. By default lfs_malloc is used to - // allocate this buffer. - void *lookahead_buffer; - - // Optional upper limit on length of file names in bytes. No downside for - // larger names except the size of the info struct which is controlled by - // the LFS_NAME_MAX define. Defaults to LFS_NAME_MAX when zero. Stored in - // superblock and must be respected by other littlefs drivers. - lfs_size_t name_max; - - // Optional upper limit on files in bytes. No downside for larger files - // but must be <= LFS_FILE_MAX. Defaults to LFS_FILE_MAX when zero. Stored - // in superblock and must be respected by other littlefs drivers. - lfs_size_t file_max; - - // Optional upper limit on custom attributes in bytes. No downside for - // larger attributes size but must be <= LFS_ATTR_MAX. Defaults to - // LFS_ATTR_MAX when zero. - lfs_size_t attr_max; - - // Optional upper limit on total space given to metadata pairs in bytes. On - // devices with large blocks (e.g. 128kB) setting this to a low size (2-8kB) - // can help bound the metadata compaction time. Must be <= block_size. - // Defaults to block_size when zero. - lfs_size_t metadata_max; -}; - -// File info structure -struct lfs_info { - // Type of the file, either LFS_TYPE_REG or LFS_TYPE_DIR - uint8_t type; - - // Size of the file, only valid for REG files. Limited to 32-bits. - lfs_size_t size; - - // Name of the file stored as a null-terminated string. Limited to - // LFS_NAME_MAX+1, which can be changed by redefining LFS_NAME_MAX to - // reduce RAM. LFS_NAME_MAX is stored in superblock and must be - // respected by other littlefs drivers. - char name[LFS_NAME_MAX+1]; -}; - -// Custom attribute structure, used to describe custom attributes -// committed atomically during file writes. -struct lfs_attr { - // 8-bit type of attribute, provided by user and used to - // identify the attribute - uint8_t type; - - // Pointer to buffer containing the attribute - void *buffer; - - // Size of attribute in bytes, limited to LFS_ATTR_MAX - lfs_size_t size; -}; - -// Optional configuration provided during lfs_file_opencfg -struct lfs_file_config { - // Optional statically allocated file buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *buffer; - - // Optional list of custom attributes related to the file. If the file - // is opened with read access, these attributes will be read from disk - // during the open call. If the file is opened with write access, the - // attributes will be written to disk every file sync or close. This - // write occurs atomically with update to the file's contents. - // - // Custom attributes are uniquely identified by an 8-bit type and limited - // to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller - // than the buffer, it will be padded with zeros. If the stored attribute - // is larger, then it will be silently truncated. If the attribute is not - // found, it will be created implicitly. - struct lfs_attr *attrs; - - // Number of custom attributes in the list - lfs_size_t attr_count; -}; - - -/// internal littlefs data structures /// -typedef struct lfs_cache { - lfs_block_t block; - lfs_off_t off; - lfs_size_t size; - uint8_t *buffer; -} lfs_cache_t; - -typedef struct lfs_mdir { - lfs_block_t pair[2]; - uint32_t rev; - lfs_off_t off; - uint32_t etag; - uint16_t count; - bool erased; - bool split; - lfs_block_t tail[2]; -} lfs_mdir_t; - -// littlefs directory type -typedef struct lfs_dir { - struct lfs_dir *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - lfs_off_t pos; - lfs_block_t head[2]; -} lfs_dir_t; - -// littlefs file type -typedef struct lfs_file { - struct lfs_file *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - struct lfs_ctz { - lfs_block_t head; - lfs_size_t size; - } ctz; - - uint32_t flags; - lfs_off_t pos; - lfs_block_t block; - lfs_off_t off; - lfs_cache_t cache; - - const struct lfs_file_config *cfg; -} lfs_file_t; - -typedef struct lfs_superblock { - uint32_t version; - lfs_size_t block_size; - lfs_size_t block_count; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; -} lfs_superblock_t; - -typedef struct lfs_gstate { - uint32_t tag; - lfs_block_t pair[2]; -} lfs_gstate_t; - -// The littlefs filesystem type -typedef struct lfs { - lfs_cache_t rcache; - lfs_cache_t pcache; - - lfs_block_t root[2]; - struct lfs_mlist { - struct lfs_mlist *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - } *mlist; - uint32_t seed; - - lfs_gstate_t gstate; - lfs_gstate_t gdisk; - lfs_gstate_t gdelta; - - struct lfs_free { - lfs_block_t off; - lfs_block_t size; - lfs_block_t i; - lfs_block_t ack; - uint32_t *buffer; - } free; - - const struct lfs_config *cfg; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; - -#ifdef LFS_MIGRATE - struct lfs1 *lfs1; -#endif -} lfs_t; - - -/// Filesystem functions /// - -#ifndef LFS_READONLY -// Format a block device with the littlefs -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_format(lfs_t *lfs, const struct lfs_config *config); -#endif - -// Mounts a littlefs -// -// Requires a littlefs object and config struct. Multiple filesystems -// may be mounted simultaneously with multiple littlefs objects. Both -// lfs and config must be allocated while mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_mount(lfs_t *lfs, const struct lfs_config *config); - -// Unmounts a littlefs -// -// Does nothing besides releasing any allocated resources. -// Returns a negative error code on failure. -int lfs_unmount(lfs_t *lfs); - -/// General operations /// - -#ifndef LFS_READONLY -// Removes a file or directory -// -// If removing a directory, the directory must be empty. -// Returns a negative error code on failure. -int lfs_remove(lfs_t *lfs, const char *path); -#endif - -#ifndef LFS_READONLY -// Rename or move a file or directory -// -// If the destination exists, it must match the source in type. -// If the destination is a directory, the directory must be empty. -// -// Returns a negative error code on failure. -int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath); -#endif - -// Find info about a file or directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a negative error code on failure. -int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info); - -// Get a custom attribute -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller than -// the buffer, it will be padded with zeros. If the stored attribute is larger, -// then it will be silently truncated. If no attribute is found, the error -// LFS_ERR_NOATTR is returned and the buffer is filled with zeros. -// -// Returns the size of the attribute, or a negative error code on failure. -// Note, the returned size is the size of the attribute on disk, irrespective -// of the size of the buffer. This can be used to dynamically allocate a buffer -// or check for existence. -lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path, - uint8_t type, void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Set custom attributes -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. If an attribute is not found, it will be -// implicitly created. -// -// Returns a negative error code on failure. -int lfs_setattr(lfs_t *lfs, const char *path, - uint8_t type, const void *buffer, lfs_size_t size); -#endif - -#ifndef LFS_READONLY -// Removes a custom attribute -// -// If an attribute is not found, nothing happens. -// -// Returns a negative error code on failure. -int lfs_removeattr(lfs_t *lfs, const char *path, uint8_t type); -#endif - - -/// File operations /// - -#ifndef LFS_NO_MALLOC -// Open a file -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// Returns a negative error code on failure. -int lfs_file_open(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags); - -// if LFS_NO_MALLOC is defined, lfs_file_open() will fail with LFS_ERR_NOMEM -// thus use lfs_file_opencfg() with config.buffer set. -#endif - -// Open a file with extra configuration -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// The config struct provides additional config options per file as described -// above. The config struct must be allocated while the file is open, and the -// config struct must be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags, - const struct lfs_file_config *config); - -// Close a file -// -// Any pending writes are written out to storage as though -// sync had been called and releases any allocated resources. -// -// Returns a negative error code on failure. -int lfs_file_close(lfs_t *lfs, lfs_file_t *file); - -// Synchronize a file on storage -// -// Any pending writes are written out to storage. -// Returns a negative error code on failure. -int lfs_file_sync(lfs_t *lfs, lfs_file_t *file); - -// Read data from file -// -// Takes a buffer and size indicating where to store the read data. -// Returns the number of bytes read, or a negative error code on failure. -lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file, - void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Write data to file -// -// Takes a buffer and size indicating the data to write. The file will not -// actually be updated on the storage until either sync or close is called. -// -// Returns the number of bytes written, or a negative error code on failure. -lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file, - const void *buffer, lfs_size_t size); -#endif - -// Change the position of the file -// -// The change in position is determined by the offset and whence flag. -// Returns the new position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file, - lfs_soff_t off, int whence); - -#ifndef LFS_READONLY -// Truncates the size of the file to the specified size -// -// Returns a negative error code on failure. -int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size); -#endif - -// Return the position of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR) -// Returns the position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file); - -// Change the position of the file to the beginning of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_SET) -// Returns a negative error code on failure. -int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file); - -// Return the size of the file -// -// Similar to lfs_file_seek(lfs, file, 0, LFS_SEEK_END) -// Returns the size of the file, or a negative error code on failure. -lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file); - - -/// Directory operations /// - -#ifndef LFS_READONLY -// Create a directory -// -// Returns a negative error code on failure. -int lfs_mkdir(lfs_t *lfs, const char *path); -#endif - -// Open a directory -// -// Once open a directory can be used with read to iterate over files. -// Returns a negative error code on failure. -int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path); - -// Close a directory -// -// Releases any allocated resources. -// Returns a negative error code on failure. -int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir); - -// Read an entry in the directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a positive value on success, 0 at the end of directory, -// or a negative error code on failure. -int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info); - -// Change the position of the directory -// -// The new off must be a value previous returned from tell and specifies -// an absolute offset in the directory seek. -// -// Returns a negative error code on failure. -int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off); - -// Return the position of the directory -// -// The returned offset is only meant to be consumed by seek and may not make -// sense, but does indicate the current position in the directory iteration. -// -// Returns the position of the directory, or a negative error code on failure. -lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir); - -// Change the position of the directory to the beginning of the directory -// -// Returns a negative error code on failure. -int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir); - - -/// Filesystem-level filesystem operations - -// Finds the current size of the filesystem -// -// Note: Result is best effort. If files share COW structures, the returned -// size may be larger than the filesystem actually is. -// -// Returns the number of allocated blocks, or a negative error code on failure. -lfs_ssize_t lfs_fs_size(lfs_t *lfs); - -// Traverse through all blocks in use by the filesystem -// -// The provided callback will be called with each block address that is -// currently in use by the filesystem. This can be used to determine which -// blocks are in use or how much of the storage is available. -// -// Returns a negative error code on failure. -int lfs_fs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data); - -#ifndef LFS_READONLY -#ifdef LFS_MIGRATE -// Attempts to migrate a previous version of littlefs -// -// Behaves similarly to the lfs_format function. Attempts to mount -// the previous version of littlefs and update the filesystem so it can be -// mounted with the current version of littlefs. -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg); -#endif -#endif - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/lfs_util.h b/tools/sdk/esp32/include/esp_littlefs/src/littlefs/lfs_util.h deleted file mode 100644 index 0cbc2a31995..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/littlefs/lfs_util.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_UTIL_H -#define LFS_UTIL_H - -// Users can override lfs_util.h with their own configuration by defining -// LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h). -// -// If LFS_CONFIG is used, none of the default utils will be emitted and must be -// provided by the config file. To start, I would suggest copying lfs_util.h -// and modifying as needed. -#ifdef LFS_CONFIG -#define LFS_STRINGIZE(x) LFS_STRINGIZE2(x) -#define LFS_STRINGIZE2(x) #x -#include LFS_STRINGIZE(LFS_CONFIG) -#else - -// System includes -#include -#include -#include -#include - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return malloc(size); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif -#endif diff --git a/tools/sdk/esp32/include/esp_littlefs/src/littlefs_api.h b/tools/sdk/esp32/include/esp_littlefs/src/littlefs_api.h deleted file mode 100644 index 135b05972d0..00000000000 --- a/tools/sdk/esp32/include/esp_littlefs/src/littlefs_api.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ESP_LITTLEFS_API_H__ -#define ESP_LITTLEFS_API_H__ - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp_vfs.h" -#include "esp_partition.h" -#include "littlefs/lfs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief a file descriptor - * That's also a singly linked list used for keeping tracks of all opened file descriptor - * - * Shortcomings/potential issues of 32-bit hash (when CONFIG_LITTLEFS_USE_ONLY_HASH) listed here: - * * unlink - If a different file is open that generates a hash collision, it will report an - * error that it cannot unlink an open file. - * * rename - If a different file is open that generates a hash collision with - * src or dst, it will report an error that it cannot rename an open file. - * Potential consequences: - * 1. A file cannot be deleted while a collision-geneating file is open. - * Worst-case, if the other file is always open during the lifecycle - * of your app, it's collision file cannot be deleted, which in the - * worst-case could cause storage-capacity issues. - * 2. Same as (1), but for renames - */ -typedef struct _vfs_littlefs_file_t { - lfs_file_t file; - uint32_t hash; - struct _vfs_littlefs_file_t * next; /*!< Pointer to next file in Singly Linked List */ -#ifndef CONFIG_LITTLEFS_USE_ONLY_HASH - char * path; -#endif -} vfs_littlefs_file_t; - -/** - * @brief littlefs definition structure - */ -typedef struct { - lfs_t *fs; /*!< Handle to the underlying littlefs */ - SemaphoreHandle_t lock; /*!< FS lock */ - const esp_partition_t* partition; /*!< The partition on which littlefs is located */ - char base_path[ESP_VFS_PATH_MAX+1]; /*!< Mount point */ - - struct lfs_config cfg; /*!< littlefs Mount configuration */ - - vfs_littlefs_file_t *file; /*!< Singly Linked List of files */ - - vfs_littlefs_file_t **cache; /*!< A cache of pointers to the opened files */ - uint16_t cache_size; /*!< The cache allocated size (in pointers) */ - uint16_t fd_count; /*!< The count of opened file descriptor used to speed up computation */ -} esp_littlefs_t; - -/** - * @brief Read a region in a block. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_read(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -/** - * @brief Program a region in a block. - * - * The block must have previously been erased. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_prog(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -/** - * @brief Erase a block. - * - * A block must be erased before being programmed. - * The state of an erased block is undefined. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * @return errorcode. 0 on success. - */ -int littlefs_api_erase(const struct lfs_config *c, lfs_block_t block); - -/** - * @brief Sync the state of the underlying block device. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_sync(const struct lfs_config *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/esp32/include/esp_rainmaker/include/esp_rmaker_ota.h b/tools/sdk/esp32/include/esp_rainmaker/include/esp_rmaker_ota.h index 6dc7962177e..c5483a8afbd 100644 --- a/tools/sdk/esp32/include/esp_rainmaker/include/esp_rmaker_ota.h +++ b/tools/sdk/esp32/include/esp_rainmaker/include/esp_rmaker_ota.h @@ -21,6 +21,31 @@ extern "C" { #endif +/** @cond **/ +/** ESP RainMaker Event Base */ +ESP_EVENT_DECLARE_BASE(RMAKER_OTA_EVENT); +/** @endcond **/ + +/** ESP RainMaker Events */ +typedef enum { + /* Invalid event. Used for internal handling only */ + RMAKER_OTA_EVENT_INVALID = 0, + /** RainMaker OTA is Starting */ + RMAKER_OTA_EVENT_STARTING, + /** RainMaker OTA has Started */ + RMAKER_OTA_EVENT_IN_PROGRESS, + /** RainMaker OTA Successful */ + RMAKER_OTA_EVENT_SUCCESSFUL, + /** RainMaker OTA Failed */ + RMAKER_OTA_EVENT_FAILED, + /** RainMaker OTA Rejected */ + RMAKER_OTA_EVENT_REJECTED, + /** RainMaker OTA Delayed */ + RMAKER_OTA_EVENT_DELAYED, + /** OTA Image has been flashed and active partition changed. Reboot is requested. Applicable only if Auto reboot is disabled **/ + RMAKER_OTA_EVENT_REQ_FOR_REBOOT, +} esp_rmaker_ota_event_t; + /** Default ESP RainMaker OTA Server Certificate */ extern const char *ESP_RMAKER_OTA_DEFAULT_SERVER_CERT; @@ -56,10 +81,16 @@ typedef struct { /** Size of the OTA File. Can be 0 if the file size isn't received from * the ESP RainMaker Cloud */ int filesize; + /** The firmware version of the OTA image **/ + char *fw_version; + /** The OTA Job ID received from cloud **/ + char *ota_job_id; /** The server certificate passed in esp_rmaker_enable_ota() */ const char *server_cert; /** The private data passed in esp_rmaker_enable_ota() */ char *priv; + /** OTA Metadata. Applicable only for OTA using Topics. Will be received (if applicable) from the backend, alongwith the OTA URL */ + char *metadata; } esp_rmaker_ota_data_t; /** Function prototype for OTA Callback @@ -170,6 +201,18 @@ esp_err_t esp_rmaker_ota_default_cb(esp_rmaker_ota_handle_t handle, esp_rmaker_o * @return error on failure */ esp_err_t esp_rmaker_ota_fetch(void); + +/** Fetch OTA Info with a delay + * + * For OTA using Topics, this API can be used to explicitly ask the backend if an OTA is available + * after a delay (in seconds) passed as an argument. + * + * @param[in] time Delay (in seconds) + * + * @return ESP_OK if the OTA fetch timer was created. + * @return error on failure + */ +esp_err_t esp_rmaker_ota_fetch_with_delay(int time); #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/esp_rom/esp32/esp_rom_caps.h b/tools/sdk/esp32/include/esp_rom/esp32/esp_rom_caps.h index 6188ef52a72..1d19be85715 100644 --- a/tools/sdk/esp32/include/esp_rom/esp32/esp_rom_caps.h +++ b/tools/sdk/esp32/include/esp_rom/esp32/esp_rom_caps.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,3 +10,4 @@ #define ESP_ROM_HAS_CRC_BE (1) // ROM CRC library supports Big Endian #define ESP_ROM_HAS_JPEG_DECODE (1) // ROM has JPEG decode library #define ESP_ROM_SUPPORT_MULTIPLE_UART (1) // ROM has multiple UARTs available for logging +#define ESP_ROM_NEEDS_SWSETUP_WORKAROUND (1) // ROM uses 32-bit time_t. A workaround is required to prevent printf functions from crashing diff --git a/tools/sdk/esp32/include/esp_rom/include/esp32/rom/miniz.h b/tools/sdk/esp32/include/esp_rom/include/esp32/rom/miniz.h index 7661f804468..5fefa84999a 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp32/rom/miniz.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp32/rom/miniz.h @@ -760,7 +760,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32/include/esp_rom/include/esp32c3/rom/miniz.h b/tools/sdk/esp32/include/esp_rom/include/esp32c3/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp32c3/rom/miniz.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp32c3/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32/include/esp_rom/include/esp32h2/rom/miniz.h b/tools/sdk/esp32/include/esp_rom/include/esp32h2/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp32h2/rom/miniz.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp32h2/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32/include/esp_rom/include/esp32s2/rom/miniz.h b/tools/sdk/esp32/include/esp_rom/include/esp32s2/rom/miniz.h index b9b9202aaa7..fd2fe3c9a19 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp32s2/rom/miniz.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp32s2/rom/miniz.h @@ -745,7 +745,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32/include/esp_rom/include/esp32s3/rom/miniz.h b/tools/sdk/esp32/include/esp_rom/include/esp32s3/rom/miniz.h index 7553511349e..f095b539b9b 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp32s3/rom/miniz.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp32s3/rom/miniz.h @@ -728,7 +728,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32/include/esp_rom/include/esp_rom_efuse.h b/tools/sdk/esp32/include/esp_rom/include/esp_rom_efuse.h index 907e175ecad..6280a1e5b60 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp_rom_efuse.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp_rom_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -20,6 +12,7 @@ extern "C" { #include #include +#include "soc/soc_caps.h" #define ESP_ROM_EFUSE_FLASH_DEFAULT_SPI (0) #define ESP_ROM_EFUSE_FLASH_DEFAULT_HSPI (1) @@ -56,6 +49,18 @@ uint32_t esp_rom_efuse_get_flash_gpio_info(void); */ uint32_t esp_rom_efuse_get_flash_wp_gpio(void); +#if SOC_SPI_MEM_SUPPORT_OPI_MODE +/** + * @brief Read opi flash pads configuration from Efuse + * + * @return + * - 0 for default SPI pins. + * - Other values define a custom pin configuration mask. From the LSB, every 6 bits represent a GPIO number which stand for: + * DQS, D4, D5, D6, D7 accordingly. + */ +uint32_t esp_rom_efuse_get_opiconfig(void); +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE + /** * @brief Read eFuse to check whether secure boot has been enabled or not * diff --git a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h b/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h b/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h deleted file mode 100644 index 49ba82ddf00..00000000000 --- a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 72 diff --git a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h b/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32/include/esp_timer/include/esp_private/esp_timer_private.h b/tools/sdk/esp32/include/esp_timer/include/esp_private/esp_timer_private.h index ecd42641115..6f32f1431e1 100644 --- a/tools/sdk/esp32/include/esp_timer/include/esp_private/esp_timer_private.h +++ b/tools/sdk/esp32/include/esp_timer/include/esp_private/esp_timer_private.h @@ -52,11 +52,11 @@ void esp_timer_private_update_apb_freq(uint32_t apb_ticks_per_us); void esp_timer_private_advance(int64_t time_us); /** - * @brief obtain internal critical section used esp_timer implementation + * @brief obtain internal critical section used in the esp_timer implementation * This can be used when a sequence of calls to esp_timer has to be made, * and it is necessary that the state of the timer is consistent between * the calls. Should be treated in the same way as a spinlock. - * Call esp_timer_unlock to release the lock + * Call esp_timer_private_unlock to release the lock */ void esp_timer_private_lock(void); diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_coexist_internal.h b/tools/sdk/esp32/include/esp_wifi/include/esp_coexist_internal.h index 7ba06d4c690..1633c020276 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_coexist_internal.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_coexist_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,6 +23,7 @@ typedef enum { } coex_prefer_t; typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); +typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void); /** * @brief Pre-Init software coexist @@ -115,6 +116,18 @@ int coex_wifi_release(uint32_t event); */ int coex_wifi_channel_set(uint8_t primary, uint8_t secondary); +/** + * @brief Register application callback function to Wi-Fi update low power clock module. + * + * @param callback : Wi-Fi update low power clock callback function + */ +void coex_wifi_register_update_lpclk_callback(coex_set_lpclk_source_callback_t callback); + +/** + * @brief Update low power clock interval + */ +void coex_update_lpclk_interval(void); + /** * @brief Get coexistence event duration. * diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi.h b/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi.h index a2c763260e5..7b2a7ef4851 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -496,6 +496,15 @@ bool esp_wifi_internal_is_tsf_active(void); * */ void esp_wifi_internal_update_light_sleep_wake_ahead_time(uint32_t); + +/** + * @brief Update WiFi TSF tick interval + * + * @return + * - true: Active + * - false: Not active + */ +esp_err_t esp_wifi_update_tsf_tick_interval(void); #endif /** @@ -590,6 +599,15 @@ void esp_wifi_set_sleep_delay_time(uint32_t return_to_sleep_delay); */ void esp_wifi_set_keep_alive_time(uint32_t keep_alive_time); +/** + * @brief Configure wifi beacon montior default parameters + * + * @param enable: enable or disable beacon monitor + * @param timeout: timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond + * @param threshold: maximum number of consecutive lost beacons allowed + */ +void esp_wifi_beacon_monitor_configure(bool enable, int timeout, int threshold, int delta_intr_early, int delta_timeout); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h index 88d0ee54029..8b921b9da7f 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -77,7 +77,7 @@ typedef struct { void (* _wifi_apb80m_release)(void); void (* _phy_disable)(void); void (* _phy_enable)(void); -#if CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 void (* _phy_common_clock_enable)(void); void (* _phy_common_clock_disable)(void); #endif diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h index e06569dfc15..08be53cf6a4 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h @@ -339,7 +339,7 @@ esp_err_t esp_wifi_restore(void); * * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. - * @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. + * @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between ESP32 and the AP is established. * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error * number ESP_ERR_WIFI_STATE. * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called @@ -600,18 +600,19 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); * @attention 1. It is discouraged to call this API since this doesn't validate the per-country rules, * it's up to the user to fill in all fields according to local regulations. * Please use esp_wifi_set_country_code instead. - * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO} - * @attention 3. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which - * the station is connected is used. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11} + * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}. + * @attention 3. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which + * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected * from the AP the country info is set back to the country info of the station automatically, * {.cc="US", .schan=1, .nchan=11} in the example. - * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. - * @attention 5. When the country info is changed because of configuration or because the station connects to a different + * @attention 5. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. + * @attention 6. When the country info is changed because of configuration or because the station connects to a different * external AP, the country IE in probe response/beacon of the soft-AP is also changed. - * @attention 6. The country configuration is stored into flash. - * @attention 7. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the + * @attention 7. The country configuration is stored into flash. + * @attention 8. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the * country info. * * @param country the configured country info @@ -909,7 +910,7 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range */ esp_err_t esp_wifi_set_max_tx_power(int8_t power); @@ -922,7 +923,7 @@ esp_err_t esp_wifi_set_max_tx_power(int8_t power); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument */ esp_err_t esp_wifi_get_max_tx_power(int8_t *power); @@ -1018,7 +1019,7 @@ esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); @@ -1031,7 +1032,7 @@ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi(bool en); @@ -1244,6 +1245,7 @@ esp_err_t esp_wifi_set_connectionless_wake_interval(uint16_t interval); * * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. * @attention 8. The default country is "CN" and ieee80211d_enabled is TRUE. + * @attention 9. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * * @param country the configured country ISO code * @param ieee80211d_enabled 802.11d is enabled or not diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_wifi_types.h b/tools/sdk/esp32/include/esp_wifi/include/esp_wifi_types.h index 89020d4abbf..4dae6a8c3fa 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_wifi_types.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_wifi_types.h @@ -219,6 +219,14 @@ typedef struct { bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ } wifi_pmf_config_t; +/** Configuration for SAE PWE derivation */ +typedef enum { + WPA3_SAE_PWE_UNSPECIFIED, + WPA3_SAE_PWE_HUNT_AND_PECK, + WPA3_SAE_PWE_HASH_TO_ELEMENT, + WPA3_SAE_PWE_BOTH, +} wifi_sae_pwe_method_t; + /** @brief Soft-AP configuration settings for the ESP32 */ typedef struct { uint8_t ssid[32]; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ @@ -249,6 +257,7 @@ typedef struct { uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ uint32_t reserved:29; /**< Reserved for future feature set */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Whether SAE hash to element is enabled */ } wifi_sta_config_t; /** @brief Configuration data for ESP32 AP or STA. diff --git a/tools/sdk/esp32/include/expat/expat/expat/lib/expat.h b/tools/sdk/esp32/include/expat/expat/expat/lib/expat.h index 0f021e25def..e2020a4a29e 100644 --- a/tools/sdk/esp32/include/expat/expat/expat/lib/expat.h +++ b/tools/sdk/esp32/include/expat/expat/expat/lib/expat.h @@ -15,6 +15,7 @@ Copyright (c) 2016 Cristian Rodríguez Copyright (c) 2016 Thomas Beutlich Copyright (c) 2017 Rhodri James + Copyright (c) 2022 Thijs Schreijer Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -174,8 +175,10 @@ struct XML_cp { }; /* This is called for an element declaration. See above for - description of the model argument. It's the caller's responsibility - to free model when finished with it. + description of the model argument. It's the user code's responsibility + to free model when finished with it. See XML_FreeContentModel. + There is no need to free the model from the handler, it can be kept + around and freed at a later stage. */ typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData, const XML_Char *name, @@ -237,6 +240,17 @@ XML_ParserCreate(const XML_Char *encoding); and the local part will be concatenated without any separator. It is a programming error to use the separator '\0' with namespace triplets (see XML_SetReturnNSTriplet). + If a namespace separator is chosen that can be part of a URI or + part of an XML name, splitting an expanded name back into its + 1, 2 or 3 original parts on application level in the element handler + may end up vulnerable, so these are advised against; sane choices for + a namespace separator are e.g. '\n' (line feed) and '|' (pipe). + + Note that Expat does not validate namespace URIs (beyond encoding) + against RFC 3986 today (and is not required to do so with regard to + the XML 1.0 namespaces specification) but it may start doing that + in future releases. Before that, an application using Expat must + be ready to receive namespace URIs containing non-URI characters. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); @@ -317,7 +331,7 @@ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *pubid, int has_internal_subset); -/* This is called for the start of the DOCTYPE declaration when the +/* This is called for the end of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ @@ -1041,7 +1055,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold( */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 4 -#define XML_MICRO_VERSION 3 +#define XML_MICRO_VERSION 8 #ifdef __cplusplus } diff --git a/tools/sdk/esp32/include/expat/port/include/expat_config.h b/tools/sdk/esp32/include/expat/port/include/expat_config.h index 468910220f4..42acb52a5ca 100644 --- a/tools/sdk/esp32/include/expat/port/include/expat_config.h +++ b/tools/sdk/esp32/include/expat/port/include/expat_config.h @@ -63,7 +63,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.4.3" +#define PACKAGE_STRING "expat 2.4.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -72,13 +72,13 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.4.3" +#define PACKAGE_VERSION "2.4.8" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.4.3" +#define VERSION "2.4.8" /* whether byteorder is bigendian */ /* #undef WORDS_BIGENDIAN */ diff --git a/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/idf_additions.h b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/idf_additions.h new file mode 100644 index 00000000000..bd1d0bd2381 --- /dev/null +++ b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/idf_additions.h @@ -0,0 +1,57 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "idf_additions_inc.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Saves the current priority and current base priority of a task, then raises the tasks + * current and base priority to uxNewPriority if uxNewPriority is of a higher priority. + * Once a task's priority has been raised with this function, the priority can be restored + * by calling prvTaskPriorityRestore() + * - Note that this function differs from vTaskPrioritySet() as the task's current priority + * will be modified even if the task has already inherited a priority. + * - This function is intended for special circumstance where a task must be forced immediately + * to a higher priority. + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @note vTaskPrioritySet() should not be called while a task's priority is already raised via this function + * + * @param pxSavedPriority returns base and current priorities + * + * @param uxNewPriority The priority to which the task will be set. + */ +void prvTaskPriorityRaise( prvTaskSavedPriority_t * pxSavedPriority, UBaseType_t uxNewPriority ); + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Restore a task's priority that was previously raised by prvTaskPriorityRaise(). + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @param pxSavedPriority previously saved base and current priorities that need to be restored + */ +void prvTaskPriorityRestore( prvTaskSavedPriority_t * pxSavedPriority ); + +#endif // ( INCLUDE_vTaskPrioritySet == 1) diff --git a/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/idf_additions_inc.h b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/idf_additions_inc.h new file mode 100644 index 00000000000..25b0b6d9a4d --- /dev/null +++ b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/idf_additions_inc.h @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#ifndef FREERTOS_ADDITITIONS_INC_H_ +#define FREERTOS_ADDITITIONS_INC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +typedef struct { + UBaseType_t uxPriority; +#if ( configUSE_MUTEXES == 1 ) + UBaseType_t uxBasePriority; +#endif +} prvTaskSavedPriority_t; + +#endif // ( INCLUDE_vTaskPrioritySet == 1) + +#ifdef __cplusplus +} +#endif + +#endif //FREERTOS_ADDITITIONS_INC_H_ diff --git a/tools/sdk/esp32/include/freertos/include/esp_additions/freertos_tasks_c_additions.h b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos_tasks_c_additions.h deleted file mode 100644 index 464c0b3ffb9..00000000000 --- a/tools/sdk/esp32/include/freertos/include/esp_additions/freertos_tasks_c_additions.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -/** - * This file will be included in `tasks.c` file, thus, it must NOT be included - * by any (other) file. - * The functions below only consist in getters for the static variables in - * `tasks.c` file. - * The only source files that should call these functions are the ones in - * `/additions` directory. - */ - -#if ( configENABLE_TASK_SNAPSHOT == 1 ) - - UBaseType_t pxTCBGetSize ( void ) - { - return sizeof(TCB_t); - } - - ListItem_t* pxTCBGetStateListItem ( void *pxTCB ) - { - return &(((TCB_t*)pxTCB)->xStateListItem); - } - - StackType_t* pxTCBGetStartOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxStack; - } - - StackType_t* pxTCBGetTopOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxTopOfStack; - } - - StackType_t* pxTCBGetEndOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxEndOfStack; - } - - - List_t* pxListGetReadyTask ( UBaseType_t idx ) - { - return &( pxReadyTasksLists[idx] ); - } - - List_t* pxListGetReadyPendingTask ( UBaseType_t idx ) - { - return &( xPendingReadyList[idx] ); - } - - List_t* pxGetDelayedTaskList ( void ) { - return pxDelayedTaskList; - } - - List_t* pxGetOverflowDelayedTaskList ( void ) { - return pxOverflowDelayedTaskList; - } - - List_t* pxGetTasksWaitingTermination ( void ) { - return &xTasksWaitingTermination; - } - - List_t* pxGetSuspendedTaskList ( void ) { - return &xSuspendedTaskList; - } - -#endif diff --git a/tools/sdk/esp32/include/freertos/include/freertos/task.h b/tools/sdk/esp32/include/freertos/include/freertos/task.h index 88b2730933d..89841757d49 100644 --- a/tools/sdk/esp32/include/freertos/include/freertos/task.h +++ b/tools/sdk/esp32/include/freertos/include/freertos/task.h @@ -2655,12 +2655,13 @@ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, * not have this parameter and always waits for notifications on index 0. * * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value - * will be cleared in the calling task's notification value before the task - * checks to see if any notifications are pending, and optionally blocks if no - * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if - * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have - * the effect of resetting the task's notification value to 0. Setting - * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged. + * will be cleared in the calling task's notification value before the task is + * marked as waiting for a new notification (provided a notification is not + * already pending). Optionally blocks if no notifications are pending. Setting + * ulBitsToClearOnEntry to ULONG_MAX (if limits.h is included) or 0xffffffffUL + * (if limits.h is not included) will have the effect of resetting the task's + * notification value to 0. Setting ulBitsToClearOnEntry to 0 will leave the + * task's notification value unchanged. * * @param ulBitsToClearOnExit If a notification is pending or received before * the calling task exits the xTaskNotifyWait() function then the task's @@ -3367,6 +3368,25 @@ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION; +#ifdef ESP_PLATFORM +/* + * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN + * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. + * + * This function is a wrapper to take the "xTaskQueueMutex" spinlock of tasks.c. + * This lock is taken whenver any of the task lists or event lists are + * accessed/modified, such as when adding/removing tasks to/from the delayed + * task list or various event lists. + * + * This functions is meant to be called by xEventGroupSetBits() and + * vEventGroupDelete() as both those functions will access event lists (instead + * of delegating the entire responsibility to one of vTask...EventList() + * functions). + */ +void vTaskTakeEventListLock( void ); +void vTaskReleaseEventListLock( void ); +#endif // ESP_PLATFORM + /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/i2c_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/i2c_ll.h index 9a99341c595..df4a7d5eb74 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/i2c_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/i2c_ll.h @@ -890,6 +890,39 @@ static inline void i2c_ll_update(i2c_dev_t *hw) ;// ESP32 do not support } +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +static inline void i2c_ll_set_scl_clk_timing(i2c_dev_t *hw, int high_period, int low_period, int wait_high_period) +{ + (void)wait_high_period; + hw->scl_low_period.period = low_period; + hw->scl_high_period.period = high_period; +} + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +static inline void i2c_ll_get_scl_clk_timing(i2c_dev_t *hw, int *high_period, int *low_period, int *wait_high_period) +{ + *wait_high_period = 0; // Useless + *high_period = hw->scl_high_period.period; + *low_period = hw->scl_low_period.period; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/rtc_io_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/rtc_io_ll.h index f96452532e3..4e178cc73af 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/rtc_io_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/rtc_io_ll.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /******************************************************************************* * NOTICE @@ -229,6 +221,7 @@ static inline void rtcio_ll_pulldown_disable(int rtcio_num) static inline void rtcio_ll_force_hold_enable(int rtcio_num) { REG_SET_BIT(RTC_CNTL_HOLD_FORCE_REG, rtc_io_desc[rtcio_num].hold_force); + REG_SET_BIT(rtc_io_desc[rtcio_num].reg, rtc_io_desc[rtcio_num].hold); } /** diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/spi_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/spi_ll.h index 63efb384ebb..cf09b6e94f4 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/spi_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/spi_ll.h @@ -1081,6 +1081,29 @@ static inline void spi_dma_ll_enable_out_auto_wrback(spi_dma_dev_t *dma_out, uin //does not configure it in ESP32 } +/** + * Get the spi communication command + * + * @param cmd_t Base command value + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline uint16_t spi_ll_get_slave_hd_command(spi_command_t cmd_t, spi_line_mode_t line_mode) +{ + //This is not supported in esp32 + return 0; +} + +/** + * Get the dummy bits + * + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline int spi_ll_get_slave_hd_dummy_bits(spi_line_mode_t line_mode) +{ + //This is not supported in esp32 + return 0; +} + #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK diff --git a/tools/sdk/esp32/include/hal/include/hal/adc_hal.h b/tools/sdk/esp32/include/hal/include/hal/adc_hal.h index b8455e27ecd..787e50246e6 100644 --- a/tools/sdk/esp32/include/hal/include/hal/adc_hal.h +++ b/tools/sdk/esp32/include/hal/include/hal/adc_hal.h @@ -36,9 +36,6 @@ #define ADC_HAL_DMA_INTR_MASK BIT(9) #endif -//For ADC module, each conversion contains 4 bytes -#define ADC_HAL_DATA_LEN_PER_CONV 4 - typedef enum adc_hal_work_mode_t { ADC_HAL_ULP_MODE, ADC_HAL_SINGLE_READ_MODE, diff --git a/tools/sdk/esp32/include/hal/include/hal/adc_types.h b/tools/sdk/esp32/include/hal/include/hal/adc_types.h index dc07531e0b9..3490986c28e 100644 --- a/tools/sdk/esp32/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32/include/hal/include/hal/adc_types.h @@ -161,7 +161,8 @@ typedef struct { typedef struct { union { struct { - uint32_t data: 13; /*! ADC_CHANNEL_MAX), The data is invalid. */ diff --git a/tools/sdk/esp32/include/hal/include/hal/i2c_hal.h b/tools/sdk/esp32/include/hal/include/hal/i2c_hal.h index b255878cc43..cc56014b634 100644 --- a/tools/sdk/esp32/include/hal/include/hal/i2c_hal.h +++ b/tools/sdk/esp32/include/hal/include/hal/i2c_hal.h @@ -120,6 +120,29 @@ typedef struct { */ #define i2c_hal_set_source_clk(hal, src_clk) i2c_ll_set_source_clk((hal)->dev, src_clk) +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +#define i2c_hal_set_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_set_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +#define i2c_hal_get_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_get_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + /** * @brief Init the I2C master. * diff --git a/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h b/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h index 037970fa2b3..2be94f66d15 100644 --- a/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h +++ b/tools/sdk/esp32/include/hal/include/hal/i2s_hal.h @@ -125,6 +125,16 @@ void i2s_hal_init(i2s_hal_context_t *hal, int i2s_num); */ void i2s_hal_set_clock_src(i2s_hal_context_t *hal, i2s_clock_src_t sel); +/** + * @brief Calculate the closest sample rate clock configuration. + * clock relationship: + * Fmclk = bck_div*fbck = fsclk/(mclk_div+b/a) + * + * @param clk_cfg I2S clock configuration(input) + * @param cal Point to `i2s_ll_mclk_div_t` structure(output). + */ +void i2s_hal_mclk_div_decimal_cal(i2s_hal_clock_cfg_t *clk_cfg, i2s_ll_mclk_div_t *cal); + /** * @brief Set Tx channel style * @@ -342,8 +352,9 @@ void i2s_hal_rx_set_common_mode(i2s_hal_context_t *hal, const i2s_hal_config_t * * * @param hal Context of the HAL layer * @param sample_rate PDM sample rate + * @param is_mono whether is mono */ -void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate); +void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate, bool is_mono); #endif #if SOC_I2S_SUPPORTS_PDM_RX diff --git a/tools/sdk/esp32/include/hal/include/hal/lcd_hal.h b/tools/sdk/esp32/include/hal/include/hal/lcd_hal.h index db255b3d1e4..1312b5135e5 100644 --- a/tools/sdk/esp32/include/hal/include/hal/lcd_hal.h +++ b/tools/sdk/esp32/include/hal/include/hal/lcd_hal.h @@ -1,23 +1,52 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include +#include + #ifdef __cplusplus extern "C" { #endif +/** + * @brief LCD peripheral SOC layer handle + */ typedef struct lcd_cam_dev_t *lcd_soc_handle_t; +/** + * @brief LCD HAL layer context + */ typedef struct { - lcd_soc_handle_t dev; + lcd_soc_handle_t dev; // SOC layer handle } lcd_hal_context_t; +/** + * @brief LCD HAL layer initialization + * + * @param hal LCD HAL layer context + * @param id LCD peripheral ID + */ void lcd_hal_init(lcd_hal_context_t *hal, int id); +#define LCD_HAL_PCLK_FLAG_ALLOW_EQUAL_SYSCLK (1 << 0) + +/** + * @brief LCD PCLK clock calculation + * @note Currently this function is only used by RGB LCD driver, I80 driver still uses a fixed clock division + * + * @param hal LCD HAL layer context + * @param src_freq_hz LCD source clock frequency in Hz + * @param expect_pclk_freq_hz Expected LCD PCLK frequency in Hz + * @param lcd_clk_flags Extra flags to control LCD PCLK clock calculation, supported flags are prefixed with LCD_HAL_PCLK_FLAG_ + * @return Actual LCD PCLK frequency in Hz + */ +uint32_t lcd_hal_cal_pclk_freq(lcd_hal_context_t *hal, uint32_t src_freq_hz, uint32_t expect_pclk_freq_hz, int lcd_clk_flags); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32/include/hal/include/hal/lcd_types.h index 13810a79ac3..af11ef64a8d 100644 --- a/tools/sdk/esp32/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32/include/hal/include/hal/lcd_types.h @@ -34,6 +34,39 @@ typedef enum { LCD_CLK_SRC_XTAL, /*!< Select XTAL as the source clock */ } lcd_clock_source_t; +/** + * @brief LCD color space + */ +typedef enum { + LCD_COLOR_SPACE_RGB, /*!< Color space: RGB */ + LCD_COLOR_SPACE_YUV, /*!< Color space: YUV */ +} lcd_color_space_t; + +/** + * @brief LCD color range + */ +typedef enum { + LCD_COLOR_RANGE_LIMIT, /*!< Limited color range */ + LCD_COLOR_RANGE_FULL, /*!< Full color range */ +} lcd_color_range_t; + +/** + * @brief YUV sampling method + */ +typedef enum { + LCD_YUV_SAMPLE_422, /*!< YUV 4:2:2 sampling */ + LCD_YUV_SAMPLE_420, /*!< YUV 4:2:0 sampling */ + LCD_YUV_SAMPLE_411, /*!< YUV 4:1:1 sampling */ +} lcd_yuv_sample_t; + +/** + * @brief The standard used for conversion between RGB and YUV + */ +typedef enum { + LCD_YUV_CONV_STD_BT601, /*!< YUV<->RGB conversion standard: BT.601 */ + LCD_YUV_CONV_STD_BT709, /*!< YUV<->RGB conversion standard: BT.709 */ +} lcd_yuv_conv_std_t; + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/hal/include/hal/spi_types.h b/tools/sdk/esp32/include/hal/include/hal/spi_types.h index 169069c5c62..9c008838a19 100644 --- a/tools/sdk/esp32/include/hal/include/hal/spi_types.h +++ b/tools/sdk/esp32/include/hal/include/hal/spi_types.h @@ -55,6 +55,22 @@ typedef struct { uint8_t data_lines; ///< The line width of data phase, e.g. 4-line-data-phase. } spi_line_mode_t; +/** + * @brief SPI command. + */ +typedef enum { + /* Slave HD Only */ + SPI_CMD_HD_WRBUF = BIT(0), + SPI_CMD_HD_RDBUF = BIT(1), + SPI_CMD_HD_WRDMA = BIT(2), + SPI_CMD_HD_RDDMA = BIT(3), + SPI_CMD_HD_SEG_END = BIT(4), + SPI_CMD_HD_EN_QPI = BIT(5), + SPI_CMD_HD_WR_END = BIT(6), + SPI_CMD_HD_INT0 = BIT(7), + SPI_CMD_HD_INT1 = BIT(8), + SPI_CMD_HD_INT2 = BIT(9), +} spi_command_t; /** @cond */ //Doxy command to hide preprocessor definitions from docs */ diff --git a/tools/sdk/esp32/include/hal/platform_port/include/hal/assert.h b/tools/sdk/esp32/include/hal/platform_port/include/hal/assert.h index 45e9b138741..1bfeada1f59 100644 --- a/tools/sdk/esp32/include/hal/platform_port/include/hal/assert.h +++ b/tools/sdk/esp32/include/hal/platform_port/include/hal/assert.h @@ -30,7 +30,9 @@ extern void abort(void); #endif #endif -#if CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent +#if IS_ULP_COCPU +#define HAL_ASSERT(__e) ((void)(__e)) +#elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : abort()) #elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 2 // full assertion #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, #__e)) diff --git a/tools/sdk/esp32/include/heap/include/esp_heap_caps.h b/tools/sdk/esp32/include/heap/include/esp_heap_caps.h index c7d85d4217f..2832b101b5e 100644 --- a/tools/sdk/esp32/include/heap/include/esp_heap_caps.h +++ b/tools/sdk/esp32/include/heap/include/esp_heap_caps.h @@ -33,7 +33,7 @@ extern "C" { #define MALLOC_CAP_INTERNAL (1<<11) ///< Memory must be internal; specifically it should not disappear when flash/spiram cache is switched off #define MALLOC_CAP_DEFAULT (1<<12) ///< Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call #define MALLOC_CAP_IRAM_8BIT (1<<13) ///< Memory must be in IRAM and allow unaligned access -#define MALLOC_CAP_RETENTION (1<<14) +#define MALLOC_CAP_RETENTION (1<<14) ///< Memory must be able to accessed by retention DMA #define MALLOC_CAP_RTCRAM (1<<15) ///< Memory must be in RTC fast memory #define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker @@ -58,8 +58,6 @@ esp_err_t heap_caps_register_failed_alloc_callback(esp_alloc_failed_hook_t callb * * Equivalent semantics to libc malloc(), for capability-aware memory. * - * In IDF, ``malloc(p)`` is equivalent to ``heap_caps_malloc(p, MALLOC_CAP_8BIT)``. - * * @param size Size, in bytes, of the amount of memory to allocate * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type * of memory to be returned diff --git a/tools/sdk/esp32/include/nvs_flash/include/nvs.h b/tools/sdk/esp32/include/nvs_flash/include/nvs.h index 0faef98fd3d..a800d4d1847 100644 --- a/tools/sdk/esp32/include/nvs_flash/include/nvs.h +++ b/tools/sdk/esp32/include/nvs_flash/include/nvs.h @@ -132,6 +132,8 @@ typedef struct nvs_opaque_iterator_t *nvs_iterator_t; * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); @@ -161,6 +163,8 @@ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *ou * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open_from_partition(const char *part_name, const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); diff --git a/tools/sdk/esp32/include/protocomm/include/transports/protocomm_ble.h b/tools/sdk/esp32/include/protocomm/include/transports/protocomm_ble.h index d684e7e921a..0efb31c2134 100644 --- a/tools/sdk/esp32/include/protocomm/include/transports/protocomm_ble.h +++ b/tools/sdk/esp32/include/protocomm/include/transports/protocomm_ble.h @@ -52,7 +52,7 @@ typedef struct protocomm_ble_config { /** * BLE device name being broadcast at the time of provisioning */ - char device_name[MAX_BLE_DEVNAME_LEN]; + char device_name[MAX_BLE_DEVNAME_LEN + 1]; /** * 128 bit UUID of the provisioning service diff --git a/tools/sdk/esp32/include/rmaker_common/include/esp_rmaker_mqtt_glue.h b/tools/sdk/esp32/include/rmaker_common/include/esp_rmaker_mqtt_glue.h index 9355d034ef4..59f2224a9a9 100644 --- a/tools/sdk/esp32/include/rmaker_common/include/esp_rmaker_mqtt_glue.h +++ b/tools/sdk/esp32/include/rmaker_common/include/esp_rmaker_mqtt_glue.h @@ -11,10 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once + #include #include #include + #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32/include/soc/esp32/include/soc/rtc.h b/tools/sdk/esp32/include/soc/esp32/include/soc/rtc.h index b336cb2a7db..033a877a07e 100644 --- a/tools/sdk/esp32/include/soc/esp32/include/soc/rtc.h +++ b/tools/sdk/esp32/include/soc/esp32/include/soc/rtc.h @@ -403,6 +403,11 @@ uint32_t rtc_clk_apb_freq_get(void); * 32k XTAL is being calibrated, but the oscillator has not started up (due to * incorrect loading capacitance, board design issue, or lack of 32 XTAL on board). * + * @note When 32k CLK is being calibrated, this function will check the accuracy + * of the clock. Since the xtal 32k or ext osc 32k is generally very stable, if + * the check fails, then consider this an invalid 32k clock and return 0. This + * check can filter some jamming signal. + * * @param cal_clk clock to be measured * @param slow_clk_cycles number of slow clock cycles to average * @return average slow clock period in microseconds, Q13.19 fixed point format, diff --git a/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h b/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h index 18bd1c762be..67007c4d70b 100644 --- a/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h +++ b/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h @@ -89,9 +89,11 @@ #define SOC_ADC_PATT_LEN_MAX (16) //Two pattern table, each contains 16 items. Each item takes 1 byte. But only support ADC1 using DMA mode #define SOC_ADC_DIGI_MIN_BITWIDTH (9) #define SOC_ADC_DIGI_MAX_BITWIDTH (12) +#define SOC_ADC_DIGI_RESULT_BYTES (2) +#define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4) /*!< F_sample = F_digi_con / 2 / interval. F_digi_con = 5M for now. 30 <= interva <= 4095 */ #define SOC_ADC_SAMPLE_FREQ_THRES_HIGH (2*1000*1000) -#define SOC_ADC_SAMPLE_FREQ_THRES_LOW (2000) +#define SOC_ADC_SAMPLE_FREQ_THRES_LOW (20*1000) /*!< RTC */ #define SOC_ADC_MAX_BITWIDTH (12) @@ -224,6 +226,7 @@ #define SOC_SPI_DMA_CHAN_NUM 2 #define SOC_SPI_PERIPH_CS_NUM(i) 3 +#define SOC_SPI_MAX_CS_NUM 3 #define SOC_SPI_MAXIMUM_BUFFER_SIZE 64 #define SOC_SPI_MAX_PRE_DIVIDER 8192 diff --git a/tools/sdk/esp32/include/soc/include/soc/spi_periph.h b/tools/sdk/esp32/include/soc/include/soc/spi_periph.h index 7aa38650356..d93abf87ef4 100644 --- a/tools/sdk/esp32/include/soc/include/soc/spi_periph.h +++ b/tools/sdk/esp32/include/soc/include/soc/spi_periph.h @@ -66,7 +66,7 @@ typedef struct { const uint8_t spid6_in; const uint8_t spid7_in; #endif // SOC_SPI_SUPPORT_OCT - const uint8_t spics_out[3]; // /CS GPIO output mux signals + const uint8_t spics_out[SOC_SPI_MAX_CS_NUM]; // /CS GPIO output mux signals const uint8_t spics_in; const uint8_t spidqs_out; const uint8_t spicd_out; diff --git a/tools/sdk/esp32/include/spi_flash/include/esp_private/spi_flash_os.h b/tools/sdk/esp32/include/spi_flash/include/esp_private/spi_flash_os.h index e73511bc117..996606dbcee 100644 --- a/tools/sdk/esp32/include/spi_flash/include/esp_private/spi_flash_os.h +++ b/tools/sdk/esp32/include/spi_flash/include/esp_private/spi_flash_os.h @@ -34,11 +34,32 @@ #endif #include "esp_flash.h" #include "hal/spi_flash_hal.h" +#include "soc/soc_caps.h" #ifdef __cplusplus extern "C" { #endif +// Type of MSPI IO +typedef enum { + ESP_MSPI_IO_CLK = 0, + ESP_MSPI_IO_Q, + ESP_MSPI_IO_D, + ESP_MSPI_IO_CS0, /* cs for spi flash */ + ESP_MSPI_IO_HD, + ESP_MSPI_IO_WP, +#if SOC_SPI_MEM_SUPPORT_OPI_MODE + ESP_MSPI_IO_DQS, + ESP_MSPI_IO_D4, + ESP_MSPI_IO_D5, + ESP_MSPI_IO_D6, + ESP_MSPI_IO_D7, +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE +#if CONFIG_SPIRAM + ESP_MSPI_IO_CS1 /* cs for spi ram */ +#endif +} esp_mspi_io_t; + /** * @brief To setup Flash chip */ @@ -80,6 +101,15 @@ void spi_timing_psram_tuning(void); */ void esp_mspi_pin_init(void); +/** + * @brief Get the number of the GPIO corresponding to the given MSPI io + * + * @param[in] io MSPI io + * + * @return MSPI IO number + */ +uint8_t esp_mspi_get_io(esp_mspi_io_t io); + /** * @brief Set SPI1 registers to make ROM functions work * @note This function is used for setting SPI1 registers to the state that ROM SPI functions work diff --git a/tools/sdk/esp32/include/tcp_transport/include/esp_transport.h b/tools/sdk/esp32/include/tcp_transport/include/esp_transport.h index 5c7f2f77ed2..979bd7130c8 100644 --- a/tools/sdk/esp32/include/tcp_transport/include/esp_transport.h +++ b/tools/sdk/esp32/include/tcp_transport/include/esp_transport.h @@ -32,7 +32,7 @@ typedef struct esp_transport_keepalive { int keep_alive_count; /*!< Keep-alive packet retry send count */ } esp_transport_keep_alive_t; -typedef struct esp_transport_internal* esp_transport_list_handle_t; +typedef struct esp_transport_list_t* esp_transport_list_handle_t; typedef struct esp_transport_item_t* esp_transport_handle_t; typedef int (*connect_func)(esp_transport_handle_t t, const char *host, int port, int timeout_ms); @@ -45,6 +45,10 @@ typedef esp_transport_handle_t (*payload_transfer_func)(esp_transport_handle_t); typedef struct esp_tls_last_error* esp_tls_error_handle_t; +/** + * @brief Error types for TCP connection issues not covered in socket's errno + */ + /** * @brief Create transport list * @@ -340,6 +344,7 @@ esp_tls_error_handle_t esp_transport_get_error_handle(esp_transport_handle_t t); */ int esp_transport_get_errno(esp_transport_handle_t t); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/ulp/include/esp32s3/ulp_riscv_adc.h b/tools/sdk/esp32/include/ulp/include/esp32s3/ulp_riscv_adc.h new file mode 100644 index 00000000000..27f53efbfa0 --- /dev/null +++ b/tools/sdk/esp32/include/ulp/include/esp32s3/ulp_riscv_adc.h @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "hal/adc_types.h" +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + adc_channel_t channel; // ADC channel + adc_atten_t atten; // ADC channel attenuation + adc_bits_width_t width; // ADC bit width, only used for ADC unit 1 +} ulp_riscv_adc_cfg_t; // ULP Riscv ADC configuration parameters + +/** + * @brief Initialize and calibrate the ADC1 for use by ULP RISCV + * + * @param cfg Configuration parameters + * @return esp_err_t ESP_OK for successful. + */ +esp_err_t ulp_riscv_adc_init(const ulp_riscv_adc_cfg_t *cfg); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32/include/wpa_supplicant/port/include/supplicant_opt.h b/tools/sdk/esp32/include/wpa_supplicant/port/include/supplicant_opt.h index 59b428d5462..da753327694 100644 --- a/tools/sdk/esp32/include/wpa_supplicant/port/include/supplicant_opt.h +++ b/tools/sdk/esp32/include/wpa_supplicant/port/include/supplicant_opt.h @@ -29,9 +29,6 @@ #define DEBUG_PRINT #endif -#if CONFIG_WPA_11KV_SUPPORT -#define ROAMING_SUPPORT 1 -#endif #if CONFIG_WPA_SCAN_CACHE #define SCAN_CACHE_SUPPORTED diff --git a/tools/sdk/esp32/include/xtensa/include/xt_instr_macros.h b/tools/sdk/esp32/include/xtensa/include/xt_instr_macros.h index e7931f4bf41..efcdbd4a78c 100644 --- a/tools/sdk/esp32/include/xtensa/include/xt_instr_macros.h +++ b/tools/sdk/esp32/include/xtensa/include/xt_instr_macros.h @@ -1,19 +1,13 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#include "xtensa/xtruntime.h" + #define RSR(reg, at) asm volatile ("rsr %0, %1" : "=r" (at) : "i" (reg)) #define WSR(reg, at) asm volatile ("wsr %0, %1" : : "r" (at), "i" (reg)) #define XSR(reg, at) asm volatile ("xsr %0, %1" : "+r" (at) : "i" (reg)) @@ -23,14 +17,27 @@ #define WITLB(at, as) asm volatile ("witlb %0, %1; \n isync \n " : : "r" (at), "r" (as)) #define WDTLB(at, as) asm volatile ("wdtlb %0, %1; \n dsync \n " : : "r" (at), "r" (as)) +#define EXTRA_SAVE_AREA_SIZE 32 +#define BASE_SAVE_AREA_SIZE 16 +#define SAVE_AREA_OFFSET (EXTRA_SAVE_AREA_SIZE + BASE_SAVE_AREA_SIZE) +#define BASE_AREA_SP_OFFSET 12 + /* The SET_STACK implements a setting a new stack pointer (sp or a1). * to do this the need reset PS_WOE, reset WINDOWSTART, update SP, and return PS_WOE. * + * In addition, if a windowOverflow8/12 happens the exception handler expects to be able to look at + * the previous frames stackpointer to find the extra save area. So this function will reserve space + * for this area as well as initialise the previous sp that points to it + * * Note: It has 2 implementations one for using in assembler files (*.S) and one for using in C. * * C code prototype for SET_STACK: * uint32_t ps_reg; * uint32_t w_base; + * + * uint32_t sp = (uint32_t)new_sp - SAVE_AREA_OFFSET; \ + *(uint32_t*)(sp - 12) = (uint32_t)new_sp; \ + * RSR(PS, ps_reg); * ps_reg &= ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK); * WSR(PS, ps_reg); @@ -46,6 +53,10 @@ */ #ifdef __ASSEMBLER__ .macro SET_STACK new_sp tmp1 tmp2 + addi tmp1, new_sp, -SAVE_AREA_OFFSET + addi tmp2, tmp1, -BASE_AREA_SP_OFFSET + s32i new_sp, tmp2, 0 + addi new_sp, tmp1, 0 rsr.ps \tmp1 movi \tmp2, ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK) and \tmp1, \tmp1, \tmp2 @@ -68,8 +79,11 @@ rsync .endm #else + #define SET_STACK(new_sp) \ do { \ + uint32_t sp = (uint32_t)new_sp - SAVE_AREA_OFFSET; \ + *(uint32_t*)(sp - BASE_AREA_SP_OFFSET) = (uint32_t)new_sp; \ uint32_t tmp1 = 0, tmp2 = 0; \ asm volatile ( \ "rsr.ps %1 \n"\ @@ -93,6 +107,6 @@ "or %1, %1, %2 \n"\ "wsr.ps %1 \n"\ "rsync \n"\ - : "+r"(new_sp), "+r"(tmp1), "+r"(tmp2)); \ + : "+r"(sp), "+r"(tmp1), "+r"(tmp2)); \ } while (0); #endif // __ASSEMBLER__ diff --git a/tools/sdk/esp32/include/xtensa/include/xtensa-debug-module.h b/tools/sdk/esp32/include/xtensa/include/xtensa-debug-module.h index d1aca40d5b7..17e5a2e3557 100644 --- a/tools/sdk/esp32/include/xtensa/include/xtensa-debug-module.h +++ b/tools/sdk/esp32/include/xtensa/include/xtensa-debug-module.h @@ -1,6 +1,8 @@ #ifndef XTENSA_DEBUG_MODULE_H #define XTENSA_DEBUG_MODULE_H +#include + /* ERI registers / OCD offsets and field definitions */ diff --git a/tools/sdk/esp32/ld/libbtdm_app.a b/tools/sdk/esp32/ld/libbtdm_app.a index f8dc08125b2..0f3296c05a2 100644 Binary files a/tools/sdk/esp32/ld/libbtdm_app.a and b/tools/sdk/esp32/ld/libbtdm_app.a differ diff --git a/tools/sdk/esp32/ld/libc_speech_features.a b/tools/sdk/esp32/ld/libc_speech_features.a index dce17c18d37..48302fa663a 100644 Binary files a/tools/sdk/esp32/ld/libc_speech_features.a and b/tools/sdk/esp32/ld/libc_speech_features.a differ diff --git a/tools/sdk/esp32/ld/libcat_face_detect.a b/tools/sdk/esp32/ld/libcat_face_detect.a index c7a9cb5440d..bcc9cc3dbf1 100644 Binary files a/tools/sdk/esp32/ld/libcat_face_detect.a and b/tools/sdk/esp32/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32/ld/libcolor_detect.a b/tools/sdk/esp32/ld/libcolor_detect.a index 29267ed392a..f811a4e2cdf 100644 Binary files a/tools/sdk/esp32/ld/libcolor_detect.a and b/tools/sdk/esp32/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32/ld/libcustomized_word_wn5.a b/tools/sdk/esp32/ld/libcustomized_word_wn5.a deleted file mode 100644 index 7b85a4ff5c2..00000000000 Binary files a/tools/sdk/esp32/ld/libcustomized_word_wn5.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libdl.a b/tools/sdk/esp32/ld/libdl.a index 8b5db786f2d..d71374110f5 100644 Binary files a/tools/sdk/esp32/ld/libdl.a and b/tools/sdk/esp32/ld/libdl.a differ diff --git a/tools/sdk/esp32/ld/libdl_lib.a b/tools/sdk/esp32/ld/libdl_lib.a index f35b1b0462b..5baac51617b 100644 Binary files a/tools/sdk/esp32/ld/libdl_lib.a and b/tools/sdk/esp32/ld/libdl_lib.a differ diff --git a/tools/sdk/esp32/ld/libesp_tts_chinese.a b/tools/sdk/esp32/ld/libesp_tts_chinese.a index 7bb4b39e552..22334d195de 100644 Binary files a/tools/sdk/esp32/ld/libesp_tts_chinese.a and b/tools/sdk/esp32/ld/libesp_tts_chinese.a differ diff --git a/tools/sdk/esp32/ld/libhilexin_wn5.a b/tools/sdk/esp32/ld/libhilexin_wn5.a deleted file mode 100644 index 1690cdf9f15..00000000000 Binary files a/tools/sdk/esp32/ld/libhilexin_wn5.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libhilexin_wn5X2.a b/tools/sdk/esp32/ld/libhilexin_wn5X2.a deleted file mode 100644 index b2cb3c19045..00000000000 Binary files a/tools/sdk/esp32/ld/libhilexin_wn5X2.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libhilexin_wn5X3.a b/tools/sdk/esp32/ld/libhilexin_wn5X3.a deleted file mode 100644 index fa1f5e7ac45..00000000000 Binary files a/tools/sdk/esp32/ld/libhilexin_wn5X3.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libhuman_face_detect.a b/tools/sdk/esp32/ld/libhuman_face_detect.a index cd849d2c661..ec82bbdb05d 100644 Binary files a/tools/sdk/esp32/ld/libhuman_face_detect.a and b/tools/sdk/esp32/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32/ld/libmfn.a b/tools/sdk/esp32/ld/libmfn.a index fcc4727cc1b..c83ba495154 100644 Binary files a/tools/sdk/esp32/ld/libmfn.a and b/tools/sdk/esp32/ld/libmfn.a differ diff --git a/tools/sdk/esp32/ld/libnihaoxiaoxin_wn5X3.a b/tools/sdk/esp32/ld/libnihaoxiaoxin_wn5X3.a deleted file mode 100644 index 1ab173b7027..00000000000 Binary files a/tools/sdk/esp32/ld/libnihaoxiaoxin_wn5X3.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5.a b/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5.a deleted file mode 100644 index 0e207efcbed..00000000000 Binary files a/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5X2.a b/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5X2.a deleted file mode 100644 index e6edeb86d45..00000000000 Binary files a/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5X2.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5X3.a b/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5X3.a deleted file mode 100644 index fe28e3ef0f7..00000000000 Binary files a/tools/sdk/esp32/ld/libnihaoxiaozhi_wn5X3.a and /dev/null differ diff --git a/tools/sdk/esp32/ld/libvoice_set_xiaole.a b/tools/sdk/esp32/ld/libvoice_set_xiaole.a index 0f39f7d7d3d..06862f813ec 100644 Binary files a/tools/sdk/esp32/ld/libvoice_set_xiaole.a and b/tools/sdk/esp32/ld/libvoice_set_xiaole.a differ diff --git a/tools/sdk/esp32/ld/libwakeword_model.a b/tools/sdk/esp32/ld/libwakeword_model.a new file mode 100644 index 00000000000..27214ed0ce3 Binary files /dev/null and b/tools/sdk/esp32/ld/libwakeword_model.a differ diff --git a/tools/sdk/esp32/ld/memory.ld b/tools/sdk/esp32/ld/memory.ld index 5eaca0cc756..0b7ed0d5bfe 100644 --- a/tools/sdk/esp32/ld/memory.ld +++ b/tools/sdk/esp32/ld/memory.ld @@ -70,7 +70,7 @@ MEMORY /* (See iram0_2_seg for meaning of 0x20 offset in the above.) */ /* RTC fast memory (executable). Persists over deep sleep. */ - rtc_iram_seg(RWX) : org = 0x400C0000, len = 0x2000 + rtc_iram_seg(RWX) : org = 0x400C0000, len = 0x2000 - (0x10) /* RTC fast memory (same block as above), viewed from data bus */ rtc_data_seg(RW) : org = 0x3ff80000, len = 0x2000 - (0x10) /* RTC slow memory (data accessible). Persists over deep sleep. diff --git a/tools/sdk/esp32/ld/sections.ld b/tools/sdk/esp32/ld/sections.ld index 93619f1c739..a22203c7d9d 100644 --- a/tools/sdk/esp32/ld/sections.ld +++ b/tools/sdk/esp32/ld/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -794,6 +794,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32/lib/libapp_trace.a b/tools/sdk/esp32/lib/libapp_trace.a index fbad2c8a8f8..b4ccb0d5992 100644 Binary files a/tools/sdk/esp32/lib/libapp_trace.a and b/tools/sdk/esp32/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32/lib/libapp_update.a b/tools/sdk/esp32/lib/libapp_update.a index ff716f7e68f..688c6f6979e 100644 Binary files a/tools/sdk/esp32/lib/libapp_update.a and b/tools/sdk/esp32/lib/libapp_update.a differ diff --git a/tools/sdk/esp32/lib/libasio.a b/tools/sdk/esp32/lib/libasio.a index 88d206e373e..c8d3fffd01f 100644 Binary files a/tools/sdk/esp32/lib/libasio.a and b/tools/sdk/esp32/lib/libasio.a differ diff --git a/tools/sdk/esp32/lib/libbootloader_support.a b/tools/sdk/esp32/lib/libbootloader_support.a index 83c90723e9a..4970807d478 100644 Binary files a/tools/sdk/esp32/lib/libbootloader_support.a and b/tools/sdk/esp32/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32/lib/libbt.a b/tools/sdk/esp32/lib/libbt.a index 5ca3740ed7a..2875848a893 100644 Binary files a/tools/sdk/esp32/lib/libbt.a and b/tools/sdk/esp32/lib/libbt.a differ diff --git a/tools/sdk/esp32/lib/libcbor.a b/tools/sdk/esp32/lib/libcbor.a index b1a9682fe33..c65f8224725 100644 Binary files a/tools/sdk/esp32/lib/libcbor.a and b/tools/sdk/esp32/lib/libcbor.a differ diff --git a/tools/sdk/esp32/lib/libcmock.a b/tools/sdk/esp32/lib/libcmock.a index 7fccbc289ea..e6bd3d11c04 100644 Binary files a/tools/sdk/esp32/lib/libcmock.a and b/tools/sdk/esp32/lib/libcmock.a differ diff --git a/tools/sdk/esp32/lib/libcoap.a b/tools/sdk/esp32/lib/libcoap.a index 8e57613c7b3..0443a4318fa 100644 Binary files a/tools/sdk/esp32/lib/libcoap.a and b/tools/sdk/esp32/lib/libcoap.a differ diff --git a/tools/sdk/esp32/lib/libcoexist.a b/tools/sdk/esp32/lib/libcoexist.a index 246c69a0ebd..c494a606d99 100644 Binary files a/tools/sdk/esp32/lib/libcoexist.a and b/tools/sdk/esp32/lib/libcoexist.a differ diff --git a/tools/sdk/esp32/lib/libconsole.a b/tools/sdk/esp32/lib/libconsole.a index 0ead7bc2ddd..164879ad02a 100644 Binary files a/tools/sdk/esp32/lib/libconsole.a and b/tools/sdk/esp32/lib/libconsole.a differ diff --git a/tools/sdk/esp32/lib/libcore.a b/tools/sdk/esp32/lib/libcore.a index 6acae1ff90e..55afaf589b9 100644 Binary files a/tools/sdk/esp32/lib/libcore.a and b/tools/sdk/esp32/lib/libcore.a differ diff --git a/tools/sdk/esp32/lib/libcxx.a b/tools/sdk/esp32/lib/libcxx.a index e6d8046f808..44cb5771124 100644 Binary files a/tools/sdk/esp32/lib/libcxx.a and b/tools/sdk/esp32/lib/libcxx.a differ diff --git a/tools/sdk/esp32/lib/libdriver.a b/tools/sdk/esp32/lib/libdriver.a index 04608f6578d..c8a526fb0e4 100644 Binary files a/tools/sdk/esp32/lib/libdriver.a and b/tools/sdk/esp32/lib/libdriver.a differ diff --git a/tools/sdk/esp32/lib/libefuse.a b/tools/sdk/esp32/lib/libefuse.a index d8a384f499a..3155c48fcd0 100644 Binary files a/tools/sdk/esp32/lib/libefuse.a and b/tools/sdk/esp32/lib/libefuse.a differ diff --git a/tools/sdk/esp32/lib/libesp-dsp.a b/tools/sdk/esp32/lib/libesp-dsp.a index cf3b86bcf80..5b060529788 100644 Binary files a/tools/sdk/esp32/lib/libesp-dsp.a and b/tools/sdk/esp32/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32/lib/libesp-sr.a b/tools/sdk/esp32/lib/libesp-sr.a index 701ca67d3a0..e9f1d067dd5 100644 Binary files a/tools/sdk/esp32/lib/libesp-sr.a and b/tools/sdk/esp32/lib/libesp-sr.a differ diff --git a/tools/sdk/esp32/lib/libesp-tls.a b/tools/sdk/esp32/lib/libesp-tls.a index b533490b4ec..95b32127227 100644 Binary files a/tools/sdk/esp32/lib/libesp-tls.a and b/tools/sdk/esp32/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32/lib/libesp32-camera.a b/tools/sdk/esp32/lib/libesp32-camera.a index 2946f57c1d0..8ebc652b660 100644 Binary files a/tools/sdk/esp32/lib/libesp32-camera.a and b/tools/sdk/esp32/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32/lib/libesp_adc_cal.a b/tools/sdk/esp32/lib/libesp_adc_cal.a index 90c1308aa7f..533bec49312 100644 Binary files a/tools/sdk/esp32/lib/libesp_adc_cal.a and b/tools/sdk/esp32/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32/lib/libesp_audio_front_end.a b/tools/sdk/esp32/lib/libesp_audio_front_end.a index 14b8708a966..ab8330a43bc 100644 Binary files a/tools/sdk/esp32/lib/libesp_audio_front_end.a and b/tools/sdk/esp32/lib/libesp_audio_front_end.a differ diff --git a/tools/sdk/esp32/lib/libesp_audio_processor.a b/tools/sdk/esp32/lib/libesp_audio_processor.a index 95f3fbfe96c..fe61d5e4cc4 100644 Binary files a/tools/sdk/esp32/lib/libesp_audio_processor.a and b/tools/sdk/esp32/lib/libesp_audio_processor.a differ diff --git a/tools/sdk/esp32/lib/libesp_common.a b/tools/sdk/esp32/lib/libesp_common.a index 19b7e915df9..c0477fdff81 100644 Binary files a/tools/sdk/esp32/lib/libesp_common.a and b/tools/sdk/esp32/lib/libesp_common.a differ diff --git a/tools/sdk/esp32/lib/libesp_eth.a b/tools/sdk/esp32/lib/libesp_eth.a index 4e38183487c..b5152390191 100644 Binary files a/tools/sdk/esp32/lib/libesp_eth.a and b/tools/sdk/esp32/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32/lib/libesp_event.a b/tools/sdk/esp32/lib/libesp_event.a index f4e9af4467b..9e4948dc819 100644 Binary files a/tools/sdk/esp32/lib/libesp_event.a and b/tools/sdk/esp32/lib/libesp_event.a differ diff --git a/tools/sdk/esp32/lib/libesp_gdbstub.a b/tools/sdk/esp32/lib/libesp_gdbstub.a index 05bd43cc76b..7d24cf1363b 100644 Binary files a/tools/sdk/esp32/lib/libesp_gdbstub.a and b/tools/sdk/esp32/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32/lib/libesp_hid.a b/tools/sdk/esp32/lib/libesp_hid.a index 69adac38f87..c47d80e267e 100644 Binary files a/tools/sdk/esp32/lib/libesp_hid.a and b/tools/sdk/esp32/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32/lib/libesp_http_client.a b/tools/sdk/esp32/lib/libesp_http_client.a index a6cbb446458..14f1b47f3bc 100644 Binary files a/tools/sdk/esp32/lib/libesp_http_client.a and b/tools/sdk/esp32/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32/lib/libesp_http_server.a b/tools/sdk/esp32/lib/libesp_http_server.a index d43ddbbc574..9df69b54370 100644 Binary files a/tools/sdk/esp32/lib/libesp_http_server.a and b/tools/sdk/esp32/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32/lib/libesp_https_ota.a b/tools/sdk/esp32/lib/libesp_https_ota.a index fa8272c4d3d..1de31c3fac1 100644 Binary files a/tools/sdk/esp32/lib/libesp_https_ota.a and b/tools/sdk/esp32/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32/lib/libesp_https_server.a b/tools/sdk/esp32/lib/libesp_https_server.a index 952405f0a70..05f8f8d9aa8 100644 Binary files a/tools/sdk/esp32/lib/libesp_https_server.a and b/tools/sdk/esp32/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32/lib/libesp_hw_support.a b/tools/sdk/esp32/lib/libesp_hw_support.a index ab16e623525..bc1508ff884 100644 Binary files a/tools/sdk/esp32/lib/libesp_hw_support.a and b/tools/sdk/esp32/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32/lib/libesp_ipc.a b/tools/sdk/esp32/lib/libesp_ipc.a index 50db34a9ea3..b803b949579 100644 Binary files a/tools/sdk/esp32/lib/libesp_ipc.a and b/tools/sdk/esp32/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32/lib/libesp_lcd.a b/tools/sdk/esp32/lib/libesp_lcd.a index 14f5bf3583c..7c428e49c1c 100644 Binary files a/tools/sdk/esp32/lib/libesp_lcd.a and b/tools/sdk/esp32/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32/lib/libesp_littlefs.a b/tools/sdk/esp32/lib/libesp_littlefs.a index c2eac778643..caa170dc18b 100644 Binary files a/tools/sdk/esp32/lib/libesp_littlefs.a and b/tools/sdk/esp32/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32/lib/libesp_local_ctrl.a b/tools/sdk/esp32/lib/libesp_local_ctrl.a index 590a46ec340..bab90f436f3 100644 Binary files a/tools/sdk/esp32/lib/libesp_local_ctrl.a and b/tools/sdk/esp32/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32/lib/libesp_netif.a b/tools/sdk/esp32/lib/libesp_netif.a index fcf901a746f..b7560b19265 100644 Binary files a/tools/sdk/esp32/lib/libesp_netif.a and b/tools/sdk/esp32/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32/lib/libesp_phy.a b/tools/sdk/esp32/lib/libesp_phy.a index 67b1c094d6b..0f4ffc38ec0 100644 Binary files a/tools/sdk/esp32/lib/libesp_phy.a and b/tools/sdk/esp32/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32/lib/libesp_pm.a b/tools/sdk/esp32/lib/libesp_pm.a index bbb7d0e5e91..cacc116c764 100644 Binary files a/tools/sdk/esp32/lib/libesp_pm.a and b/tools/sdk/esp32/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32/lib/libesp_rainmaker.a b/tools/sdk/esp32/lib/libesp_rainmaker.a index bbd22d03d69..e973ed3019e 100644 Binary files a/tools/sdk/esp32/lib/libesp_rainmaker.a and b/tools/sdk/esp32/lib/libesp_rainmaker.a differ diff --git a/tools/sdk/esp32/lib/libesp_ringbuf.a b/tools/sdk/esp32/lib/libesp_ringbuf.a index d947bd41ab5..d971f79d1e2 100644 Binary files a/tools/sdk/esp32/lib/libesp_ringbuf.a and b/tools/sdk/esp32/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32/lib/libesp_rom.a b/tools/sdk/esp32/lib/libesp_rom.a index d1a6ca27347..a43a10693d2 100644 Binary files a/tools/sdk/esp32/lib/libesp_rom.a and b/tools/sdk/esp32/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32/lib/libesp_schedule.a b/tools/sdk/esp32/lib/libesp_schedule.a index caa721b5ec4..e0458ccaf91 100644 Binary files a/tools/sdk/esp32/lib/libesp_schedule.a and b/tools/sdk/esp32/lib/libesp_schedule.a differ diff --git a/tools/sdk/esp32/lib/libesp_serial_slave_link.a b/tools/sdk/esp32/lib/libesp_serial_slave_link.a index 3a37d13ba33..5cae54a1237 100644 Binary files a/tools/sdk/esp32/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32/lib/libesp_system.a b/tools/sdk/esp32/lib/libesp_system.a index 95a6d733343..35f0e0aedad 100644 Binary files a/tools/sdk/esp32/lib/libesp_system.a and b/tools/sdk/esp32/lib/libesp_system.a differ diff --git a/tools/sdk/esp32/lib/libesp_timer.a b/tools/sdk/esp32/lib/libesp_timer.a index a3b72dfde04..8d8e8554906 100644 Binary files a/tools/sdk/esp32/lib/libesp_timer.a and b/tools/sdk/esp32/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32/lib/libesp_websocket_client.a b/tools/sdk/esp32/lib/libesp_websocket_client.a index ffc4cbbd9ee..4c8529a4fd4 100644 Binary files a/tools/sdk/esp32/lib/libesp_websocket_client.a and b/tools/sdk/esp32/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32/lib/libesp_wifi.a b/tools/sdk/esp32/lib/libesp_wifi.a index c4481a39023..09b9093579b 100644 Binary files a/tools/sdk/esp32/lib/libesp_wifi.a and b/tools/sdk/esp32/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32/lib/libespcoredump.a b/tools/sdk/esp32/lib/libespcoredump.a index 27d37da5e22..b692b805506 100644 Binary files a/tools/sdk/esp32/lib/libespcoredump.a and b/tools/sdk/esp32/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32/lib/libespnow.a b/tools/sdk/esp32/lib/libespnow.a index db6aa2976ef..4a5d3efc5c1 100644 Binary files a/tools/sdk/esp32/lib/libespnow.a and b/tools/sdk/esp32/lib/libespnow.a differ diff --git a/tools/sdk/esp32/lib/libexpat.a b/tools/sdk/esp32/lib/libexpat.a index b2346d7c552..98b9886bf67 100644 Binary files a/tools/sdk/esp32/lib/libexpat.a and b/tools/sdk/esp32/lib/libexpat.a differ diff --git a/tools/sdk/esp32/lib/libfatfs.a b/tools/sdk/esp32/lib/libfatfs.a index 03e2ad810f0..6e328dbfa3b 100644 Binary files a/tools/sdk/esp32/lib/libfatfs.a and b/tools/sdk/esp32/lib/libfatfs.a differ diff --git a/tools/sdk/esp32/lib/libfb_gfx.a b/tools/sdk/esp32/lib/libfb_gfx.a index 0ca0df1fd47..4c3c9185508 100644 Binary files a/tools/sdk/esp32/lib/libfb_gfx.a and b/tools/sdk/esp32/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32/lib/libfreemodbus.a b/tools/sdk/esp32/lib/libfreemodbus.a index 7a3cfb26c96..59af27ab2da 100644 Binary files a/tools/sdk/esp32/lib/libfreemodbus.a and b/tools/sdk/esp32/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32/lib/libfreertos.a b/tools/sdk/esp32/lib/libfreertos.a index c4f2a792a96..4e2324bd9b4 100644 Binary files a/tools/sdk/esp32/lib/libfreertos.a and b/tools/sdk/esp32/lib/libfreertos.a differ diff --git a/tools/sdk/esp32/lib/libgpio_button.a b/tools/sdk/esp32/lib/libgpio_button.a index 92c51eec381..5b30d54a55b 100644 Binary files a/tools/sdk/esp32/lib/libgpio_button.a and b/tools/sdk/esp32/lib/libgpio_button.a differ diff --git a/tools/sdk/esp32/lib/libhal.a b/tools/sdk/esp32/lib/libhal.a index 6d29db813e2..ad8844621ed 100644 Binary files a/tools/sdk/esp32/lib/libhal.a and b/tools/sdk/esp32/lib/libhal.a differ diff --git a/tools/sdk/esp32/lib/libheap.a b/tools/sdk/esp32/lib/libheap.a index 5f51ad974d3..1fd69bd98bd 100644 Binary files a/tools/sdk/esp32/lib/libheap.a and b/tools/sdk/esp32/lib/libheap.a differ diff --git a/tools/sdk/esp32/lib/libjsmn.a b/tools/sdk/esp32/lib/libjsmn.a index 4506867adc6..b8276668a8f 100644 Binary files a/tools/sdk/esp32/lib/libjsmn.a and b/tools/sdk/esp32/lib/libjsmn.a differ diff --git a/tools/sdk/esp32/lib/libjson.a b/tools/sdk/esp32/lib/libjson.a index 7b75216a832..8587c2fda7b 100644 Binary files a/tools/sdk/esp32/lib/libjson.a and b/tools/sdk/esp32/lib/libjson.a differ diff --git a/tools/sdk/esp32/lib/libjson_generator.a b/tools/sdk/esp32/lib/libjson_generator.a index e82e2718e16..04d015ad99a 100644 Binary files a/tools/sdk/esp32/lib/libjson_generator.a and b/tools/sdk/esp32/lib/libjson_generator.a differ diff --git a/tools/sdk/esp32/lib/libjson_parser.a b/tools/sdk/esp32/lib/libjson_parser.a index d59122c452b..6f8e6d5ecd2 100644 Binary files a/tools/sdk/esp32/lib/libjson_parser.a and b/tools/sdk/esp32/lib/libjson_parser.a differ diff --git a/tools/sdk/esp32/lib/liblibsodium.a b/tools/sdk/esp32/lib/liblibsodium.a index b29f8159109..5059ed406cd 100644 Binary files a/tools/sdk/esp32/lib/liblibsodium.a and b/tools/sdk/esp32/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32/lib/liblog.a b/tools/sdk/esp32/lib/liblog.a index 52395e96f26..63543dc8c5e 100644 Binary files a/tools/sdk/esp32/lib/liblog.a and b/tools/sdk/esp32/lib/liblog.a differ diff --git a/tools/sdk/esp32/lib/liblwip.a b/tools/sdk/esp32/lib/liblwip.a index e69861ef6f8..2647c995d5f 100644 Binary files a/tools/sdk/esp32/lib/liblwip.a and b/tools/sdk/esp32/lib/liblwip.a differ diff --git a/tools/sdk/esp32/lib/libmbedcrypto.a b/tools/sdk/esp32/lib/libmbedcrypto.a index f7578aada94..e85987e3ce6 100644 Binary files a/tools/sdk/esp32/lib/libmbedcrypto.a and b/tools/sdk/esp32/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32/lib/libmbedtls.a b/tools/sdk/esp32/lib/libmbedtls.a index d369ba61de7..d1fe39ed822 100644 Binary files a/tools/sdk/esp32/lib/libmbedtls.a and b/tools/sdk/esp32/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32/lib/libmbedtls_2.a b/tools/sdk/esp32/lib/libmbedtls_2.a index 38b666ad3a8..79a9604fa49 100644 Binary files a/tools/sdk/esp32/lib/libmbedtls_2.a and b/tools/sdk/esp32/lib/libmbedtls_2.a differ diff --git a/tools/sdk/esp32/lib/libmbedx509.a b/tools/sdk/esp32/lib/libmbedx509.a index 8f0dc1fa2dc..32966b940a3 100644 Binary files a/tools/sdk/esp32/lib/libmbedx509.a and b/tools/sdk/esp32/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32/lib/libmdns.a b/tools/sdk/esp32/lib/libmdns.a index d61c0886c54..933a5cebb60 100644 Binary files a/tools/sdk/esp32/lib/libmdns.a and b/tools/sdk/esp32/lib/libmdns.a differ diff --git a/tools/sdk/esp32/lib/libmesh.a b/tools/sdk/esp32/lib/libmesh.a index 1f99a0107d5..21de1504f4d 100644 Binary files a/tools/sdk/esp32/lib/libmesh.a and b/tools/sdk/esp32/lib/libmesh.a differ diff --git a/tools/sdk/esp32/lib/libmqtt.a b/tools/sdk/esp32/lib/libmqtt.a index 31287669539..e0e857be0db 100644 Binary files a/tools/sdk/esp32/lib/libmqtt.a and b/tools/sdk/esp32/lib/libmqtt.a differ diff --git a/tools/sdk/esp32/lib/libmultinet.a b/tools/sdk/esp32/lib/libmultinet.a index c3a9fd56998..64cbfba5ee4 100644 Binary files a/tools/sdk/esp32/lib/libmultinet.a and b/tools/sdk/esp32/lib/libmultinet.a differ diff --git a/tools/sdk/esp32/lib/libnet80211.a b/tools/sdk/esp32/lib/libnet80211.a index 6095cac16ac..5541326a430 100644 Binary files a/tools/sdk/esp32/lib/libnet80211.a and b/tools/sdk/esp32/lib/libnet80211.a differ diff --git a/tools/sdk/esp32/lib/libnewlib.a b/tools/sdk/esp32/lib/libnewlib.a index c4570ff55c5..fc697c8c229 100644 Binary files a/tools/sdk/esp32/lib/libnewlib.a and b/tools/sdk/esp32/lib/libnewlib.a differ diff --git a/tools/sdk/esp32/lib/libnghttp.a b/tools/sdk/esp32/lib/libnghttp.a index 3574597b695..c8282153e26 100644 Binary files a/tools/sdk/esp32/lib/libnghttp.a and b/tools/sdk/esp32/lib/libnghttp.a differ diff --git a/tools/sdk/esp32/lib/libnvs_flash.a b/tools/sdk/esp32/lib/libnvs_flash.a index c8c1372e9a9..119d85cc734 100644 Binary files a/tools/sdk/esp32/lib/libnvs_flash.a and b/tools/sdk/esp32/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32/lib/libopenssl.a b/tools/sdk/esp32/lib/libopenssl.a index 21712389419..f1c42b440a1 100644 Binary files a/tools/sdk/esp32/lib/libopenssl.a and b/tools/sdk/esp32/lib/libopenssl.a differ diff --git a/tools/sdk/esp32/lib/libperfmon.a b/tools/sdk/esp32/lib/libperfmon.a index 421acef9eda..450df36c9b4 100644 Binary files a/tools/sdk/esp32/lib/libperfmon.a and b/tools/sdk/esp32/lib/libperfmon.a differ diff --git a/tools/sdk/esp32/lib/libpp.a b/tools/sdk/esp32/lib/libpp.a index 90ceb36818d..4fe8daf0675 100644 Binary files a/tools/sdk/esp32/lib/libpp.a and b/tools/sdk/esp32/lib/libpp.a differ diff --git a/tools/sdk/esp32/lib/libprotobuf-c.a b/tools/sdk/esp32/lib/libprotobuf-c.a index 223761f2070..0b9aaadeb99 100644 Binary files a/tools/sdk/esp32/lib/libprotobuf-c.a and b/tools/sdk/esp32/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32/lib/libprotocomm.a b/tools/sdk/esp32/lib/libprotocomm.a index d6396bac4e9..c5f1f670d56 100644 Binary files a/tools/sdk/esp32/lib/libprotocomm.a and b/tools/sdk/esp32/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32/lib/libpthread.a b/tools/sdk/esp32/lib/libpthread.a index 8084d3ad532..38f39b34898 100644 Binary files a/tools/sdk/esp32/lib/libpthread.a and b/tools/sdk/esp32/lib/libpthread.a differ diff --git a/tools/sdk/esp32/lib/libqrcode.a b/tools/sdk/esp32/lib/libqrcode.a index 7f77e49e251..962dd1062be 100644 Binary files a/tools/sdk/esp32/lib/libqrcode.a and b/tools/sdk/esp32/lib/libqrcode.a differ diff --git a/tools/sdk/esp32/lib/librmaker_common.a b/tools/sdk/esp32/lib/librmaker_common.a index 3a2c407d813..4efd3fb80bd 100644 Binary files a/tools/sdk/esp32/lib/librmaker_common.a and b/tools/sdk/esp32/lib/librmaker_common.a differ diff --git a/tools/sdk/esp32/lib/libsdmmc.a b/tools/sdk/esp32/lib/libsdmmc.a index 81ca86dfb22..e04461b0b32 100644 Binary files a/tools/sdk/esp32/lib/libsdmmc.a and b/tools/sdk/esp32/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32/lib/libsmartconfig.a b/tools/sdk/esp32/lib/libsmartconfig.a index 6ba94e391cf..b857e6667bb 100644 Binary files a/tools/sdk/esp32/lib/libsmartconfig.a and b/tools/sdk/esp32/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32/lib/libsoc.a b/tools/sdk/esp32/lib/libsoc.a index 38ad99eea69..22d2f4844a9 100644 Binary files a/tools/sdk/esp32/lib/libsoc.a and b/tools/sdk/esp32/lib/libsoc.a differ diff --git a/tools/sdk/esp32/lib/libspiffs.a b/tools/sdk/esp32/lib/libspiffs.a index 4a1e0e81ec5..5cc02ef8c93 100644 Binary files a/tools/sdk/esp32/lib/libspiffs.a and b/tools/sdk/esp32/lib/libspiffs.a differ diff --git a/tools/sdk/esp32/lib/libtcp_transport.a b/tools/sdk/esp32/lib/libtcp_transport.a index a83b14ccf18..13a7f6a54f4 100644 Binary files a/tools/sdk/esp32/lib/libtcp_transport.a and b/tools/sdk/esp32/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32/lib/libtcpip_adapter.a b/tools/sdk/esp32/lib/libtcpip_adapter.a index b170ff2dc93..59cd8ccdb6c 100644 Binary files a/tools/sdk/esp32/lib/libtcpip_adapter.a and b/tools/sdk/esp32/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32/lib/libulp.a b/tools/sdk/esp32/lib/libulp.a index 9e26c879b5c..cccf73656ae 100644 Binary files a/tools/sdk/esp32/lib/libulp.a and b/tools/sdk/esp32/lib/libulp.a differ diff --git a/tools/sdk/esp32/lib/libunity.a b/tools/sdk/esp32/lib/libunity.a index da0ed56595b..066ab95bbfc 100644 Binary files a/tools/sdk/esp32/lib/libunity.a and b/tools/sdk/esp32/lib/libunity.a differ diff --git a/tools/sdk/esp32/lib/libvfs.a b/tools/sdk/esp32/lib/libvfs.a index f7520a4e337..d9eaadc61f9 100644 Binary files a/tools/sdk/esp32/lib/libvfs.a and b/tools/sdk/esp32/lib/libvfs.a differ diff --git a/tools/sdk/esp32/lib/libwakenet.a b/tools/sdk/esp32/lib/libwakenet.a index 0488cd69dcb..cfb6e9d4d5b 100644 Binary files a/tools/sdk/esp32/lib/libwakenet.a and b/tools/sdk/esp32/lib/libwakenet.a differ diff --git a/tools/sdk/esp32/lib/libwapi.a b/tools/sdk/esp32/lib/libwapi.a index 69a78990cb3..029765dcc6f 100644 Binary files a/tools/sdk/esp32/lib/libwapi.a and b/tools/sdk/esp32/lib/libwapi.a differ diff --git a/tools/sdk/esp32/lib/libwear_levelling.a b/tools/sdk/esp32/lib/libwear_levelling.a index 552923fff38..08bedbef3eb 100644 Binary files a/tools/sdk/esp32/lib/libwear_levelling.a and b/tools/sdk/esp32/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32/lib/libwifi_provisioning.a b/tools/sdk/esp32/lib/libwifi_provisioning.a index c1dbabd352e..f4f8b2b6e3c 100644 Binary files a/tools/sdk/esp32/lib/libwifi_provisioning.a and b/tools/sdk/esp32/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32/lib/libwpa_supplicant.a b/tools/sdk/esp32/lib/libwpa_supplicant.a index 77db2cea8d4..cabed73b6e3 100644 Binary files a/tools/sdk/esp32/lib/libwpa_supplicant.a and b/tools/sdk/esp32/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32/lib/libws2812_led.a b/tools/sdk/esp32/lib/libws2812_led.a index 7a0f5ce31ff..de58acb1c95 100644 Binary files a/tools/sdk/esp32/lib/libws2812_led.a and b/tools/sdk/esp32/lib/libws2812_led.a differ diff --git a/tools/sdk/esp32/lib/libxtensa.a b/tools/sdk/esp32/lib/libxtensa.a index 73e0034e99a..5db61f82182 100644 Binary files a/tools/sdk/esp32/lib/libxtensa.a and b/tools/sdk/esp32/lib/libxtensa.a differ diff --git a/tools/sdk/esp32/qio_qspi/include/sdkconfig.h b/tools/sdk/esp32/qio_qspi/include/sdkconfig.h index cd7d39eb439..d692803269c 100644 --- a/tools/sdk/esp32/qio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32/qio_qspi/include/sdkconfig.h @@ -60,11 +60,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -160,6 +162,7 @@ #define CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BLE_MESH 1 #define CONFIG_BLE_MESH_HCI_5_0 1 #define CONFIG_BLE_MESH_USE_DUPLICATE_SCAN 1 @@ -196,6 +199,10 @@ #define CONFIG_COAP_MBEDTLS_PSK 1 #define CONFIG_COAP_LOG_DEFAULT_LEVEL 0 #define CONFIG_ADC_DISABLE_DAC 1 +#define CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC 1 +#define CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT 1 #define CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4 1 #define CONFIG_EFUSE_MAX_BLK_LEN 192 #define CONFIG_ESP_TLS_USING_MBEDTLS 1 @@ -230,7 +237,7 @@ #define CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM 1 #define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1 #define CONFIG_SPIRAM_BANKSWITCH_RESERVE 8 -#define CONFIG_SPIRAM_OCCUPY_VSPI_HOST 1 +#define CONFIG_SPIRAM_OCCUPY_HSPI_HOST 1 #define CONFIG_D0WD_PSRAM_CLK_IO 17 #define CONFIG_D0WD_PSRAM_CS_IO 16 #define CONFIG_D2WD_PSRAM_CLK_IO 9 @@ -283,6 +290,8 @@ #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 #define CONFIG_ESP_IPC_ISR_ENABLE 1 @@ -625,6 +634,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -752,5 +762,5 @@ #define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED #define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32/qio_qspi/libspi_flash.a b/tools/sdk/esp32/qio_qspi/libspi_flash.a index bba7f6cf4c0..0aa528219bb 100644 Binary files a/tools/sdk/esp32/qio_qspi/libspi_flash.a and b/tools/sdk/esp32/qio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32/qout_qspi/include/sdkconfig.h b/tools/sdk/esp32/qout_qspi/include/sdkconfig.h index 181408afbac..925ce8f9d30 100644 --- a/tools/sdk/esp32/qout_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32/qout_qspi/include/sdkconfig.h @@ -60,11 +60,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -160,6 +162,7 @@ #define CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BLE_MESH 1 #define CONFIG_BLE_MESH_HCI_5_0 1 #define CONFIG_BLE_MESH_USE_DUPLICATE_SCAN 1 @@ -196,6 +199,10 @@ #define CONFIG_COAP_MBEDTLS_PSK 1 #define CONFIG_COAP_LOG_DEFAULT_LEVEL 0 #define CONFIG_ADC_DISABLE_DAC 1 +#define CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC 1 +#define CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID 1 +#define CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT 1 #define CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4 1 #define CONFIG_EFUSE_MAX_BLK_LEN 192 #define CONFIG_ESP_TLS_USING_MBEDTLS 1 @@ -230,7 +237,7 @@ #define CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM 1 #define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1 #define CONFIG_SPIRAM_BANKSWITCH_RESERVE 8 -#define CONFIG_SPIRAM_OCCUPY_VSPI_HOST 1 +#define CONFIG_SPIRAM_OCCUPY_HSPI_HOST 1 #define CONFIG_D0WD_PSRAM_CLK_IO 17 #define CONFIG_D0WD_PSRAM_CS_IO 16 #define CONFIG_D2WD_PSRAM_CLK_IO 9 @@ -283,6 +290,8 @@ #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 #define CONFIG_ESP_IPC_ISR_ENABLE 1 @@ -625,6 +634,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -752,5 +762,5 @@ #define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED #define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32/qout_qspi/libspi_flash.a b/tools/sdk/esp32/qout_qspi/libspi_flash.a index bb810a086ac..868a2a82662 100644 Binary files a/tools/sdk/esp32/qout_qspi/libspi_flash.a and b/tools/sdk/esp32/qout_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32/sdkconfig b/tools/sdk/esp32/sdkconfig index f1ddd015790..386e0712826 100644 --- a/tools/sdk/esp32/sdkconfig +++ b/tools/sdk/esp32/sdkconfig @@ -160,10 +160,11 @@ CONFIG_ESP_RMAKER_USE_CERT_BUNDLE=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD=0 # CONFIG_ESP_RMAKER_SKIP_COMMON_NAME_CHECK is not set -# CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK is not set +CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y # CONFIG_ESP_RMAKER_SKIP_PROJECT_NAME_CHECK is not set CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE=1024 CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD=90 +# CONFIG_ESP_RMAKER_OTA_DISABLE_AUTO_REBOOT is not set # end of ESP RainMaker OTA Config # @@ -190,6 +191,7 @@ CONFIG_ESP_RMAKER_CMD_RESP_ENABLE=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y # CONFIG_ARDUINO_RUN_CORE0 is not set @@ -405,6 +407,7 @@ CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y CONFIG_BT_SMP_ENABLE=y # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 +CONFIG_BT_MAX_DEVICE_NAME_LEN=32 # CONFIG_BT_BLE_RPA_SUPPORTED is not set # end of Bluedroid Options # end of Bluetooth @@ -561,10 +564,10 @@ CONFIG_ADC_DISABLE_DAC=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set -# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set -# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set -# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set +CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=y +CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=y +CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=y +CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT=y # end of TWAI configuration # @@ -683,8 +686,8 @@ CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y CONFIG_SPIRAM_BANKSWITCH_ENABLE=y CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 # CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set -# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set -CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y +CONFIG_SPIRAM_OCCUPY_HSPI_HOST=y +# CONFIG_SPIRAM_OCCUPY_VSPI_HOST is not set # CONFIG_SPIRAM_OCCUPY_NO_HOST is not set # @@ -844,8 +847,9 @@ CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 # CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y # CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set -# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set -# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set # end of Sleep Config # @@ -898,6 +902,13 @@ CONFIG_ESP_PHY_REDUCE_TX_POWER=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -982,6 +993,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -1651,6 +1663,7 @@ CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 CONFIG_WIFI_PROV_BLE_BONDING=y CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y +# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set # end of Wi-Fi Provisioning Manager # @@ -1736,11 +1749,13 @@ CONFIG_BF3005_SUPPORT=y CONFIG_BF20A6_SUPPORT=y # CONFIG_SC101IOT_SUPPORT is not set CONFIG_SC030IOT_SUPPORT=y +# CONFIG_SC031GS_SUPPORT is not set # CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set CONFIG_SCCB_HARDWARE_I2C_PORT1=y CONFIG_SCCB_CLK_FREQ=100000 # CONFIG_GC_SENSOR_WINDOWING_MODE is not set CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y +CONFIG_CAMERA_TASK_STACK_SIZE=2048 CONFIG_CAMERA_CORE0=y # CONFIG_CAMERA_CORE1 is not set # CONFIG_CAMERA_NO_AFFINITY is not set diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin b/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin index 26d2ae87e6e..05c54cb141b 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_40m.elf b/tools/sdk/esp32c3/bin/bootloader_dio_40m.elf new file mode 100755 index 00000000000..a5fe80310ef Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_dio_40m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin b/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin index 26d2ae87e6e..05c54cb141b 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_80m.elf b/tools/sdk/esp32c3/bin/bootloader_dio_80m.elf new file mode 100755 index 00000000000..a5fe80310ef Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_dio_80m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin b/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin index 26d2ae87e6e..05c54cb141b 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_40m.elf b/tools/sdk/esp32c3/bin/bootloader_dout_40m.elf new file mode 100755 index 00000000000..a5fe80310ef Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_dout_40m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin b/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin index 26d2ae87e6e..05c54cb141b 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_80m.elf b/tools/sdk/esp32c3/bin/bootloader_dout_80m.elf new file mode 100755 index 00000000000..a5fe80310ef Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_dout_80m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin b/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin index 4a10bea2ee5..3b2a49838e5 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_40m.elf b/tools/sdk/esp32c3/bin/bootloader_qio_40m.elf new file mode 100755 index 00000000000..dbe3514ab41 Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_qio_40m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin b/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin index 4a10bea2ee5..3b2a49838e5 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_80m.elf b/tools/sdk/esp32c3/bin/bootloader_qio_80m.elf new file mode 100755 index 00000000000..dbe3514ab41 Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_qio_80m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin b/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin index 57690593b86..edd501d4fee 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_40m.elf b/tools/sdk/esp32c3/bin/bootloader_qout_40m.elf new file mode 100755 index 00000000000..0d8aba6d800 Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_qout_40m.elf differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin b/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin index 57690593b86..edd501d4fee 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_80m.elf b/tools/sdk/esp32c3/bin/bootloader_qout_80m.elf new file mode 100755 index 00000000000..0d8aba6d800 Binary files /dev/null and b/tools/sdk/esp32c3/bin/bootloader_qout_80m.elf differ diff --git a/tools/sdk/esp32c3/dio_qspi/include/sdkconfig.h b/tools/sdk/esp32c3/dio_qspi/include/sdkconfig.h index 553f8277c2d..2792356efe9 100644 --- a/tools/sdk/esp32c3/dio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32c3/dio_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32c3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -117,7 +119,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -191,6 +193,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -267,8 +270,8 @@ #define CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES 4 -#define CONFIG_ESP_SLEEP_POWER_DOWN_FLASH 1 #define CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 @@ -372,7 +375,6 @@ #define CONFIG_FREERTOS_OPTIMIZED_SCHEDULER 1 #define CONFIG_FREERTOS_HZ 1000 #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 -#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1 #define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 #define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 @@ -619,6 +621,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -673,7 +676,6 @@ #define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT CONFIG_PTHREAD_TASK_PRIO_DEFAULT #define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT #define CONFIG_ESP_GRATUITOUS_ARP CONFIG_LWIP_ESP_GRATUITOUS_ARP -#define CONFIG_ESP_SYSTEM_PD_FLASH CONFIG_ESP_SLEEP_POWER_DOWN_FLASH #define CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP #define CONFIG_FLASHMODE_DIO CONFIG_ESPTOOLPY_FLASHMODE_DIO #define CONFIG_GAP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING @@ -744,5 +746,5 @@ #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32c3/dio_qspi/libspi_flash.a b/tools/sdk/esp32c3/dio_qspi/libspi_flash.a index 835d6b90c9d..38bd64d470b 100644 Binary files a/tools/sdk/esp32c3/dio_qspi/libspi_flash.a and b/tools/sdk/esp32c3/dio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32c3/dout_qspi/include/sdkconfig.h b/tools/sdk/esp32c3/dout_qspi/include/sdkconfig.h index 065052ce522..cc94cae08e7 100644 --- a/tools/sdk/esp32c3/dout_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32c3/dout_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32c3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -117,7 +119,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -191,6 +193,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -267,8 +270,8 @@ #define CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES 4 -#define CONFIG_ESP_SLEEP_POWER_DOWN_FLASH 1 #define CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 @@ -372,7 +375,6 @@ #define CONFIG_FREERTOS_OPTIMIZED_SCHEDULER 1 #define CONFIG_FREERTOS_HZ 1000 #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 -#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1 #define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 #define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 @@ -619,6 +621,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -673,7 +676,6 @@ #define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT CONFIG_PTHREAD_TASK_PRIO_DEFAULT #define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT #define CONFIG_ESP_GRATUITOUS_ARP CONFIG_LWIP_ESP_GRATUITOUS_ARP -#define CONFIG_ESP_SYSTEM_PD_FLASH CONFIG_ESP_SLEEP_POWER_DOWN_FLASH #define CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP #define CONFIG_FLASHMODE_DOUT CONFIG_ESPTOOLPY_FLASHMODE_DOUT #define CONFIG_GAP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING @@ -744,5 +746,5 @@ #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32c3/dout_qspi/libspi_flash.a b/tools/sdk/esp32c3/dout_qspi/libspi_flash.a index dea58cb4585..0071527794f 100644 Binary files a/tools/sdk/esp32c3/dout_qspi/libspi_flash.a and b/tools/sdk/esp32c3/dout_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h index 2f4e9062200..1a641be10ec 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h @@ -26,7 +26,7 @@ extern "C" { #endif -/// Type of hold a GPIO in low state +// Type of hold a GPIO in low state typedef enum { GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */ GPIO_SHORT_HOLD = -1, /*!< The short hold GPIO */ diff --git a/tools/sdk/esp32c3/include/bt/common/api/include/api/esp_blufi_api.h b/tools/sdk/esp32c3/include/bt/common/api/include/api/esp_blufi_api.h index 7c99f658206..63109b20f12 100644 --- a/tools/sdk/esp32c3/include/bt/common/api/include/api/esp_blufi_api.h +++ b/tools/sdk/esp32c3/include/bt/common/api/include/api/esp_blufi_api.h @@ -114,9 +114,9 @@ typedef struct { } esp_blufi_ap_record_t; /// Bluetooth address length -#define ESP_BD_ADDR_LEN 6 +#define ESP_BLUFI_BD_ADDR_LEN 6 /// Bluetooth device address -typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN]; +typedef uint8_t esp_blufi_bd_addr_t[ESP_BLUFI_BD_ADDR_LEN]; /** * @brief BLUFI callback parameters union @@ -147,7 +147,7 @@ typedef union { * @brief ESP_BLUFI_EVENT_CONNECT */ struct blufi_connect_evt_param { - esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ + esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ uint8_t server_if; /*!< server interface */ uint16_t conn_id; /*!< Connection id */ } connect; /*!< Blufi callback param of ESP_BLUFI_EVENT_CONNECT */ @@ -156,7 +156,7 @@ typedef union { * @brief ESP_BLUFI_EVENT_DISCONNECT */ struct blufi_disconnect_evt_param { - esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ + esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ } disconnect; /*!< Blufi callback param of ESP_BLUFI_EVENT_DISCONNECT */ /* ESP_BLUFI_EVENT_REQ_WIFI_CONNECT */ /* No callback param */ diff --git a/tools/sdk/esp32c3/include/bt/common/osi/include/osi/fixed_pkt_queue.h b/tools/sdk/esp32c3/include/bt/common/osi/include/osi/fixed_pkt_queue.h new file mode 100644 index 00000000000..f4235ca5d99 --- /dev/null +++ b/tools/sdk/esp32c3/include/bt/common/osi/include/osi/fixed_pkt_queue.h @@ -0,0 +1,79 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _FIXED_PKT_QUEUE_H_ +#define _FIXED_PKT_QUEUE_H_ + + +#include "osi/pkt_queue.h" +#include "osi/semaphore.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef FIXED_PKT_QUEUE_SIZE_MAX +#define FIXED_PKT_QUEUE_SIZE_MAX 254 +#endif + +#define FIXED_PKT_QUEUE_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT + +struct fixed_pkt_queue_t; + +typedef struct fixed_pkt_queue_t fixed_pkt_queue_t; + +typedef void (*fixed_pkt_queue_free_cb)(pkt_linked_item_t *data); +typedef void (*fixed_pkt_queue_cb)(fixed_pkt_queue_t *queue); + +// Creates a new fixed queue with the given |capacity|. If more elements than +// |capacity| are added to the queue, the caller is blocked until space is +// made available in the queue. Returns NULL on failure. The caller must free +// the returned queue with |fixed_pkt_queue_free|. +fixed_pkt_queue_t *fixed_pkt_queue_new(size_t capacity); + +// Freeing a queue that is currently in use (i.e. has waiters +// blocked on it) results in undefined behaviour. +void fixed_pkt_queue_free(fixed_pkt_queue_t *queue, fixed_pkt_queue_free_cb free_cb); + +// Returns a value indicating whether the given |queue| is empty. If |queue| +// is NULL, the return value is true. +bool fixed_pkt_queue_is_empty(fixed_pkt_queue_t *queue); + +// Returns the length of the |queue|. If |queue| is NULL, the return value +// is 0. +size_t fixed_pkt_queue_length(fixed_pkt_queue_t *queue); + +// Returns the maximum number of elements this queue may hold. |queue| may +// not be NULL. +size_t fixed_pkt_queue_capacity(fixed_pkt_queue_t *queue); + +// Enqueues the given |data| into the |queue|. The caller will be blocked or immediately return or wait for timeout according to the parameter timeout. +// If enqueue failed, it will return false, otherwise return true +bool fixed_pkt_queue_enqueue(fixed_pkt_queue_t *queue, pkt_linked_item_t *linked_pkt, uint32_t timeout); + +// Dequeues the next element from |queue|. If the queue is currently empty, +// this function will block the caller until an item is enqueued or immediately return or wait for timeout according to the parameter timeout. +// If dequeue failed, it will return NULL, otherwise return a point. +pkt_linked_item_t *fixed_pkt_queue_dequeue(fixed_pkt_queue_t *queue, uint32_t timeout); + +// Returns the first element from |queue|, if present, without dequeuing it. +// This function will never block the caller. Returns NULL if there are no +// elements in the queue or |queue| is NULL. +pkt_linked_item_t *fixed_pkt_queue_try_peek_first(fixed_pkt_queue_t *queue); + +// Registers |queue| with |reactor| for dequeue operations. When there is an element +// in the queue, ready_cb will be called. The |context| parameter is passed, untouched, +// to the callback routine. Neither |queue|, nor |reactor|, nor |read_cb| may be NULL. +// |context| may be NULL. +void fixed_pkt_queue_register_dequeue(fixed_pkt_queue_t *queue, fixed_pkt_queue_cb ready_cb); + +// Unregisters the dequeue ready callback for |queue| from whichever reactor +// it is registered with, if any. This function is idempotent. +void fixed_pkt_queue_unregister_dequeue(fixed_pkt_queue_t *queue); + +void fixed_pkt_queue_process(fixed_pkt_queue_t *queue); + +#endif diff --git a/tools/sdk/esp32c3/include/bt/common/osi/include/osi/pkt_queue.h b/tools/sdk/esp32c3/include/bt/common/osi/include/osi/pkt_queue.h new file mode 100644 index 00000000000..96277c3e182 --- /dev/null +++ b/tools/sdk/esp32c3/include/bt/common/osi/include/osi/pkt_queue.h @@ -0,0 +1,88 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _PKT_LIST_H_ +#define _PKT_LIST_H_ + +#include "sys/queue.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct pkt_queue; + +typedef struct pkt_linked_item { + STAILQ_ENTRY(pkt_linked_item) next; + uint8_t data[]; +} pkt_linked_item_t; + +#define BT_PKT_LINKED_HDR_SIZE (sizeof (pkt_linked_item_t)) + +typedef void (*pkt_queue_free_cb)(pkt_linked_item_t *item); + +/* + * brief: create a pkt_queue instance. pkt_queue is a wrapper class of a FIFO implemented by single linked list. + * The enqueue and dequeue operations of the FIFO are protected against race conditions of multiple tasks + * return: NULL if not enough memory, otherwise a valid pointer + */ +struct pkt_queue *pkt_queue_create(void); + +/* + * brief: enqueue one item to the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * param item: the item to be enqueued to the FIFO + * return: true if enqueued successfully, false when the arguments passed in are invalid + */ +bool pkt_queue_enqueue(struct pkt_queue *queue, pkt_linked_item_t *item); + +/* + * brief: dequeue one item for the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * return: pointer of type pkt_linked_item_t dequeued, NULL if the queue is empty or upon exception + */ +pkt_linked_item_t *pkt_queue_dequeue(struct pkt_queue *queue); + +/* + * brief: get the pointer of the first item from the FIFO but not get it dequeued + * param queue: pkt_queue instance created using pkt_queue_create + * return: pointer of the first item in the FIFO, NULL if the FIFO is empty + */ +pkt_linked_item_t *pkt_queue_try_peek_first(struct pkt_queue *queue); + +/* + * brief: retrieve the number of items existing in the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * return: total number of items in the FIFO + */ +size_t pkt_queue_length(const struct pkt_queue *queue); + +/* + * brief: retrieve the status whether the FIFO is empty + * param queue: pkt_queue instance created using pkt_queue_create + * return: false if the FIFO is not empty, otherwise true + */ +bool pkt_queue_is_empty(const struct pkt_queue *queue); + +/* + * brief: delete the item in the FIFO one by one + * param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default + */ +void pkt_queue_flush(struct pkt_queue *queue, pkt_queue_free_cb free_cb); + +/* + * brief: delete the items in the FIFO and then destroy the pkt_queue instance. + * param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default + */ +void pkt_queue_destroy(struct pkt_queue *queue, pkt_queue_free_cb free_cb); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tools/sdk/esp32c3/include/bt/common/osi/include/osi/thread.h b/tools/sdk/esp32c3/include/bt/common/osi/include/osi/thread.h index fdabed1cf68..c9be3375ddc 100644 --- a/tools/sdk/esp32c3/include/bt/common/osi/include/osi/thread.h +++ b/tools/sdk/esp32c3/include/bt/common/osi/include/osi/thread.h @@ -28,6 +28,7 @@ #define OSI_THREAD_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT struct osi_thread; +struct osi_event; typedef struct osi_thread osi_thread_t; @@ -48,7 +49,7 @@ typedef enum { * param work_queue_num: speicify queue number, the queue[0] has highest priority, and the priority is decrease by index * return : if create successfully, return thread handler; otherwise return NULL. */ -osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num); +osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num, const size_t work_queue_len[]); /* * brief: Destroy a thread or task @@ -88,4 +89,42 @@ const char *osi_thread_name(osi_thread_t *thread); */ int osi_thread_queue_wait_size(osi_thread_t *thread, int wq_idx); +/* + * brief: Create an osi_event struct and register the handler function and its argument + * An osi_event is a kind of work that can be posted to the workqueue of osi_thread to process, + * but the work can have at most one instance the thread workqueue before it is processed. This + * allows the "single post, multiple data processing" jobs. + * param func: the handler to process the job + * param context: the argument to be passed to the handler function when the job is being processed + * return: NULL if no memory, otherwise a valid struct pointer + */ +struct osi_event *osi_event_create(osi_thread_func_t func, void *context); + +/* + * brief: Bind an osi_event to a specific work queue for an osi_thread. + * After binding is completed, a function call of API osi_thread_post_event will send a work + * to the workqueue of the thread, with specified queue index. + * param func: event: the pointer to osi_event that is created using osi_event_create + * param thread: the pointer to osi_thread that is created using osi_thread_create + * param queue_idx: the index of the workqueue of the specified osi_thread, with range starting from 0 to work_queue_num - 1 + * return: true if osi_event binds to the thread's workqueue successfully, otherwise false + */ +bool osi_event_bind(struct osi_event* event, osi_thread_t *thread, int queue_idx); + +/* + * brief: Destroy the osi_event struct created by osi_event_create and free the allocated memory + * param event: the pointer to osi_event + */ +void osi_event_delete(struct osi_event* event); + +/* + * brief: try sending a work to the binded thread's workqueue, so that it can be handled by the worker thread + * param event: pointer to osi_event, created by osi_event_create + * param timeout: post timeout, OSI_THREAD_MAX_TIMEOUT means blocking forever, 0 means never blocking, others means block millisecond + * return: true if the message is enqueued to the thread workqueue, otherwise failed + * note: if the return value of function is false, it is the case that the workqueue of the thread is full, and users + * are expected to post the event sometime later to get the work handled. + */ +bool osi_thread_post_event(struct osi_event *event, uint32_t timeout); + #endif /* __THREAD_H__ */ diff --git a/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/mesh.h b/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/mesh.h index 33155aa555c..cb6efd0dc03 100644 --- a/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/mesh.h +++ b/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/mesh.h @@ -20,7 +20,7 @@ extern "C" { #define BLE_MESH_KEY_ANY 0xffff #define BLE_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000) -#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) <= 0xff00) +#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00) #define BLE_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000) #define BLE_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfffb) diff --git a/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/net.h b/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/net.h index 8a1b9b343a3..f982c41cee4 100644 --- a/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/net.h +++ b/tools/sdk/esp32c3/include/bt/esp_ble_mesh/mesh_core/net.h @@ -95,7 +95,6 @@ struct bt_mesh_friend { uint8_t fsn:1, send_last:1, pending_req:1, - sec_update:1, pending_buf:1, valid:1, established:1; diff --git a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h index f81ad21800e..0f0a1935d31 100644 --- a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h +++ b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h @@ -25,8 +25,8 @@ extern "C" { #endif -/**@{ - * BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag +/** + * @brief BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag */ #define ESP_BLE_ADV_FLAG_LIMIT_DISC (0x01 << 0) #define ESP_BLE_ADV_FLAG_GEN_DISC (0x01 << 1) @@ -34,104 +34,102 @@ extern "C" { #define ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT (0x01 << 3) #define ESP_BLE_ADV_FLAG_DMT_HOST_SPT (0x01 << 4) #define ESP_BLE_ADV_FLAG_NON_LIMIT_DISC (0x00 ) -/** - * @} - */ -/* relate to BTM_LE_KEY_xxx in stack/btm_api.h */ -#define ESP_LE_KEY_NONE 0 /* relate to BTM_LE_KEY_NONE in stack/btm_api.h */ -#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ /* relate to BTM_LE_KEY_PENC in stack/btm_api.h */ -#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ /* relate to BTM_LE_KEY_PID in stack/btm_api.h */ -#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ /* relate to BTM_LE_KEY_PCSRK in stack/btm_api.h */ -#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ /* relate to BTM_LE_KEY_PLK in stack/btm_api.h */ -#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /* relate to BTM_LE_KEY_LLK in stack/btm_api.h */ -#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ /* relate to BTM_LE_KEY_LENC in stack/btm_api.h */ -#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ /* relate to BTM_LE_KEY_LID in stack/btm_api.h */ -#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ /* relate to BTM_LE_KEY_LCSRK in stack/btm_api.h */ + +/// relate to BTM_LE_KEY_xxx in stack/btm_api.h +#define ESP_LE_KEY_NONE 0 /*!< No encryption key */ +#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ +#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ +#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ +#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ +#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /*!< peer link key*/ +#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ +#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ +#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ typedef uint8_t esp_ble_key_type_t; -/* relate to BTM_LE_AUTH_xxx in stack/btm_api.h */ -#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)/*!< 0101*/ -#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM_BOND in stack/btm_api.h */ +/// relate to BTM_LE_AUTH_xxx in stack/btm_api.h +#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0 no bondingv*/ +#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 device in the bonding with peer */ +#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 man in the middle attack */ +#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM) /*!< 0101 banding with man in the middle attack */ +#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 secure connection */ +#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 secure connection with band*/ +#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 secure conn with MITM */ +#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 SC with MITM and Bonding*/ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit pattern */ -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 - -#define ESP_BLE_OOB_DISABLE 0 -#define ESP_BLE_OOB_ENABLE 1 - -/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */ -#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */ -#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */ -#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */ -#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */ -#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in stack/btm_api.h */ - -#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /* relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /* relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /* relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /* relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /* relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /* relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /* relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /* relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /* relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /* relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /* relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /* relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /* relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /* relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /* relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /* relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /* relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /* relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /* relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /* relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /* relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /* relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /* relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /* relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /* relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /* relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /* relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /* relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /* relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /* relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /* relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /* relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /* relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /* relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /* relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /* relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /* relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /* relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ +#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 /*!< authentication disable*/ +#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 /*!< authentication enable*/ + +#define ESP_BLE_OOB_DISABLE 0 /*!< disbale the out of bond*/ +#define ESP_BLE_OOB_ENABLE 1 /*!< enable the out of bond*/ + +/// relate to BTM_IO_CAP_xxx in stack/btm_api.h +#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ +#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ +#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ +#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ +#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ + +#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /*!< relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /*!< relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /*!< relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /*!< relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /*!< relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /*!< relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /*!< relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /*!< relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /*!< relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /*!< relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /*!< relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /*!< relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /*!< relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */ @@ -147,15 +145,15 @@ typedef enum { ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */ ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */ #endif // #if (BLE_42_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */ - ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */ - ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */ - ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /* passkey notification event */ - ESP_GAP_BLE_PASSKEY_REQ_EVT, /* passkey request event */ - ESP_GAP_BLE_OOB_REQ_EVT, /* OOB request event */ - ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */ - ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */ - ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */ + ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */ + ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */ + ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */ + ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /*!< passkey notification event */ + ESP_GAP_BLE_PASSKEY_REQ_EVT, /*!< passkey request event */ + ESP_GAP_BLE_OOB_REQ_EVT, /*!< OOB request event */ + ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */ + ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */ + ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */ #if (BLE_42_FEATURE_SUPPORT == TRUE) ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */ ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */ @@ -174,45 +172,45 @@ typedef enum { #endif //#if (BLE_42_FEATURE_SUPPORT == TRUE) ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */ #if (BLE_50_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, - ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, - ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, - ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, - ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, - ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_REPORT_EVT, - ESP_GAP_BLE_SCAN_TIMEOUT_EVT, - ESP_GAP_BLE_ADV_TERMINATED_EVT, - ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, - ESP_GAP_BLE_CHANNEL_SELETE_ALGORITHM_EVT, - ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, + ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */ + ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */ + ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */ + ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, /*!< when extended set random address complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when extended advertising parameter complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, /*!< when extended advertising data complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< when extended scan response data complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, /*!< when extended advertising start complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, /*!< when extended advertising stop complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, /*!< when extended advertising set remove complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, /*!< when extended advertising set clear complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when periodic advertising parameter complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, /*!< when periodic advertising data complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, /*!< when periodic advertising start complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, /*!< when periodic advertising stop complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, /*!< when periodic advertising create sync complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, /*!< when extended advertising sync cancel complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, /*!< when extended advertising sync terminate complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, /*!< when extended advertising add device complete , the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, /*!< when extended advertising remove device complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, /*!< when extended advertising clear device, the event comes */ + ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, /*!< when extended scan parameter complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, /*!< when extended scan start complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, /*!< when extended scan stop complete, the event comes */ + ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, /*!< when extended prefer connection parameter set complete, the event comes */ + ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, /*!< when ble phy update complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_REPORT_EVT, /*!< when extended advertising report complete, the event comes */ + ESP_GAP_BLE_SCAN_TIMEOUT_EVT, /*!< when scan timeout complete, the event comes */ + ESP_GAP_BLE_ADV_TERMINATED_EVT, /*!< when advertising terminate data complete, the event comes */ + ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, /*!< when scan req received complete, the event comes */ + ESP_GAP_BLE_CHANNEL_SELETE_ALGORITHM_EVT, /*!< when channel select algorithm complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */ #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_EVT_MAX, + ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */ } esp_gap_ble_cb_event_t; -#define ESP_GAP_BLE_CHANNELS_LEN 5 +#define ESP_GAP_BLE_CHANNELS_LEN 5 /*!< channel length*/ typedef uint8_t esp_gap_ble_channels[ESP_GAP_BLE_CHANNELS_LEN]; /// This is the old name, just for backwards compatibility @@ -296,46 +294,47 @@ typedef enum { /* relate to BTA_DM_BLE_SEC_xxx in bta/bta_api.h */ typedef enum { - ESP_BLE_SEC_ENCRYPT = 1, /* relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already - bonded, the stack will used LTK to encrypt with the remote device directly. + ESP_BLE_SEC_ENCRYPT = 1, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already + bonded, the stack will used Long Term Key (LTK) to encrypt with the remote device directly. Else if the device hasn't bonded, the stack will used the default authentication request used the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_NO_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used NO MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ + ESP_BLE_SEC_ENCRYPT_NO_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has been already + bonded, the stack will check the LTK (Long Term Key) Whether the authentication request has been met, and if met, use the LTK + to encrypt with the remote device directly, else re-pair with the remote device. + Else if the device hasn't been bonded, the stack will use NO MITM authentication request in the current link instead of + using the authreq in the esp_ble_gap_set_security_param function set by the user. */ + ESP_BLE_SEC_ENCRYPT_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has been already + bonded, the stack will check the LTK (Long Term Key) whether the authentication request has been met, and if met, use the LTK + to encrypt with the remote device directly, else re-pair with the remote device. + Else if the device hasn't been bonded, the stack will use MITM authentication request in the current link instead of + using the authreq in the esp_ble_gap_set_security_param function set by the user. */ }esp_ble_sec_act_t; typedef enum { ESP_BLE_SM_PASSKEY = 0, - /* Authentication requirements of local device */ + /*!< Authentication requirements of local device */ ESP_BLE_SM_AUTHEN_REQ_MODE, - /* The IO capability of local device */ + /*!< The IO capability of local device */ ESP_BLE_SM_IOCAP_MODE, - /* Initiator Key Distribution/Generation */ + /*!< Initiator Key Distribution/Generation */ ESP_BLE_SM_SET_INIT_KEY, - /* Responder Key Distribution/Generation */ + /*!< Responder Key Distribution/Generation */ ESP_BLE_SM_SET_RSP_KEY, - /* Maximum Encryption key size to support */ + /*!< Maximum Encryption key size to support */ ESP_BLE_SM_MAX_KEY_SIZE, - /* Minimum Encryption key size requirement from Peer */ + /*!< Minimum Encryption key size requirement from Peer */ ESP_BLE_SM_MIN_KEY_SIZE, - /* Set static Passkey */ + /*!< Set static Passkey */ ESP_BLE_SM_SET_STATIC_PASSKEY, - /* Reset static Passkey */ + /*!< Reset static Passkey */ ESP_BLE_SM_CLEAR_STATIC_PASSKEY, - /* Accept only specified SMP Authentication requirement */ + /*!< Accept only specified SMP Authentication requirement */ ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH, - /* Enable/Disable OOB support */ + /*!< Enable/Disable OOB support */ ESP_BLE_SM_OOB_SUPPORT, - /* Appl encryption key size */ + /*!< Appl encryption key size */ ESP_BLE_APP_ENC_KEY_SIZE, + /*!< authentication max param */ ESP_BLE_SM_MAX_PARAM, } esp_ble_sm_param_t; @@ -681,90 +680,97 @@ typedef uint8_t esp_duplicate_info_t[ESP_BD_ADDR_LEN]; #endif //#if (BLE_42_FEATURE_SUPPORT == TRUE) #if (BLE_50_FEATURE_SUPPORT == TRUE) -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) // Non-Connectable and Non-Scannable Undirected advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) // Connectable advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) // Scannable advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) // Directed advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) // High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertis- ing Interval) -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) // Use legacy advertising PDUs -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) // Omit advertiser's address from all PDUs ("anonymous advertising") -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) // Include TxPower in the extended header of the advertising PDU -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) // Reserved for future use - -/* If extended advertising PDU types are being used (bit 4 = 0) then: +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) /*!< Non-Connectable and Non-Scannable Undirected advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) /*!< Connectable advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) /*!< Scannable advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) /*!< Directed advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) /*!< High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval) */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) /*!< Use legacy advertising PDUs */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) /*!< Omit advertiser's address from all PDUs ("anonymous advertising") */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) /*!< Include TxPower in the extended header of the advertising PDU */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) /*!< Reserved for future use */ + +/*!< If extended advertising PDU types are being used (bit 4 = 0) then: The advertisement shall not be both connectable and scannable. High duty cycle directed connectable advertising (<= 3.75 ms advertising interval) shall not be used (bit 3 = 0) */ -// ADV_IND +/*!< ADV_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) -// ADV_DIRECT_IND (low duty cycle) +/*!< ADV_DIRECT_IND (low duty cycle) */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_LD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED) -// ADV_DIRECT_IND (high duty cycle) +/*!< ADV_DIRECT_IND (high duty cycle) */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_HD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED) -// ADV_SCAN_IND +/*!< ADV_SCAN_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_SCAN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) -// ADV_NONCONN_IND +/*!< ADV_NONCONN_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_NONCONN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY) typedef uint16_t esp_ble_ext_adv_type_mask_t; -#define ESP_BLE_GAP_PHY_1M 1 -#define ESP_BLE_GAP_PHY_2M 2 -#define ESP_BLE_GAP_PHY_CODED 3 +#define ESP_BLE_GAP_PHY_1M 1 /*!< Secondery Advertisement PHY is LE1M */ +#define ESP_BLE_GAP_PHY_2M 2 /*!< Secondery Advertisement PHY is LE2M */ +#define ESP_BLE_GAP_PHY_CODED 3 /*!< Secondery Advertisement PHY is LE Coded */ typedef uint8_t esp_ble_gap_phy_t; -#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) -#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) +#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) /*!< No Prefer TX PHY supported by controller */ +#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) /*!< No Prefer RX PHY supported by controller */ typedef uint8_t esp_ble_gap_all_phys_t; -// Primary phy only support 1M and LE coded phy -#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M -#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED +/// Primary phy only support 1M and LE coded phy +#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M /*!< Primary Phy is LE1M */ +#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED /*!< Primary Phy is LE CODED */ typedef uint8_t esp_ble_gap_pri_phy_t; // primary phy -#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) -#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) -#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) +#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or reciever PHY */ +#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or reciever PHY */ +#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or reciever PHY */ typedef uint8_t esp_ble_gap_phy_mask_t; -#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 // The Host has no preferred coding when transmitting on the LE Coded PHY -#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 // The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY -#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 // The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY +#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 /*!< The Host has no preferred coding when transmitting on the LE Coded PHY */ +#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 /*!< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY */ +#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 /*!< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY */ typedef uint16_t esp_ble_gap_prefer_phy_options_t; -#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 -#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 +#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 /*!< Scan Advertisements on the LE1M PHY */ +#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 /*!< Scan advertisements on the LE coded PHY */ typedef uint8_t esp_ble_ext_scan_cfg_mask_t; -#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 -#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 -#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 +/// Advertising data +#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 /*!< extended advertising data compete */ +#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 /*!< extended advertising data incomplete */ +#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 /*!< extended advertising data truncated mode */ typedef uint8_t esp_ble_gap_ext_adv_data_status_t; -#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 -#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 +/// Advertising SYNC policy +#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 /*!< sync policy by advertising info */ +#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 /*!< periodic advertising sync policy */ typedef uint8_t esp_ble_gap_sync_t; -/* Advertising report */ -#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) -#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) -#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) -#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) -/* Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */ -#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) -#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) -#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) +/// Advertising report +#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) /*!< advertising report with extended advertising indication type */ +#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) /*!< advertising report with extended scan indication type */ +#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) /*!< advertising report with extended direct advertising indication type */ +#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) /*!< advertising report with extended scan response indication type */ + +/*!< Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */ +#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) /*!< advertising report with legacy advertising indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) /*!< advertising report with legacy direct indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) /*!< advertising report with legacy scan indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) /*!< advertising report with legacy non connectable indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) /*!< advertising report with legacy scan response indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) /*!< advertising report with legacy advertising with scan response indication type */ + typedef uint8_t esp_ble_gap_adv_type_t; +/// Extend advertising tx power, range: [-127, +126] dBm +#define EXT_ADV_TX_PWR_NO_PREFERENCE (127) /*!< host has no preference for tx power */ + /** * @brief ext adv parameters */ @@ -1762,8 +1768,8 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis * SMP in response to ESP_GAP_BLE_OOB_REQ_EVT * * @param[in] bd_addr: BD address of the peer device. -* @param[in] TK: TK value, the TK value shall be a 128-bit random number -* @param[in] len: length of tk, should always be 128-bit +* @param[in] TK: Temporary Key value, the TK value shall be a 128-bit random number +* @param[in] len: length of temporary key, should always be 128-bit * * @return - ESP_OK : success * - other : failed diff --git a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h index de90ff8efc6..c9278fbed29 100644 --- a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h +++ b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h @@ -256,7 +256,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); +typedef void (*esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); /** * @brief This function is called to init callbacks with HID device module. diff --git a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h index 07abdece2d0..cf4a5a8f1e3 100644 --- a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h +++ b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h @@ -287,7 +287,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); +typedef void (*esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); /** * @brief This function is called to init callbacks with HID host module. diff --git a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h index 9df1e58a717..be827649745 100644 --- a/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h +++ b/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h @@ -205,7 +205,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); +typedef void (*esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); /** * @brief This function is called to init callbacks with SPP module. diff --git a/tools/sdk/esp32c3/include/bt/include/esp32c3/include/esp_bt.h b/tools/sdk/esp32c3/include/bt/include/esp32c3/include/esp_bt.h index 2ec3064d6eb..2fd4c24885f 100644 --- a/tools/sdk/esp32c3/include/bt/include/esp32c3/include/esp_bt.h +++ b/tools/sdk/esp32c3/include/bt/include/esp32c3/include/esp_bt.h @@ -181,7 +181,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .hw_recorrect_en = AGC_RECORRECT_EN, \ .cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \ -}; +} #else #define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h"); @@ -290,22 +290,22 @@ typedef enum { * @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm). */ typedef enum { - ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */ - ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */ - ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */ - ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */ - ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */ - ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */ - ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */ - ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */ - ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */ - ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */ - ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */ - ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */ - ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */ - ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */ - ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */ - ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */ + ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */ + ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */ + ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */ + ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */ + ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */ + ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */ + ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */ + ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */ + ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */ + ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */ + ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */ + ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */ + ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */ + ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */ ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ } esp_power_level_t; diff --git a/tools/sdk/esp32c3/include/driver/include/driver/i2s.h b/tools/sdk/esp32c3/include/driver/include/driver/i2s.h index 389b631ba7e..d231ad396bb 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/i2s.h @@ -113,6 +113,7 @@ typedef struct { * We assume that the current 'dma_buf_len' is 100, then the real length of the DMA buffer is 8 * 100 = 800 bytes. * Note that the length of an internal real DMA buffer shouldn't be greater than 4092. */ + bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */ bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */ int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value. If fixed_mclk set, mclk_multiple won't take effect */ diff --git a/tools/sdk/esp32c3/include/esp-dl/include/dl_define.hpp b/tools/sdk/esp32c3/include/esp-dl/include/dl_define.hpp index 734c0b80a4a..3f285f39206 100644 --- a/tools/sdk/esp32c3/include/esp-dl/include/dl_define.hpp +++ b/tools/sdk/esp32c3/include/esp-dl/include/dl_define.hpp @@ -38,11 +38,6 @@ } #endif -#define DL_Q16_MIN (-32768) -#define DL_Q16_MAX (32767) -#define DL_Q8_MIN (-128) -#define DL_Q8_MAX (127) - #ifndef DL_MAX #define DL_MAX(x, y) (((x) < (y)) ? (y) : (x)) #endif @@ -60,13 +55,24 @@ #endif #ifndef DL_RIGHT_SHIFT -#define DL_RIGHT_SHIFT(x, shift) ((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift)) +#define DL_RIGHT_SHIFT(x, shift) (((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift))) #endif #ifndef DL_LEFT_SHIFT -#define DL_LEFT_SHIFT(x, shift) ((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift)) +#define DL_LEFT_SHIFT(x, shift) (((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift))) +#endif + +#ifndef DL_SCALE +#define DL_SCALE(exponent) (((exponent) > 0) ? (1 << (exponent)) : ((float)1.0 / (1 << -(exponent)))) #endif +#ifndef DL_RESCALE +#define DL_RESCALE(exponent) (((exponent) > 0) ? ((float)1.0 / (1 << (exponent))) : (1 << -(exponent))) +#endif + +#define QIQO 0 +#define QIFO 1 + namespace dl { typedef enum @@ -75,9 +81,6 @@ namespace dl ReLU, /**/ LeakyReLU, /**/ PReLU, /**/ - // TODO: Sigmoid, /**/ - // TODO: Softmax, /**/ - PADDING_SAME_BEGIN, /**/ + PADDING_SAME_BEGIN, /**/ PADDING_SAME_END, /**/ } padding_type_t; - + typedef enum { PADDING_EMPTY, PADDING_CONSTANT, - PADDING_EDGE, + PADDING_EDGE, PADDING_REFLECT, PADDING_SYMMETRIC, } padding_mode_t; diff --git a/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_sigmoid.hpp b/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_sigmoid.hpp new file mode 100644 index 00000000000..e8d147d78cd --- /dev/null +++ b/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_sigmoid.hpp @@ -0,0 +1,147 @@ +#pragma once + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Sigmoid(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Sigmoid : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Sigmoid object + * + * @param output_exponent exponent of output + * @param name name of Sigmoid + */ + Sigmoid(const int output_exponent, const char *name = "Sigmoid") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Sigmoid object + * + */ + ~Sigmoid() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Sigmoid result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Sigmoid operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Sigmoid result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + temp = temp / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "sigmoid"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_softmax.hpp b/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_softmax.hpp new file mode 100644 index 00000000000..9e845af00c8 --- /dev/null +++ b/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_softmax.hpp @@ -0,0 +1,175 @@ +#pragma once + +#include +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Softmax(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Softmax : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int loop; /**/ + int channel; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Softmax object + * + * @param output_exponent exponent of output + * @param name name of Softmax + * @param inplace true: the output will store to input + * false: the output will store to a separate memory + */ + Softmax(const int output_exponent, const char *name = "Softmax") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Softmax object + * + */ + ~Softmax() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->channel = input.shape[2]; + this->loop = input.get_size() / this->channel; + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Softmax result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Softmax operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Softmax result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + std::unique_ptr buf(new float[this->channel]); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->loop; i++) + { + I max_input = input_ptr[0]; + for (size_t j = 1; j < this->channel; j++) + max_input = DL_MAX(max_input, input_ptr[j]); + + float summary = 0.0; + for (size_t j = 0; j < this->channel; j++) + { + buf[j] = dl::math::exp_fast(((float)input_ptr[j] - max_input) * this->scale); + // buf[j] = exp(((float)input_ptr[j] - max_input) * this->scale); + summary += buf[j]; + } + + if constexpr (type == QIQO) + { + summary = this->rescale / summary; + for (size_t j = 0; j < this->channel; j++) + dl::tool::truncate(output_ptr[j], buf[j] * summary); + } + else if constexpr (type == QIFO) + { + summary = 1.0 / summary; + for (size_t j = 0; j < this->channel; j++) + output_ptr[j] = buf[j] * summary; + } + + input_ptr += this->channel; + output_ptr += this->channel; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "softmax"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_tanh.hpp b/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_tanh.hpp new file mode 100644 index 00000000000..12eae71e55e --- /dev/null +++ b/tools/sdk/esp32c3/include/esp-dl/include/layer/dl_layer_tanh.hpp @@ -0,0 +1,150 @@ +#pragma once + +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief TanH(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class TanH : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new TanH object + * + * @param output_exponent exponent of output + * @param name name of TanH + */ + TanH(const int output_exponent, const char *name = "TanH") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the TanH object + * + */ + ~TanH() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent + 1); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& TanH result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call TanH operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return TanH result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + // float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + float temp = exp((float)input_ptr[i] * this->scale); + temp = (temp - 1.0f) / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "tanh"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32c3/include/esp-dl/include/math/dl_math.hpp b/tools/sdk/esp32c3/include/esp-dl/include/math/dl_math.hpp index d3f2b94d3de..dfe89c89931 100644 --- a/tools/sdk/esp32c3/include/esp-dl/include/math/dl_math.hpp +++ b/tools/sdk/esp32c3/include/esp-dl/include/math/dl_math.hpp @@ -1,6 +1,7 @@ #pragma once #include "dl_define.hpp" +#include "dl_tool.hpp" namespace dl { @@ -8,7 +9,7 @@ namespace dl { /** * @brief x^a. - * + * * @param x as a base * @param a as an exponent * @return x^a @@ -31,7 +32,7 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ @@ -43,7 +44,7 @@ namespace dl /** * @brief 1/sqrt(x). - * + * * @param x as a base * @return 1/sqrt(x) */ @@ -61,15 +62,15 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ inline float sqrt_newton(float x) { /** - * Use Newton iteration method to find the square root - * */ + * Use Newton iteration method to find the square root + * */ if (x == 0.f) return 0.f; float result = x; @@ -84,7 +85,7 @@ namespace dl /** * @brief n-th root of x. - * + * * @param x as a base * @param n root times * @return n-th root of x @@ -112,7 +113,7 @@ namespace dl /** * @brief atan(x). - * + * * @param x as an input * @return atan(x) in range [-pi/2, pi/2] */ @@ -125,10 +126,10 @@ namespace dl // TODO:@yuanjiong /** - * @brief - * + * @brief + * * @param x - * @param y + * @param y * @return in range [-pi, pi] */ inline float atan2(float x, float y) @@ -150,7 +151,7 @@ namespace dl /** * @brief acos(x). - * + * * @param x as an input * @return acos(x) in range [-pi/2, pi/2] */ @@ -161,7 +162,7 @@ namespace dl /** * @brief asin(x). - * + * * @param x as an input * @return asin(x) in range [0, pi] */ @@ -172,12 +173,12 @@ namespace dl /** * @brief e^x - * + * * @param x exponent * @param steps iteration steps * @return e^x */ - inline float exp_fast(double x, int steps) + inline float exp_fast(float x, int steps = 8) { x = 1.0 + x / (1 << steps); for (int i = 0; i < steps; i++) diff --git a/tools/sdk/esp32c3/include/esp-dl/include/tool/dl_tool.hpp b/tools/sdk/esp32c3/include/esp-dl/include/tool/dl_tool.hpp index e5490e073d1..6566e535b85 100644 --- a/tools/sdk/esp32c3/include/esp-dl/include/tool/dl_tool.hpp +++ b/tools/sdk/esp32c3/include/esp-dl/include/tool/dl_tool.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "esp_system.h" @@ -26,7 +27,7 @@ namespace dl { /** * @brief Set memory zero. - * + * * @param ptr pointer of memory * @param n byte number */ @@ -34,8 +35,8 @@ namespace dl /** * @brief Set array value. - * - * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction + * + * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction * @param ptr pointer of array * @param value value to set * @param len length of array @@ -59,7 +60,7 @@ namespace dl /** * @brief Copy memory. - * + * * @param dst pointer of destination * @param src pointer of source * @param n byte number @@ -68,7 +69,7 @@ namespace dl /** * @brief Apply memory without initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -76,7 +77,7 @@ namespace dl */ inline void *malloc_aligned(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); @@ -99,7 +100,7 @@ namespace dl /** * @brief Apply memory with zero-initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -116,7 +117,7 @@ namespace dl /** * @brief Free the calloc_aligned() and malloc_aligned() memory - * + * * @param address pointer of memory to free */ inline void free_aligned(void *address) @@ -129,7 +130,7 @@ namespace dl /** * @brief Apply memory without initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -137,14 +138,16 @@ namespace dl */ inline void *malloc_aligned_prefer(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); - if (NULL == res){ + if (NULL == res) + { res = heap_caps_malloc(total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); } #if DL_SPIRAM_SUPPORT - if (NULL == res){ + if (NULL == res) + { res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_SPIRAM); } #endif @@ -163,7 +166,7 @@ namespace dl /** * @brief Apply memory with zero-initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -179,7 +182,7 @@ namespace dl /** * @brief Free the calloc_aligned_prefer() and malloc_aligned_prefer() memory - * + * * @param address pointer of memory to free */ inline void free_aligned_prefer(void *address) @@ -192,7 +195,7 @@ namespace dl /** * @brief Truncate the input into int8_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -200,17 +203,12 @@ namespace dl template void truncate(int8_t &output, T input) { - if (input >= DL_Q8_MAX) - output = DL_Q8_MAX; - else if (input <= DL_Q8_MIN) - output = DL_Q8_MIN; - else - output = input; + output = DL_CLIP(input, INT8_MIN, INT8_MAX); } /** * @brief Truncate the input into int16_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -218,17 +216,24 @@ namespace dl template void truncate(int16_t &output, T input) { - if (input >= DL_Q16_MAX) - output = DL_Q16_MAX; - else if (input <= DL_Q16_MIN) - output = DL_Q16_MIN; - else - output = input; + output = DL_CLIP(input, INT16_MIN, INT16_MAX); + } + + template + void truncate(int32_t &output, T input) + { + output = DL_CLIP(input, INT32_MIN, INT32_MAX); + } + + template + void truncate(int64_t &output, T input) + { + output = DL_CLIP(input, INT64_MIN, INT64_MAX); } /** * @brief Calculate the exponent of quantizing 1/n into max_value range. - * + * * @param n 1/n: value to be quantized * @param max_value the max_range */ @@ -248,7 +253,7 @@ namespace dl /** * @brief Print vector in format "[x1, x2, ...]\n". - * + * * @param array to print */ inline void print_vector(std::vector &array, const char *message = NULL) @@ -266,7 +271,7 @@ namespace dl /** * @brief Get the cycle object - * + * * @return cycle count */ inline uint32_t get_cycle() @@ -293,8 +298,8 @@ namespace dl public: /** * @brief Construct a new Latency object. - * - * @param size + * + * @param size */ Latency(const uint32_t size = 1) : size(size), period(0), @@ -307,7 +312,7 @@ namespace dl /** * @brief Destroy the Latency object. - * + * */ ~Latency() { @@ -317,7 +322,7 @@ namespace dl /** * @brief Record the start timestamp. - * + * */ void start() { @@ -330,7 +335,7 @@ namespace dl /** * @brief Record the period. - * + * */ void end() { @@ -355,7 +360,7 @@ namespace dl /** * @brief Return the period. - * + * * @return this->timestamp_end - this->timestamp */ uint32_t get_period() @@ -365,8 +370,8 @@ namespace dl /** * @brief Get the average period. - * - * @return average latency + * + * @return average latency */ uint32_t get_average_period() { @@ -375,7 +380,7 @@ namespace dl /** * @brief Clear the period - * + * */ void clear_period() { @@ -396,7 +401,7 @@ namespace dl /** * @brief Print in format "{message}: {this->period} {unit}\n". - * + * * @param message message of print */ void print(const char *message) @@ -410,7 +415,7 @@ namespace dl /** * @brief Print in format "{prefix}::{key}: {this->period} {unit}\n". - * + * * @param prefix prefix of print * @param key key of print */ diff --git a/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/dsp_types.h b/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/dsp_types.h index 1f11ea4520b..807608477a9 100644 --- a/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/dsp_types.h +++ b/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/dsp_types.h @@ -2,6 +2,7 @@ #define _dsp_types_H_ #include #include +#include // union to simplify access to the 16 bit data typedef union sc16_u diff --git a/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/esp_dsp.h b/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/esp_dsp.h index 419ed299965..9ce979e9955 100644 --- a/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/esp_dsp.h +++ b/tools/sdk/esp32c3/include/esp-dsp/modules/common/include/esp_dsp.h @@ -22,6 +22,7 @@ extern "C" // Common includes #include "dsp_common.h" +#include "dsp_types.h" // Signal processing #include "dsps_dotprod.h" diff --git a/tools/sdk/esp32c3/include/esp32-camera/driver/include/esp_camera.h b/tools/sdk/esp32c3/include/esp32-camera/driver/include/esp_camera.h index 2025bb403a9..ee84b307baf 100755 --- a/tools/sdk/esp32c3/include/esp32-camera/driver/include/esp_camera.h +++ b/tools/sdk/esp32c3/include/esp32-camera/driver/include/esp_camera.h @@ -18,8 +18,8 @@ .pin_pwdn = PIN_PWDN, .pin_reset = PIN_RESET, .pin_xclk = PIN_XCLK, - .pin_sscb_sda = PIN_SIOD, - .pin_sscb_scl = PIN_SIOC, + .pin_sccb_sda = PIN_SIOD, + .pin_sccb_scl = PIN_SIOC, .pin_d7 = PIN_D7, .pin_d6 = PIN_D6, .pin_d5 = PIN_D5, @@ -112,8 +112,14 @@ typedef struct { int pin_pwdn; /*!< GPIO pin for camera power down line */ int pin_reset; /*!< GPIO pin for camera reset line */ int pin_xclk; /*!< GPIO pin for camera XCLK line */ - int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ - int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ + union { + int pin_sccb_sda; /*!< GPIO pin for camera SDA line */ + int pin_sscb_sda __attribute__((deprecated("please use pin_sccb_sda instead"))); /*!< GPIO pin for camera SDA line (legacy name) */ + }; + union { + int pin_sccb_scl; /*!< GPIO pin for camera SCL line */ + int pin_sscb_scl __attribute__((deprecated("please use pin_sccb_scl instead"))); /*!< GPIO pin for camera SCL line (legacy name) */ + }; int pin_d7; /*!< GPIO pin for camera D7 line */ int pin_d6; /*!< GPIO pin for camera D6 line */ int pin_d5; /*!< GPIO pin for camera D5 line */ @@ -141,6 +147,8 @@ typedef struct { #if CONFIG_CAMERA_CONVERTER_ENABLED camera_conv_mode_t conv_mode; /*!< RGB<->YUV Conversion mode */ #endif + + int sccb_i2c_port; /*!< If pin_sccb_sda is -1, use the already configured I2C bus by number */ } camera_config_t; /** diff --git a/tools/sdk/esp32c3/include/esp32-camera/driver/include/sensor.h b/tools/sdk/esp32c3/include/esp32-camera/driver/include/sensor.h index d5ec7463fd3..6ab12a21aa5 100755 --- a/tools/sdk/esp32c3/include/esp32-camera/driver/include/sensor.h +++ b/tools/sdk/esp32c3/include/esp32-camera/driver/include/sensor.h @@ -30,6 +30,7 @@ typedef enum { BF20A6_PID = 0x20a6, SC101IOT_PID = 0xda4a, SC030IOT_PID = 0x9a46, + SC031GS_PID = 0x0031, } camera_pid_t; typedef enum { @@ -46,6 +47,7 @@ typedef enum { CAMERA_BF20A6, CAMERA_SC101IOT, CAMERA_SC030IOT, + CAMERA_SC031GS, CAMERA_MODEL_MAX, CAMERA_NONE, } camera_model_t; @@ -64,6 +66,7 @@ typedef enum { BF20A6_SCCB_ADDR = 0x6E, SC101IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 + SC031GS_SCCB_ADDR = 0x30, } camera_sccb_addr_t; typedef enum { @@ -209,7 +212,7 @@ typedef struct _sensor { // Sensor function pointers int (*init_status) (sensor_t *sensor); - int (*reset) (sensor_t *sensor); + int (*reset) (sensor_t *sensor); // Reset the configuration of the sensor, and return ESP_OK if reset is successful int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); int (*set_framesize) (sensor_t *sensor, framesize_t framesize); int (*set_contrast) (sensor_t *sensor, int level); diff --git a/tools/sdk/esp32c3/include/esp_common/include/esp_idf_version.h b/tools/sdk/esp32c3/include/esp_common/include/esp_idf_version.h index ef308895c9d..74dda44cbdc 100644 --- a/tools/sdk/esp32c3/include/esp_common/include/esp_idf_version.h +++ b/tools/sdk/esp32c3/include/esp_common/include/esp_idf_version.h @@ -23,7 +23,7 @@ extern "C" { /** Minor version number (x.X.x) */ #define ESP_IDF_VERSION_MINOR 4 /** Patch version number (x.x.X) */ -#define ESP_IDF_VERSION_PATCH 2 +#define ESP_IDF_VERSION_PATCH 3 /** * Macro to convert IDF version number into an integer diff --git a/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h index 1c8b78583ff..1f790b5ff86 100644 --- a/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h @@ -40,6 +40,8 @@ initializer that should be kept in sync .global_user_ctx_free_fn = NULL, \ .global_transport_ctx = NULL, \ .global_transport_ctx_free_fn = NULL, \ + .enable_so_linger = false, \ + .linger_timeout = 0, \ .open_fn = NULL, \ .close_fn = NULL, \ .uri_match_fn = NULL \ @@ -185,6 +187,9 @@ typedef struct httpd_config { */ httpd_free_ctx_fn_t global_transport_ctx_free_fn; + bool enable_so_linger; /*!< bool to enable/disable linger */ + int linger_timeout; /*!< linger timeout (in seconds) */ + /** * Custom session opening callback. * diff --git a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_clk.h b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_clk.h index 5a4666fdddf..8846f9272d9 100644 --- a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_clk.h +++ b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_clk.h @@ -82,6 +82,19 @@ int esp_clk_xtal_freq(void); */ uint64_t esp_clk_rtc_time(void); +/** + * @brief obtain internal critical section used esp_clk implementation. + * + * This is used by the esp_light_sleep_start() to avoid deadlocking when it + * calls esp_clk related API after stalling the other CPU. + */ +void esp_clk_private_lock(void); + +/** + * @brief counterpart of esp_clk_private_lock + */ +void esp_clk_private_unlock(void); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_sleep_internal.h b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_sleep_internal.h new file mode 100644 index 00000000000..ee0b72953f0 --- /dev/null +++ b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_private/esp_sleep_internal.h @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief Enables the use of ADC and temperature sensor in monitor (ULP) mode + * + * @note This state is kept in RTC memory and will keep its value after a deep sleep wakeup + * + */ +void esp_sleep_enable_adc_tsens_monitor(bool enable); + + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_sleep.h b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_sleep.h index 75d2f9726c3..8090fe85211 100644 --- a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_sleep.h +++ b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_sleep.h @@ -69,7 +69,7 @@ typedef enum { ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program - ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only) + ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3) ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only) ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only) ESP_SLEEP_WAKEUP_COCPU, //!< Wakeup caused by COCPU int diff --git a/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/rtc_clk_common.h b/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/rtc_clk_common.h index 07f8c1243c3..9f5f081be31 100644 --- a/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/rtc_clk_common.h +++ b/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/rtc_clk_common.h @@ -15,7 +15,10 @@ #define DPORT_SOC_CLK_SEL_PLL 1 #define DPORT_SOC_CLK_SEL_8M 2 -#define RTC_FAST_CLK_FREQ_8M 8500000 +// On esp32c3, RC_FAST_CLK has a freq of ~17.5MHz +#define SOC_CLK_RC_FAST_FREQ_APPROX 17500000 +// '8M' does not mean the actual freq, it only represents the clock source is RC_FAST_CLK. +#define RTC_FAST_CLK_FREQ_8M SOC_CLK_RC_FAST_FREQ_APPROX #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32c3/include/esp_ipc/include/esp_ipc_isr.h b/tools/sdk/esp32c3/include/esp_ipc/include/esp_ipc_isr.h index 22fa5b10b03..70290ba5618 100644 --- a/tools/sdk/esp32c3/include/esp_ipc/include/esp_ipc_isr.h +++ b/tools/sdk/esp32c3/include/esp_ipc/include/esp_ipc_isr.h @@ -62,6 +62,7 @@ void esp_ipc_isr_asm_call_blocking(esp_ipc_isr_func_t func, void* arg); * - If the stall feature is paused using esp_ipc_isr_stall_pause(), this function will have no effect * * @note This function is not available in single-core mode. + * @note It is the caller's responsibility to avoid deadlocking on spinlocks */ void esp_ipc_isr_stall_other_cpu(void); diff --git a/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_io.h b/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_io.h index 57f27ac96aa..2f2c613f1a8 100644 --- a/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_io.h +++ b/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_io.h @@ -47,7 +47,7 @@ esp_err_t esp_lcd_panel_io_rx_param(esp_lcd_panel_io_handle_t io, int lcd_cmd, v * this function will wait until they are finished and the queue is empty before sending the command(s). * * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()` - * @param[in] lcd_cmd The specific LCD command + * @param[in] lcd_cmd The specific LCD command (set to -1 if no command needed - only in SPI and I2C) * @param[in] param Buffer that holds the command specific parameters, set to NULL if no parameter is needed for the command * @param[in] param_size Size of `param` in memory, in bytes, set to zero if no parameter is needed for the command * @return diff --git a/tools/sdk/esp32c3/include/esp_littlefs/include/esp_littlefs.h b/tools/sdk/esp32c3/include/esp_littlefs/include/esp_littlefs.h index 07f35231291..6337f7b17b5 100644 --- a/tools/sdk/esp32c3/include/esp_littlefs/include/esp_littlefs.h +++ b/tools/sdk/esp32c3/include/esp_littlefs/include/esp_littlefs.h @@ -2,22 +2,16 @@ #define ESP_LITTLEFS_H__ #include "esp_err.h" -#include "littlefs/lfs.h" -#include "sdkconfig.h" +#include #ifdef __cplusplus extern "C" { #endif -/** - * @brief Last Modified Time - * - * Use 't' for LITTLEFS_ATTR_MTIME to match example: - * https://github.com/ARMmbed/littlefs/issues/23#issuecomment-482293539 - * And to match other external tools such as: - * https://github.com/earlephilhower/mklittlefs - */ -#define LITTLEFS_ATTR_MTIME ((uint8_t) 't') +#define ESP_LITTLEFS_VERSION_NUMBER "1.5.0" +#define ESP_LITTLEFS_VERSION_MAJOR 1 +#define ESP_LITTLEFS_VERSION_MINOR 5 +#define ESP_LITTLEFS_VERSION_PATCH 0 /** *Configuration structure for esp_vfs_littlefs_register. @@ -88,14 +82,6 @@ esp_err_t esp_littlefs_format(const char* partition_label); */ esp_err_t esp_littlefs_info(const char* partition_label, size_t *total_bytes, size_t *used_bytes); -#if CONFIG_LITTLEFS_HUMAN_READABLE -/** - * @brief converts an enumerated lfs error into a string. - * @param lfs_errno The enumerated littlefs error. - */ -const char * esp_littlefs_errno(enum lfs_error lfs_errno); -#endif - #ifdef __cplusplus } // extern "C" #endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/lfs_config.h b/tools/sdk/esp32c3/include/esp_littlefs/src/lfs_config.h deleted file mode 100644 index 809d2ccc517..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/lfs_config.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_CFG_H -#define LFS_CFG_H - -// System includes -#include -#include -#include -#include -#include "esp_heap_caps.h" - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return heap_caps_malloc(size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h b/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h deleted file mode 100644 index 1a9456c5196..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Block device emulated in a file - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_FILEBD_H -#define LFS_FILEBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_FILEBD_YES_TRACE -#define LFS_FILEBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_FILEBD_TRACE(...) -#endif - -// filebd config (optional) -struct lfs_filebd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; -}; - -// filebd state -typedef struct lfs_filebd { - int fd; - const struct lfs_filebd_config *cfg; -} lfs_filebd_t; - - -// Create a file block device using the geometry in lfs_config -int lfs_filebd_create(const struct lfs_config *cfg, const char *path); -int lfs_filebd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_filebd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_filebd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_filebd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h b/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h deleted file mode 100644 index 3a70bc6e134..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Block device emulated in RAM - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_RAMBD_H -#define LFS_RAMBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_RAMBD_YES_TRACE -#define LFS_RAMBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_RAMBD_TRACE(...) -#endif - -// rambd config (optional) -struct lfs_rambd_config { - // 8-bit erase value to simulate erasing with. -1 indicates no erase - // occurs, which is still a valid block device - int32_t erase_value; - - // Optional statically allocated buffer for the block device. - void *buffer; -}; - -// rambd state -typedef struct lfs_rambd { - uint8_t *buffer; - const struct lfs_rambd_config *cfg; -} lfs_rambd_t; - - -// Create a RAM block device using the geometry in lfs_config -int lfs_rambd_create(const struct lfs_config *cfg); -int lfs_rambd_createcfg(const struct lfs_config *cfg, - const struct lfs_rambd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_rambd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_rambd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h b/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h deleted file mode 100644 index 61679e5e026..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Testing block device, wraps filebd and rambd while providing a bunch - * of hooks for testing littlefs in various conditions. - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_TESTBD_H -#define LFS_TESTBD_H - -#include "lfs.h" -#include "lfs_util.h" -#include "bd/lfs_rambd.h" -#include "bd/lfs_filebd.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_TESTBD_YES_TRACE -#define LFS_TESTBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_TESTBD_TRACE(...) -#endif - -// Mode determining how "bad blocks" behave during testing. This simulates -// some real-world circumstances such as progs not sticking (prog-noop), -// a readonly disk (erase-noop), and ECC failures (read-error). -// -// Not that read-noop is not allowed. Read _must_ return a consistent (but -// may be arbitrary) value on every read. -enum lfs_testbd_badblock_behavior { - LFS_TESTBD_BADBLOCK_PROGERROR, - LFS_TESTBD_BADBLOCK_ERASEERROR, - LFS_TESTBD_BADBLOCK_READERROR, - LFS_TESTBD_BADBLOCK_PROGNOOP, - LFS_TESTBD_BADBLOCK_ERASENOOP, -}; - -// Type for measuring wear -typedef uint32_t lfs_testbd_wear_t; -typedef int32_t lfs_testbd_swear_t; - -// testbd config, this is required for testing -struct lfs_testbd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; - - // Number of erase cycles before a block becomes "bad". The exact behavior - // of bad blocks is controlled by the badblock_mode. - uint32_t erase_cycles; - - // The mode determining how bad blocks fail - uint8_t badblock_behavior; - - // Number of write operations (erase/prog) before forcefully killing - // the program with exit. Simulates power-loss. 0 disables. - uint32_t power_cycles; - - // Optional buffer for RAM block device. - void *buffer; - - // Optional buffer for wear - void *wear_buffer; -}; - -// testbd state -typedef struct lfs_testbd { - union { - struct { - lfs_filebd_t bd; - struct lfs_filebd_config cfg; - } file; - struct { - lfs_rambd_t bd; - struct lfs_rambd_config cfg; - } ram; - } u; - - bool persist; - uint32_t power_cycles; - lfs_testbd_wear_t *wear; - - const struct lfs_testbd_config *cfg; -} lfs_testbd_t; - - -/// Block device API /// - -// Create a test block device using the geometry in lfs_config -// -// Note that filebd is used if a path is provided, if path is NULL -// testbd will use rambd which can be much faster. -int lfs_testbd_create(const struct lfs_config *cfg, const char *path); -int lfs_testbd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_testbd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_testbd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_testbd_sync(const struct lfs_config *cfg); - - -/// Additional extended API for driving test features /// - -// Get simulated wear on a given block -lfs_testbd_swear_t lfs_testbd_getwear(const struct lfs_config *cfg, - lfs_block_t block); - -// Manually set simulated wear on a given block -int lfs_testbd_setwear(const struct lfs_config *cfg, - lfs_block_t block, lfs_testbd_wear_t wear); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/lfs.h b/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/lfs.h deleted file mode 100644 index 3fc1e982f1a..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/lfs.h +++ /dev/null @@ -1,701 +0,0 @@ -/* - * The little filesystem - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_H -#define LFS_H - -#include -#include -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/// Version info /// - -// Software library version -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_VERSION 0x00020005 -#define LFS_VERSION_MAJOR (0xffff & (LFS_VERSION >> 16)) -#define LFS_VERSION_MINOR (0xffff & (LFS_VERSION >> 0)) - -// Version of On-disk data structures -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_DISK_VERSION 0x00020000 -#define LFS_DISK_VERSION_MAJOR (0xffff & (LFS_DISK_VERSION >> 16)) -#define LFS_DISK_VERSION_MINOR (0xffff & (LFS_DISK_VERSION >> 0)) - - -/// Definitions /// - -// Type definitions -typedef uint32_t lfs_size_t; -typedef uint32_t lfs_off_t; - -typedef int32_t lfs_ssize_t; -typedef int32_t lfs_soff_t; - -typedef uint32_t lfs_block_t; - -// Maximum name size in bytes, may be redefined to reduce the size of the -// info struct. Limited to <= 1022. Stored in superblock and must be -// respected by other littlefs drivers. -#ifndef LFS_NAME_MAX -#define LFS_NAME_MAX 255 -#endif - -// Maximum size of a file in bytes, may be redefined to limit to support other -// drivers. Limited on disk to <= 4294967296. However, above 2147483647 the -// functions lfs_file_seek, lfs_file_size, and lfs_file_tell will return -// incorrect values due to using signed integers. Stored in superblock and -// must be respected by other littlefs drivers. -#ifndef LFS_FILE_MAX -#define LFS_FILE_MAX 2147483647 -#endif - -// Maximum size of custom attributes in bytes, may be redefined, but there is -// no real benefit to using a smaller LFS_ATTR_MAX. Limited to <= 1022. -#ifndef LFS_ATTR_MAX -#define LFS_ATTR_MAX 1022 -#endif - -// Possible error codes, these are negative to allow -// valid positive return values -enum lfs_error { - LFS_ERR_OK = 0, // No error - LFS_ERR_IO = -5, // Error during device operation - LFS_ERR_CORRUPT = -84, // Corrupted - LFS_ERR_NOENT = -2, // No directory entry - LFS_ERR_EXIST = -17, // Entry already exists - LFS_ERR_NOTDIR = -20, // Entry is not a dir - LFS_ERR_ISDIR = -21, // Entry is a dir - LFS_ERR_NOTEMPTY = -39, // Dir is not empty - LFS_ERR_BADF = -9, // Bad file number - LFS_ERR_FBIG = -27, // File too large - LFS_ERR_INVAL = -22, // Invalid parameter - LFS_ERR_NOSPC = -28, // No space left on device - LFS_ERR_NOMEM = -12, // No more memory available - LFS_ERR_NOATTR = -61, // No data/attr available - LFS_ERR_NAMETOOLONG = -36, // File name too long -}; - -// File types -enum lfs_type { - // file types - LFS_TYPE_REG = 0x001, - LFS_TYPE_DIR = 0x002, - - // internally used types - LFS_TYPE_SPLICE = 0x400, - LFS_TYPE_NAME = 0x000, - LFS_TYPE_STRUCT = 0x200, - LFS_TYPE_USERATTR = 0x300, - LFS_TYPE_FROM = 0x100, - LFS_TYPE_TAIL = 0x600, - LFS_TYPE_GLOBALS = 0x700, - LFS_TYPE_CRC = 0x500, - - // internally used type specializations - LFS_TYPE_CREATE = 0x401, - LFS_TYPE_DELETE = 0x4ff, - LFS_TYPE_SUPERBLOCK = 0x0ff, - LFS_TYPE_DIRSTRUCT = 0x200, - LFS_TYPE_CTZSTRUCT = 0x202, - LFS_TYPE_INLINESTRUCT = 0x201, - LFS_TYPE_SOFTTAIL = 0x600, - LFS_TYPE_HARDTAIL = 0x601, - LFS_TYPE_MOVESTATE = 0x7ff, - - // internal chip sources - LFS_FROM_NOOP = 0x000, - LFS_FROM_MOVE = 0x101, - LFS_FROM_USERATTRS = 0x102, -}; - -// File open flags -enum lfs_open_flags { - // open flags - LFS_O_RDONLY = 1, // Open a file as read only -#ifndef LFS_READONLY - LFS_O_WRONLY = 2, // Open a file as write only - LFS_O_RDWR = 3, // Open a file as read and write - LFS_O_CREAT = 0x0100, // Create a file if it does not exist - LFS_O_EXCL = 0x0200, // Fail if a file already exists - LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size - LFS_O_APPEND = 0x0800, // Move to end of file on every write -#endif - - // internally used flags -#ifndef LFS_READONLY - LFS_F_DIRTY = 0x010000, // File does not match storage - LFS_F_WRITING = 0x020000, // File has been written since last flush -#endif - LFS_F_READING = 0x040000, // File has been read since last flush -#ifndef LFS_READONLY - LFS_F_ERRED = 0x080000, // An error occurred during write -#endif - LFS_F_INLINE = 0x100000, // Currently inlined in directory entry -}; - -// File seek flags -enum lfs_whence_flags { - LFS_SEEK_SET = 0, // Seek relative to an absolute position - LFS_SEEK_CUR = 1, // Seek relative to the current file position - LFS_SEEK_END = 2, // Seek relative to the end of the file -}; - - -// Configuration provided during initialization of the littlefs -struct lfs_config { - // Opaque user provided context that can be used to pass - // information to the block device operations - void *context; - - // Read a region in a block. Negative error codes are propagated - // to the user. - int (*read)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - - // Program a region in a block. The block must have previously - // been erased. Negative error codes are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*prog)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - - // Erase a block. A block must be erased before being programmed. - // The state of an erased block is undefined. Negative error codes - // are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*erase)(const struct lfs_config *c, lfs_block_t block); - - // Sync the state of the underlying block device. Negative error codes - // are propagated to the user. - int (*sync)(const struct lfs_config *c); - -#ifdef LFS_THREADSAFE - // Lock the underlying block device. Negative error codes - // are propagated to the user. - int (*lock)(const struct lfs_config *c); - - // Unlock the underlying block device. Negative error codes - // are propagated to the user. - int (*unlock)(const struct lfs_config *c); -#endif - - // Minimum size of a block read in bytes. All read operations will be a - // multiple of this value. - lfs_size_t read_size; - - // Minimum size of a block program in bytes. All program operations will be - // a multiple of this value. - lfs_size_t prog_size; - - // Size of an erasable block in bytes. This does not impact ram consumption - // and may be larger than the physical erase size. However, non-inlined - // files take up at minimum one block. Must be a multiple of the read and - // program sizes. - lfs_size_t block_size; - - // Number of erasable blocks on the device. - lfs_size_t block_count; - - // Number of erase cycles before littlefs evicts metadata logs and moves - // the metadata to another block. Suggested values are in the - // range 100-1000, with large values having better performance at the cost - // of less consistent wear distribution. - // - // Set to -1 to disable block-level wear-leveling. - int32_t block_cycles; - - // Size of block caches in bytes. Each cache buffers a portion of a block in - // RAM. The littlefs needs a read cache, a program cache, and one additional - // cache per file. Larger caches can improve performance by storing more - // data and reducing the number of disk accesses. Must be a multiple of the - // read and program sizes, and a factor of the block size. - lfs_size_t cache_size; - - // Size of the lookahead buffer in bytes. A larger lookahead buffer - // increases the number of blocks found during an allocation pass. The - // lookahead buffer is stored as a compact bitmap, so each byte of RAM - // can track 8 blocks. Must be a multiple of 8. - lfs_size_t lookahead_size; - - // Optional statically allocated read buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *read_buffer; - - // Optional statically allocated program buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *prog_buffer; - - // Optional statically allocated lookahead buffer. Must be lookahead_size - // and aligned to a 32-bit boundary. By default lfs_malloc is used to - // allocate this buffer. - void *lookahead_buffer; - - // Optional upper limit on length of file names in bytes. No downside for - // larger names except the size of the info struct which is controlled by - // the LFS_NAME_MAX define. Defaults to LFS_NAME_MAX when zero. Stored in - // superblock and must be respected by other littlefs drivers. - lfs_size_t name_max; - - // Optional upper limit on files in bytes. No downside for larger files - // but must be <= LFS_FILE_MAX. Defaults to LFS_FILE_MAX when zero. Stored - // in superblock and must be respected by other littlefs drivers. - lfs_size_t file_max; - - // Optional upper limit on custom attributes in bytes. No downside for - // larger attributes size but must be <= LFS_ATTR_MAX. Defaults to - // LFS_ATTR_MAX when zero. - lfs_size_t attr_max; - - // Optional upper limit on total space given to metadata pairs in bytes. On - // devices with large blocks (e.g. 128kB) setting this to a low size (2-8kB) - // can help bound the metadata compaction time. Must be <= block_size. - // Defaults to block_size when zero. - lfs_size_t metadata_max; -}; - -// File info structure -struct lfs_info { - // Type of the file, either LFS_TYPE_REG or LFS_TYPE_DIR - uint8_t type; - - // Size of the file, only valid for REG files. Limited to 32-bits. - lfs_size_t size; - - // Name of the file stored as a null-terminated string. Limited to - // LFS_NAME_MAX+1, which can be changed by redefining LFS_NAME_MAX to - // reduce RAM. LFS_NAME_MAX is stored in superblock and must be - // respected by other littlefs drivers. - char name[LFS_NAME_MAX+1]; -}; - -// Custom attribute structure, used to describe custom attributes -// committed atomically during file writes. -struct lfs_attr { - // 8-bit type of attribute, provided by user and used to - // identify the attribute - uint8_t type; - - // Pointer to buffer containing the attribute - void *buffer; - - // Size of attribute in bytes, limited to LFS_ATTR_MAX - lfs_size_t size; -}; - -// Optional configuration provided during lfs_file_opencfg -struct lfs_file_config { - // Optional statically allocated file buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *buffer; - - // Optional list of custom attributes related to the file. If the file - // is opened with read access, these attributes will be read from disk - // during the open call. If the file is opened with write access, the - // attributes will be written to disk every file sync or close. This - // write occurs atomically with update to the file's contents. - // - // Custom attributes are uniquely identified by an 8-bit type and limited - // to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller - // than the buffer, it will be padded with zeros. If the stored attribute - // is larger, then it will be silently truncated. If the attribute is not - // found, it will be created implicitly. - struct lfs_attr *attrs; - - // Number of custom attributes in the list - lfs_size_t attr_count; -}; - - -/// internal littlefs data structures /// -typedef struct lfs_cache { - lfs_block_t block; - lfs_off_t off; - lfs_size_t size; - uint8_t *buffer; -} lfs_cache_t; - -typedef struct lfs_mdir { - lfs_block_t pair[2]; - uint32_t rev; - lfs_off_t off; - uint32_t etag; - uint16_t count; - bool erased; - bool split; - lfs_block_t tail[2]; -} lfs_mdir_t; - -// littlefs directory type -typedef struct lfs_dir { - struct lfs_dir *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - lfs_off_t pos; - lfs_block_t head[2]; -} lfs_dir_t; - -// littlefs file type -typedef struct lfs_file { - struct lfs_file *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - struct lfs_ctz { - lfs_block_t head; - lfs_size_t size; - } ctz; - - uint32_t flags; - lfs_off_t pos; - lfs_block_t block; - lfs_off_t off; - lfs_cache_t cache; - - const struct lfs_file_config *cfg; -} lfs_file_t; - -typedef struct lfs_superblock { - uint32_t version; - lfs_size_t block_size; - lfs_size_t block_count; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; -} lfs_superblock_t; - -typedef struct lfs_gstate { - uint32_t tag; - lfs_block_t pair[2]; -} lfs_gstate_t; - -// The littlefs filesystem type -typedef struct lfs { - lfs_cache_t rcache; - lfs_cache_t pcache; - - lfs_block_t root[2]; - struct lfs_mlist { - struct lfs_mlist *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - } *mlist; - uint32_t seed; - - lfs_gstate_t gstate; - lfs_gstate_t gdisk; - lfs_gstate_t gdelta; - - struct lfs_free { - lfs_block_t off; - lfs_block_t size; - lfs_block_t i; - lfs_block_t ack; - uint32_t *buffer; - } free; - - const struct lfs_config *cfg; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; - -#ifdef LFS_MIGRATE - struct lfs1 *lfs1; -#endif -} lfs_t; - - -/// Filesystem functions /// - -#ifndef LFS_READONLY -// Format a block device with the littlefs -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_format(lfs_t *lfs, const struct lfs_config *config); -#endif - -// Mounts a littlefs -// -// Requires a littlefs object and config struct. Multiple filesystems -// may be mounted simultaneously with multiple littlefs objects. Both -// lfs and config must be allocated while mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_mount(lfs_t *lfs, const struct lfs_config *config); - -// Unmounts a littlefs -// -// Does nothing besides releasing any allocated resources. -// Returns a negative error code on failure. -int lfs_unmount(lfs_t *lfs); - -/// General operations /// - -#ifndef LFS_READONLY -// Removes a file or directory -// -// If removing a directory, the directory must be empty. -// Returns a negative error code on failure. -int lfs_remove(lfs_t *lfs, const char *path); -#endif - -#ifndef LFS_READONLY -// Rename or move a file or directory -// -// If the destination exists, it must match the source in type. -// If the destination is a directory, the directory must be empty. -// -// Returns a negative error code on failure. -int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath); -#endif - -// Find info about a file or directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a negative error code on failure. -int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info); - -// Get a custom attribute -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller than -// the buffer, it will be padded with zeros. If the stored attribute is larger, -// then it will be silently truncated. If no attribute is found, the error -// LFS_ERR_NOATTR is returned and the buffer is filled with zeros. -// -// Returns the size of the attribute, or a negative error code on failure. -// Note, the returned size is the size of the attribute on disk, irrespective -// of the size of the buffer. This can be used to dynamically allocate a buffer -// or check for existence. -lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path, - uint8_t type, void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Set custom attributes -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. If an attribute is not found, it will be -// implicitly created. -// -// Returns a negative error code on failure. -int lfs_setattr(lfs_t *lfs, const char *path, - uint8_t type, const void *buffer, lfs_size_t size); -#endif - -#ifndef LFS_READONLY -// Removes a custom attribute -// -// If an attribute is not found, nothing happens. -// -// Returns a negative error code on failure. -int lfs_removeattr(lfs_t *lfs, const char *path, uint8_t type); -#endif - - -/// File operations /// - -#ifndef LFS_NO_MALLOC -// Open a file -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// Returns a negative error code on failure. -int lfs_file_open(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags); - -// if LFS_NO_MALLOC is defined, lfs_file_open() will fail with LFS_ERR_NOMEM -// thus use lfs_file_opencfg() with config.buffer set. -#endif - -// Open a file with extra configuration -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// The config struct provides additional config options per file as described -// above. The config struct must be allocated while the file is open, and the -// config struct must be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags, - const struct lfs_file_config *config); - -// Close a file -// -// Any pending writes are written out to storage as though -// sync had been called and releases any allocated resources. -// -// Returns a negative error code on failure. -int lfs_file_close(lfs_t *lfs, lfs_file_t *file); - -// Synchronize a file on storage -// -// Any pending writes are written out to storage. -// Returns a negative error code on failure. -int lfs_file_sync(lfs_t *lfs, lfs_file_t *file); - -// Read data from file -// -// Takes a buffer and size indicating where to store the read data. -// Returns the number of bytes read, or a negative error code on failure. -lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file, - void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Write data to file -// -// Takes a buffer and size indicating the data to write. The file will not -// actually be updated on the storage until either sync or close is called. -// -// Returns the number of bytes written, or a negative error code on failure. -lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file, - const void *buffer, lfs_size_t size); -#endif - -// Change the position of the file -// -// The change in position is determined by the offset and whence flag. -// Returns the new position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file, - lfs_soff_t off, int whence); - -#ifndef LFS_READONLY -// Truncates the size of the file to the specified size -// -// Returns a negative error code on failure. -int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size); -#endif - -// Return the position of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR) -// Returns the position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file); - -// Change the position of the file to the beginning of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_SET) -// Returns a negative error code on failure. -int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file); - -// Return the size of the file -// -// Similar to lfs_file_seek(lfs, file, 0, LFS_SEEK_END) -// Returns the size of the file, or a negative error code on failure. -lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file); - - -/// Directory operations /// - -#ifndef LFS_READONLY -// Create a directory -// -// Returns a negative error code on failure. -int lfs_mkdir(lfs_t *lfs, const char *path); -#endif - -// Open a directory -// -// Once open a directory can be used with read to iterate over files. -// Returns a negative error code on failure. -int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path); - -// Close a directory -// -// Releases any allocated resources. -// Returns a negative error code on failure. -int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir); - -// Read an entry in the directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a positive value on success, 0 at the end of directory, -// or a negative error code on failure. -int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info); - -// Change the position of the directory -// -// The new off must be a value previous returned from tell and specifies -// an absolute offset in the directory seek. -// -// Returns a negative error code on failure. -int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off); - -// Return the position of the directory -// -// The returned offset is only meant to be consumed by seek and may not make -// sense, but does indicate the current position in the directory iteration. -// -// Returns the position of the directory, or a negative error code on failure. -lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir); - -// Change the position of the directory to the beginning of the directory -// -// Returns a negative error code on failure. -int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir); - - -/// Filesystem-level filesystem operations - -// Finds the current size of the filesystem -// -// Note: Result is best effort. If files share COW structures, the returned -// size may be larger than the filesystem actually is. -// -// Returns the number of allocated blocks, or a negative error code on failure. -lfs_ssize_t lfs_fs_size(lfs_t *lfs); - -// Traverse through all blocks in use by the filesystem -// -// The provided callback will be called with each block address that is -// currently in use by the filesystem. This can be used to determine which -// blocks are in use or how much of the storage is available. -// -// Returns a negative error code on failure. -int lfs_fs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data); - -#ifndef LFS_READONLY -#ifdef LFS_MIGRATE -// Attempts to migrate a previous version of littlefs -// -// Behaves similarly to the lfs_format function. Attempts to mount -// the previous version of littlefs and update the filesystem so it can be -// mounted with the current version of littlefs. -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg); -#endif -#endif - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/lfs_util.h b/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/lfs_util.h deleted file mode 100644 index 0cbc2a31995..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs/lfs_util.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_UTIL_H -#define LFS_UTIL_H - -// Users can override lfs_util.h with their own configuration by defining -// LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h). -// -// If LFS_CONFIG is used, none of the default utils will be emitted and must be -// provided by the config file. To start, I would suggest copying lfs_util.h -// and modifying as needed. -#ifdef LFS_CONFIG -#define LFS_STRINGIZE(x) LFS_STRINGIZE2(x) -#define LFS_STRINGIZE2(x) #x -#include LFS_STRINGIZE(LFS_CONFIG) -#else - -// System includes -#include -#include -#include -#include - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return malloc(size); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif -#endif diff --git a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs_api.h b/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs_api.h deleted file mode 100644 index 135b05972d0..00000000000 --- a/tools/sdk/esp32c3/include/esp_littlefs/src/littlefs_api.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ESP_LITTLEFS_API_H__ -#define ESP_LITTLEFS_API_H__ - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp_vfs.h" -#include "esp_partition.h" -#include "littlefs/lfs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief a file descriptor - * That's also a singly linked list used for keeping tracks of all opened file descriptor - * - * Shortcomings/potential issues of 32-bit hash (when CONFIG_LITTLEFS_USE_ONLY_HASH) listed here: - * * unlink - If a different file is open that generates a hash collision, it will report an - * error that it cannot unlink an open file. - * * rename - If a different file is open that generates a hash collision with - * src or dst, it will report an error that it cannot rename an open file. - * Potential consequences: - * 1. A file cannot be deleted while a collision-geneating file is open. - * Worst-case, if the other file is always open during the lifecycle - * of your app, it's collision file cannot be deleted, which in the - * worst-case could cause storage-capacity issues. - * 2. Same as (1), but for renames - */ -typedef struct _vfs_littlefs_file_t { - lfs_file_t file; - uint32_t hash; - struct _vfs_littlefs_file_t * next; /*!< Pointer to next file in Singly Linked List */ -#ifndef CONFIG_LITTLEFS_USE_ONLY_HASH - char * path; -#endif -} vfs_littlefs_file_t; - -/** - * @brief littlefs definition structure - */ -typedef struct { - lfs_t *fs; /*!< Handle to the underlying littlefs */ - SemaphoreHandle_t lock; /*!< FS lock */ - const esp_partition_t* partition; /*!< The partition on which littlefs is located */ - char base_path[ESP_VFS_PATH_MAX+1]; /*!< Mount point */ - - struct lfs_config cfg; /*!< littlefs Mount configuration */ - - vfs_littlefs_file_t *file; /*!< Singly Linked List of files */ - - vfs_littlefs_file_t **cache; /*!< A cache of pointers to the opened files */ - uint16_t cache_size; /*!< The cache allocated size (in pointers) */ - uint16_t fd_count; /*!< The count of opened file descriptor used to speed up computation */ -} esp_littlefs_t; - -/** - * @brief Read a region in a block. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_read(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -/** - * @brief Program a region in a block. - * - * The block must have previously been erased. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_prog(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -/** - * @brief Erase a block. - * - * A block must be erased before being programmed. - * The state of an erased block is undefined. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * @return errorcode. 0 on success. - */ -int littlefs_api_erase(const struct lfs_config *c, lfs_block_t block); - -/** - * @brief Sync the state of the underlying block device. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_sync(const struct lfs_config *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/esp32c3/include/esp_rainmaker/include/esp_rmaker_ota.h b/tools/sdk/esp32c3/include/esp_rainmaker/include/esp_rmaker_ota.h index 6dc7962177e..c5483a8afbd 100644 --- a/tools/sdk/esp32c3/include/esp_rainmaker/include/esp_rmaker_ota.h +++ b/tools/sdk/esp32c3/include/esp_rainmaker/include/esp_rmaker_ota.h @@ -21,6 +21,31 @@ extern "C" { #endif +/** @cond **/ +/** ESP RainMaker Event Base */ +ESP_EVENT_DECLARE_BASE(RMAKER_OTA_EVENT); +/** @endcond **/ + +/** ESP RainMaker Events */ +typedef enum { + /* Invalid event. Used for internal handling only */ + RMAKER_OTA_EVENT_INVALID = 0, + /** RainMaker OTA is Starting */ + RMAKER_OTA_EVENT_STARTING, + /** RainMaker OTA has Started */ + RMAKER_OTA_EVENT_IN_PROGRESS, + /** RainMaker OTA Successful */ + RMAKER_OTA_EVENT_SUCCESSFUL, + /** RainMaker OTA Failed */ + RMAKER_OTA_EVENT_FAILED, + /** RainMaker OTA Rejected */ + RMAKER_OTA_EVENT_REJECTED, + /** RainMaker OTA Delayed */ + RMAKER_OTA_EVENT_DELAYED, + /** OTA Image has been flashed and active partition changed. Reboot is requested. Applicable only if Auto reboot is disabled **/ + RMAKER_OTA_EVENT_REQ_FOR_REBOOT, +} esp_rmaker_ota_event_t; + /** Default ESP RainMaker OTA Server Certificate */ extern const char *ESP_RMAKER_OTA_DEFAULT_SERVER_CERT; @@ -56,10 +81,16 @@ typedef struct { /** Size of the OTA File. Can be 0 if the file size isn't received from * the ESP RainMaker Cloud */ int filesize; + /** The firmware version of the OTA image **/ + char *fw_version; + /** The OTA Job ID received from cloud **/ + char *ota_job_id; /** The server certificate passed in esp_rmaker_enable_ota() */ const char *server_cert; /** The private data passed in esp_rmaker_enable_ota() */ char *priv; + /** OTA Metadata. Applicable only for OTA using Topics. Will be received (if applicable) from the backend, alongwith the OTA URL */ + char *metadata; } esp_rmaker_ota_data_t; /** Function prototype for OTA Callback @@ -170,6 +201,18 @@ esp_err_t esp_rmaker_ota_default_cb(esp_rmaker_ota_handle_t handle, esp_rmaker_o * @return error on failure */ esp_err_t esp_rmaker_ota_fetch(void); + +/** Fetch OTA Info with a delay + * + * For OTA using Topics, this API can be used to explicitly ask the backend if an OTA is available + * after a delay (in seconds) passed as an argument. + * + * @param[in] time Delay (in seconds) + * + * @return ESP_OK if the OTA fetch timer was created. + * @return error on failure + */ +esp_err_t esp_rmaker_ota_fetch_with_delay(int time); #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/esp_rom/esp32c3/esp_rom_caps.h b/tools/sdk/esp32c3/include/esp_rom/esp32c3/esp_rom_caps.h index 7a210f1a536..977d73fc90f 100644 --- a/tools/sdk/esp32c3/include/esp_rom/esp32c3/esp_rom_caps.h +++ b/tools/sdk/esp32c3/include/esp_rom/esp32c3/esp_rom_caps.h @@ -21,3 +21,4 @@ #define ESP_ROM_USB_SERIAL_DEVICE_NUM (3) // UART uses USB_SERIAL_JTAG port in ROM. #define ESP_ROM_HAS_RETARGETABLE_LOCKING (1) // ROM was built with retargetable locking #define ESP_ROM_HAS_ERASE_0_REGION_BUG (1) // ROM has esp_flash_erase_region(size=0) bug +#define ESP_ROM_NEEDS_SWSETUP_WORKAROUND (1) // ROM uses 32-bit time_t. A workaround is required to prevent printf functions from crashing diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp32/rom/miniz.h b/tools/sdk/esp32c3/include/esp_rom/include/esp32/rom/miniz.h index 7661f804468..5fefa84999a 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp32/rom/miniz.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp32/rom/miniz.h @@ -760,7 +760,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp32c3/rom/miniz.h b/tools/sdk/esp32c3/include/esp_rom/include/esp32c3/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp32c3/rom/miniz.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp32c3/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp32h2/rom/miniz.h b/tools/sdk/esp32c3/include/esp_rom/include/esp32h2/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp32h2/rom/miniz.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp32h2/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp32s2/rom/miniz.h b/tools/sdk/esp32c3/include/esp_rom/include/esp32s2/rom/miniz.h index b9b9202aaa7..fd2fe3c9a19 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp32s2/rom/miniz.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp32s2/rom/miniz.h @@ -745,7 +745,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp32s3/rom/miniz.h b/tools/sdk/esp32c3/include/esp_rom/include/esp32s3/rom/miniz.h index 7553511349e..f095b539b9b 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp32s3/rom/miniz.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp32s3/rom/miniz.h @@ -728,7 +728,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_efuse.h b/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_efuse.h index 907e175ecad..6280a1e5b60 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_efuse.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -20,6 +12,7 @@ extern "C" { #include #include +#include "soc/soc_caps.h" #define ESP_ROM_EFUSE_FLASH_DEFAULT_SPI (0) #define ESP_ROM_EFUSE_FLASH_DEFAULT_HSPI (1) @@ -56,6 +49,18 @@ uint32_t esp_rom_efuse_get_flash_gpio_info(void); */ uint32_t esp_rom_efuse_get_flash_wp_gpio(void); +#if SOC_SPI_MEM_SUPPORT_OPI_MODE +/** + * @brief Read opi flash pads configuration from Efuse + * + * @return + * - 0 for default SPI pins. + * - Other values define a custom pin configuration mask. From the LSB, every 6 bits represent a GPIO number which stand for: + * DQS, D4, D5, D6, D7 accordingly. + */ +uint32_t esp_rom_efuse_get_opiconfig(void); +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE + /** * @brief Read eFuse to check whether secure boot has been enabled or not * diff --git a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h b/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h b/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h deleted file mode 100644 index 49ba82ddf00..00000000000 --- a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 72 diff --git a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h b/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32c3/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32c3/include/esp_timer/include/esp_private/esp_timer_private.h b/tools/sdk/esp32c3/include/esp_timer/include/esp_private/esp_timer_private.h index ecd42641115..6f32f1431e1 100644 --- a/tools/sdk/esp32c3/include/esp_timer/include/esp_private/esp_timer_private.h +++ b/tools/sdk/esp32c3/include/esp_timer/include/esp_private/esp_timer_private.h @@ -52,11 +52,11 @@ void esp_timer_private_update_apb_freq(uint32_t apb_ticks_per_us); void esp_timer_private_advance(int64_t time_us); /** - * @brief obtain internal critical section used esp_timer implementation + * @brief obtain internal critical section used in the esp_timer implementation * This can be used when a sequence of calls to esp_timer has to be made, * and it is necessary that the state of the timer is consistent between * the calls. Should be treated in the same way as a spinlock. - * Call esp_timer_unlock to release the lock + * Call esp_timer_private_unlock to release the lock */ void esp_timer_private_lock(void); diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_coexist_internal.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_coexist_internal.h index 7ba06d4c690..1633c020276 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_coexist_internal.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_coexist_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,6 +23,7 @@ typedef enum { } coex_prefer_t; typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); +typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void); /** * @brief Pre-Init software coexist @@ -115,6 +116,18 @@ int coex_wifi_release(uint32_t event); */ int coex_wifi_channel_set(uint8_t primary, uint8_t secondary); +/** + * @brief Register application callback function to Wi-Fi update low power clock module. + * + * @param callback : Wi-Fi update low power clock callback function + */ +void coex_wifi_register_update_lpclk_callback(coex_set_lpclk_source_callback_t callback); + +/** + * @brief Update low power clock interval + */ +void coex_update_lpclk_interval(void); + /** * @brief Get coexistence event duration. * diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi.h index a2c763260e5..7b2a7ef4851 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -496,6 +496,15 @@ bool esp_wifi_internal_is_tsf_active(void); * */ void esp_wifi_internal_update_light_sleep_wake_ahead_time(uint32_t); + +/** + * @brief Update WiFi TSF tick interval + * + * @return + * - true: Active + * - false: Not active + */ +esp_err_t esp_wifi_update_tsf_tick_interval(void); #endif /** @@ -590,6 +599,15 @@ void esp_wifi_set_sleep_delay_time(uint32_t return_to_sleep_delay); */ void esp_wifi_set_keep_alive_time(uint32_t keep_alive_time); +/** + * @brief Configure wifi beacon montior default parameters + * + * @param enable: enable or disable beacon monitor + * @param timeout: timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond + * @param threshold: maximum number of consecutive lost beacons allowed + */ +void esp_wifi_beacon_monitor_configure(bool enable, int timeout, int threshold, int delta_intr_early, int delta_timeout); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h index 88d0ee54029..8b921b9da7f 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -77,7 +77,7 @@ typedef struct { void (* _wifi_apb80m_release)(void); void (* _phy_disable)(void); void (* _phy_enable)(void); -#if CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 void (* _phy_common_clock_enable)(void); void (* _phy_common_clock_disable)(void); #endif diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h index e06569dfc15..08be53cf6a4 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h @@ -339,7 +339,7 @@ esp_err_t esp_wifi_restore(void); * * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. - * @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. + * @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between ESP32 and the AP is established. * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error * number ESP_ERR_WIFI_STATE. * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called @@ -600,18 +600,19 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); * @attention 1. It is discouraged to call this API since this doesn't validate the per-country rules, * it's up to the user to fill in all fields according to local regulations. * Please use esp_wifi_set_country_code instead. - * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO} - * @attention 3. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which - * the station is connected is used. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11} + * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}. + * @attention 3. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which + * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected * from the AP the country info is set back to the country info of the station automatically, * {.cc="US", .schan=1, .nchan=11} in the example. - * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. - * @attention 5. When the country info is changed because of configuration or because the station connects to a different + * @attention 5. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. + * @attention 6. When the country info is changed because of configuration or because the station connects to a different * external AP, the country IE in probe response/beacon of the soft-AP is also changed. - * @attention 6. The country configuration is stored into flash. - * @attention 7. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the + * @attention 7. The country configuration is stored into flash. + * @attention 8. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the * country info. * * @param country the configured country info @@ -909,7 +910,7 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range */ esp_err_t esp_wifi_set_max_tx_power(int8_t power); @@ -922,7 +923,7 @@ esp_err_t esp_wifi_set_max_tx_power(int8_t power); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument */ esp_err_t esp_wifi_get_max_tx_power(int8_t *power); @@ -1018,7 +1019,7 @@ esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); @@ -1031,7 +1032,7 @@ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi(bool en); @@ -1244,6 +1245,7 @@ esp_err_t esp_wifi_set_connectionless_wake_interval(uint16_t interval); * * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. * @attention 8. The default country is "CN" and ieee80211d_enabled is TRUE. + * @attention 9. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * * @param country the configured country ISO code * @param ieee80211d_enabled 802.11d is enabled or not diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi_types.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi_types.h index 89020d4abbf..4dae6a8c3fa 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi_types.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi_types.h @@ -219,6 +219,14 @@ typedef struct { bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ } wifi_pmf_config_t; +/** Configuration for SAE PWE derivation */ +typedef enum { + WPA3_SAE_PWE_UNSPECIFIED, + WPA3_SAE_PWE_HUNT_AND_PECK, + WPA3_SAE_PWE_HASH_TO_ELEMENT, + WPA3_SAE_PWE_BOTH, +} wifi_sae_pwe_method_t; + /** @brief Soft-AP configuration settings for the ESP32 */ typedef struct { uint8_t ssid[32]; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ @@ -249,6 +257,7 @@ typedef struct { uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ uint32_t reserved:29; /**< Reserved for future feature set */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Whether SAE hash to element is enabled */ } wifi_sta_config_t; /** @brief Configuration data for ESP32 AP or STA. diff --git a/tools/sdk/esp32c3/include/expat/expat/expat/lib/expat.h b/tools/sdk/esp32c3/include/expat/expat/expat/lib/expat.h index 0f021e25def..e2020a4a29e 100644 --- a/tools/sdk/esp32c3/include/expat/expat/expat/lib/expat.h +++ b/tools/sdk/esp32c3/include/expat/expat/expat/lib/expat.h @@ -15,6 +15,7 @@ Copyright (c) 2016 Cristian Rodríguez Copyright (c) 2016 Thomas Beutlich Copyright (c) 2017 Rhodri James + Copyright (c) 2022 Thijs Schreijer Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -174,8 +175,10 @@ struct XML_cp { }; /* This is called for an element declaration. See above for - description of the model argument. It's the caller's responsibility - to free model when finished with it. + description of the model argument. It's the user code's responsibility + to free model when finished with it. See XML_FreeContentModel. + There is no need to free the model from the handler, it can be kept + around and freed at a later stage. */ typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData, const XML_Char *name, @@ -237,6 +240,17 @@ XML_ParserCreate(const XML_Char *encoding); and the local part will be concatenated without any separator. It is a programming error to use the separator '\0' with namespace triplets (see XML_SetReturnNSTriplet). + If a namespace separator is chosen that can be part of a URI or + part of an XML name, splitting an expanded name back into its + 1, 2 or 3 original parts on application level in the element handler + may end up vulnerable, so these are advised against; sane choices for + a namespace separator are e.g. '\n' (line feed) and '|' (pipe). + + Note that Expat does not validate namespace URIs (beyond encoding) + against RFC 3986 today (and is not required to do so with regard to + the XML 1.0 namespaces specification) but it may start doing that + in future releases. Before that, an application using Expat must + be ready to receive namespace URIs containing non-URI characters. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); @@ -317,7 +331,7 @@ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *pubid, int has_internal_subset); -/* This is called for the start of the DOCTYPE declaration when the +/* This is called for the end of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ @@ -1041,7 +1055,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold( */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 4 -#define XML_MICRO_VERSION 3 +#define XML_MICRO_VERSION 8 #ifdef __cplusplus } diff --git a/tools/sdk/esp32c3/include/expat/port/include/expat_config.h b/tools/sdk/esp32c3/include/expat/port/include/expat_config.h index 468910220f4..42acb52a5ca 100644 --- a/tools/sdk/esp32c3/include/expat/port/include/expat_config.h +++ b/tools/sdk/esp32c3/include/expat/port/include/expat_config.h @@ -63,7 +63,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.4.3" +#define PACKAGE_STRING "expat 2.4.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -72,13 +72,13 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.4.3" +#define PACKAGE_VERSION "2.4.8" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.4.3" +#define VERSION "2.4.8" /* whether byteorder is bigendian */ /* #undef WORDS_BIGENDIAN */ diff --git a/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/idf_additions.h b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/idf_additions.h new file mode 100644 index 00000000000..bd1d0bd2381 --- /dev/null +++ b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/idf_additions.h @@ -0,0 +1,57 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "idf_additions_inc.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Saves the current priority and current base priority of a task, then raises the tasks + * current and base priority to uxNewPriority if uxNewPriority is of a higher priority. + * Once a task's priority has been raised with this function, the priority can be restored + * by calling prvTaskPriorityRestore() + * - Note that this function differs from vTaskPrioritySet() as the task's current priority + * will be modified even if the task has already inherited a priority. + * - This function is intended for special circumstance where a task must be forced immediately + * to a higher priority. + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @note vTaskPrioritySet() should not be called while a task's priority is already raised via this function + * + * @param pxSavedPriority returns base and current priorities + * + * @param uxNewPriority The priority to which the task will be set. + */ +void prvTaskPriorityRaise( prvTaskSavedPriority_t * pxSavedPriority, UBaseType_t uxNewPriority ); + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Restore a task's priority that was previously raised by prvTaskPriorityRaise(). + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @param pxSavedPriority previously saved base and current priorities that need to be restored + */ +void prvTaskPriorityRestore( prvTaskSavedPriority_t * pxSavedPriority ); + +#endif // ( INCLUDE_vTaskPrioritySet == 1) diff --git a/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/idf_additions_inc.h b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/idf_additions_inc.h new file mode 100644 index 00000000000..25b0b6d9a4d --- /dev/null +++ b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/idf_additions_inc.h @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#ifndef FREERTOS_ADDITITIONS_INC_H_ +#define FREERTOS_ADDITITIONS_INC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +typedef struct { + UBaseType_t uxPriority; +#if ( configUSE_MUTEXES == 1 ) + UBaseType_t uxBasePriority; +#endif +} prvTaskSavedPriority_t; + +#endif // ( INCLUDE_vTaskPrioritySet == 1) + +#ifdef __cplusplus +} +#endif + +#endif //FREERTOS_ADDITITIONS_INC_H_ diff --git a/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos_tasks_c_additions.h b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos_tasks_c_additions.h deleted file mode 100644 index 464c0b3ffb9..00000000000 --- a/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos_tasks_c_additions.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -/** - * This file will be included in `tasks.c` file, thus, it must NOT be included - * by any (other) file. - * The functions below only consist in getters for the static variables in - * `tasks.c` file. - * The only source files that should call these functions are the ones in - * `/additions` directory. - */ - -#if ( configENABLE_TASK_SNAPSHOT == 1 ) - - UBaseType_t pxTCBGetSize ( void ) - { - return sizeof(TCB_t); - } - - ListItem_t* pxTCBGetStateListItem ( void *pxTCB ) - { - return &(((TCB_t*)pxTCB)->xStateListItem); - } - - StackType_t* pxTCBGetStartOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxStack; - } - - StackType_t* pxTCBGetTopOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxTopOfStack; - } - - StackType_t* pxTCBGetEndOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxEndOfStack; - } - - - List_t* pxListGetReadyTask ( UBaseType_t idx ) - { - return &( pxReadyTasksLists[idx] ); - } - - List_t* pxListGetReadyPendingTask ( UBaseType_t idx ) - { - return &( xPendingReadyList[idx] ); - } - - List_t* pxGetDelayedTaskList ( void ) { - return pxDelayedTaskList; - } - - List_t* pxGetOverflowDelayedTaskList ( void ) { - return pxOverflowDelayedTaskList; - } - - List_t* pxGetTasksWaitingTermination ( void ) { - return &xTasksWaitingTermination; - } - - List_t* pxGetSuspendedTaskList ( void ) { - return &xSuspendedTaskList; - } - -#endif diff --git a/tools/sdk/esp32c3/include/freertos/include/freertos/task.h b/tools/sdk/esp32c3/include/freertos/include/freertos/task.h index 88b2730933d..89841757d49 100644 --- a/tools/sdk/esp32c3/include/freertos/include/freertos/task.h +++ b/tools/sdk/esp32c3/include/freertos/include/freertos/task.h @@ -2655,12 +2655,13 @@ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, * not have this parameter and always waits for notifications on index 0. * * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value - * will be cleared in the calling task's notification value before the task - * checks to see if any notifications are pending, and optionally blocks if no - * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if - * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have - * the effect of resetting the task's notification value to 0. Setting - * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged. + * will be cleared in the calling task's notification value before the task is + * marked as waiting for a new notification (provided a notification is not + * already pending). Optionally blocks if no notifications are pending. Setting + * ulBitsToClearOnEntry to ULONG_MAX (if limits.h is included) or 0xffffffffUL + * (if limits.h is not included) will have the effect of resetting the task's + * notification value to 0. Setting ulBitsToClearOnEntry to 0 will leave the + * task's notification value unchanged. * * @param ulBitsToClearOnExit If a notification is pending or received before * the calling task exits the xTaskNotifyWait() function then the task's @@ -3367,6 +3368,25 @@ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION; +#ifdef ESP_PLATFORM +/* + * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN + * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. + * + * This function is a wrapper to take the "xTaskQueueMutex" spinlock of tasks.c. + * This lock is taken whenver any of the task lists or event lists are + * accessed/modified, such as when adding/removing tasks to/from the delayed + * task list or various event lists. + * + * This functions is meant to be called by xEventGroupSetBits() and + * vEventGroupDelete() as both those functions will access event lists (instead + * of delegating the entire responsibility to one of vTask...EventList() + * functions). + */ +void vTaskTakeEventListLock( void ); +void vTaskReleaseEventListLock( void ); +#endif // ESP_PLATFORM + /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpio_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpio_ll.h index 91343f84776..0b577859557 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpio_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpio_ll.h @@ -50,6 +50,12 @@ static inline void gpio_ll_pullup_en(gpio_dev_t *hw, gpio_num_t gpio_num) */ static inline void gpio_ll_pullup_dis(gpio_dev_t *hw, gpio_num_t gpio_num) { + // The pull-up value of the USB pins are controlled by the pins’ pull-up value together with USB pull-up value + // USB DP pin is default to PU enabled + if (gpio_num == USB_DP_GPIO_NUM) { + SET_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_PAD_PULL_OVERRIDE); + CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_DP_PULLUP); + } REG_CLR_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PU); } diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2c_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2c_ll.h index a4b3662fb58..c2aee7b27f9 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2c_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2c_ll.h @@ -114,12 +114,12 @@ static inline void i2c_ll_cal_bus_clk(uint32_t source_clk, uint32_t bus_freq, i2 clk_cal->clkm_div = clkm_div; clk_cal->scl_low = half_cycle; // default, scl_wait_high < scl_high - int scl_wait_high = (bus_freq <= 50000) ? 0 : (half_cycle / 8); // compensate the time when freq > 50K - clk_cal->scl_wait_high = scl_wait_high; - clk_cal->scl_high = half_cycle - scl_wait_high; + // Make 80KHz as a boundary here, because when working at lower frequency, too much scl_wait_high will faster the frequency + // according to some hardware behaviors. + clk_cal->scl_wait_high = (bus_freq >= 80*1000) ? (half_cycle / 2 - 2) : (half_cycle / 4); + clk_cal->scl_high = half_cycle - clk_cal->scl_wait_high; clk_cal->sda_hold = half_cycle / 4; - // scl_wait_high < sda_sample <= scl_high - clk_cal->sda_sample = half_cycle / 2; + clk_cal->sda_sample = half_cycle / 2 + clk_cal->scl_wait_high; clk_cal->setup = half_cycle; clk_cal->hold = half_cycle; //default we set the timeout value to about 10 bus cycles @@ -150,9 +150,14 @@ static inline void i2c_ll_update(i2c_dev_t *hw) static inline void i2c_ll_set_bus_timing(i2c_dev_t *hw, i2c_clk_cal_t *bus_cfg) { HAL_FORCE_MODIFY_U32_REG_FIELD(hw->clk_conf, sclk_div_num, bus_cfg->clkm_div - 1); - //scl period - hw->scl_low_period.period = bus_cfg->scl_low - 2; - hw->scl_high_period.period = bus_cfg->scl_high - 3; + /* According to the Technical Reference Manual, the following timings must be subtracted by 1. + * However, according to the practical measurement and some hardware behaviour, if wait_high_period and scl_high minus one. + * The SCL frequency would be a little higher than expected. Therefore, the solution + * here is not to minus scl_high as well as scl_wait high, and the frequency will be absolutely accurate to all frequency + * to some extent. */ + hw->scl_low_period.period = bus_cfg->scl_low - 1; + hw->scl_high_period.period = bus_cfg->scl_high; + hw->scl_high_period.scl_wait_high_period = bus_cfg->scl_wait_high; //sda sample hw->sda_hold.time = bus_cfg->sda_hold - 1; hw->sda_sample.time = bus_cfg->sda_sample - 1; @@ -907,6 +912,39 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw) hw->fifo_conf.fifo_addr_cfg_en = 0; } +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +static inline void i2c_ll_set_scl_clk_timing(i2c_dev_t *hw, int high_period, int low_period, int wait_high_period) +{ + hw->scl_low_period.period = low_period; + hw->scl_high_period.period = high_period; + hw->scl_high_period.scl_wait_high_period = wait_high_period; +} + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +static inline void i2c_ll_get_scl_clk_timing(i2c_dev_t *hw, int *high_period, int *low_period, int *wait_high_period) +{ + *high_period = hw->scl_high_period.period; + *wait_high_period = hw->scl_high_period.scl_wait_high_period; + *low_period = hw->scl_low_period.period; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h index f7cb496b4b8..53a42136214 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h @@ -217,6 +217,23 @@ static inline void i2s_ll_tx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) hw->tx_conf1.tx_bck_div_num = val - 1; } +/** + * @brief Set I2S tx raw clock division + * + * @param hw Peripheral I2S hardware instance address. + * @param x div x + * @param y div y + * @param z div z + * @param yn1 yn1 + */ +static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) +{ + hw->tx_clkm_div_conf.tx_clkm_div_x = x; + hw->tx_clkm_div_conf.tx_clkm_div_y = y; + hw->tx_clkm_div_conf.tx_clkm_div_z = z; + hw->tx_clkm_div_conf.tx_clkm_div_yn1 = yn1; +} + /** * @brief Configure I2S TX clock devider * @@ -608,11 +625,11 @@ static inline void i2s_ll_tx_enable_pdm_hp_filter(i2s_dev_t *hw, bool enable) * @brief Enable I2S TX PDM sigma-delta codec * * @param hw Peripheral I2S hardware instance address. - * @param dither I2S TX PDM sigmadelta dither value + * @param enable whether enable sd dac one line mode */ static inline void i2s_ll_tx_enable_pdm_sd_codec(i2s_dev_t *hw, bool enable) { - hw->tx_pcm2pdm_conf.tx_pdm_dac_2out_en = enable; + hw->tx_pcm2pdm_conf.tx_pdm_dac_2out_en = !enable; hw->tx_pcm2pdm_conf.tx_pdm_dac_mode_en = enable; } diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h index 01070e918fc..78b58de6c4f 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h @@ -74,6 +74,21 @@ typedef enum { } spi_ll_trans_len_cond_t; FLAG_ATTR(spi_ll_trans_len_cond_t) +// SPI base command in esp32c3 +typedef enum { + /* Slave HD Only */ + SPI_LL_BASE_CMD_HD_WRBUF = 0x01, + SPI_LL_BASE_CMD_HD_RDBUF = 0x02, + SPI_LL_BASE_CMD_HD_WRDMA = 0x03, + SPI_LL_BASE_CMD_HD_RDDMA = 0x04, + SPI_LL_BASE_CMD_HD_SEG_END = 0x05, + SPI_LL_BASE_CMD_HD_EN_QPI = 0x06, + SPI_LL_BASE_CMD_HD_WR_END = 0x07, + SPI_LL_BASE_CMD_HD_INT0 = 0x08, + SPI_LL_BASE_CMD_HD_INT1 = 0x09, + SPI_LL_BASE_CMD_HD_INT2 = 0x0A, +} spi_ll_base_command_t; + /*------------------------------------------------------------------------------ * Control *----------------------------------------------------------------------------*/ @@ -1076,6 +1091,93 @@ static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK +/** + * Get the base spi command in esp32c3 + * + * @param cmd_t Command value + */ +static inline uint8_t spi_ll_get_slave_hd_base_command(spi_command_t cmd_t) +{ + uint8_t cmd_base = 0x00; + switch (cmd_t) + { + case SPI_CMD_HD_WRBUF: + cmd_base = SPI_LL_BASE_CMD_HD_WRBUF; + break; + case SPI_CMD_HD_RDBUF: + cmd_base = SPI_LL_BASE_CMD_HD_RDBUF; + break; + case SPI_CMD_HD_WRDMA: + cmd_base = SPI_LL_BASE_CMD_HD_WRDMA; + break; + case SPI_CMD_HD_RDDMA: + cmd_base = SPI_LL_BASE_CMD_HD_RDDMA; + break; + case SPI_CMD_HD_SEG_END: + cmd_base = SPI_LL_BASE_CMD_HD_SEG_END; + break; + case SPI_CMD_HD_EN_QPI: + cmd_base = SPI_LL_BASE_CMD_HD_EN_QPI; + break; + case SPI_CMD_HD_WR_END: + cmd_base = SPI_LL_BASE_CMD_HD_WR_END; + break; + case SPI_CMD_HD_INT0: + cmd_base = SPI_LL_BASE_CMD_HD_INT0; + break; + case SPI_CMD_HD_INT1: + cmd_base = SPI_LL_BASE_CMD_HD_INT1; + break; + case SPI_CMD_HD_INT2: + cmd_base = SPI_LL_BASE_CMD_HD_INT2; + break; + default: + HAL_ASSERT(cmd_base); + } + return cmd_base; +} + +/** + * Get the spi communication command + * + * @param cmd_t Base command value + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline uint16_t spi_ll_get_slave_hd_command(spi_command_t cmd_t, spi_line_mode_t line_mode) +{ + uint8_t cmd_base = spi_ll_get_slave_hd_base_command(cmd_t); + uint8_t cmd_mod = 0x00; //CMD:1-bit, ADDR:1-bit, DATA:1-bit + + if (line_mode.data_lines == 2) { + if (line_mode.addr_lines == 2) { + cmd_mod = 0x50; //CMD:1-bit, ADDR:2-bit, DATA:2-bit + } else { + cmd_mod = 0x10; //CMD:1-bit, ADDR:1-bit, DATA:2-bit + } + } else if (line_mode.data_lines == 4) { + if (line_mode.addr_lines == 4) { + cmd_mod = 0xA0; //CMD:1-bit, ADDR:4-bit, DATA:4-bit + } else { + cmd_mod = 0x20; //CMD:1-bit, ADDR:1-bit, DATA:4-bit + } + } + if (cmd_base == SPI_LL_BASE_CMD_HD_SEG_END || cmd_base == SPI_LL_BASE_CMD_HD_EN_QPI) { + cmd_mod = 0x00; + } + + return cmd_base | cmd_mod; +} + +/** + * Get the dummy bits + * + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline int spi_ll_get_slave_hd_dummy_bits(spi_line_mode_t line_mode) +{ + return 8; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/usb_phy_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/usb_phy_ll.h new file mode 100644 index 00000000000..40d4cd18006 --- /dev/null +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/usb_phy_ll.h @@ -0,0 +1,34 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "soc/usb_serial_jtag_struct.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Configures the internal PHY for USB_Serial_JTAG + * + * @param hw Start address of the USB Serial_JTAG registers + */ +static inline void usb_phy_ll_int_jtag_enable(usb_serial_jtag_dev_t *hw) +{ + // USB_Serial_JTAG use internal PHY + hw->conf0.phy_sel = 0; + // Disable software control USB D+ D- pullup pulldown (Device FS: dp_pullup = 1) + hw->conf0.pad_pull_override = 0; + // Enable USB D+ pullup + hw->conf0.dp_pullup = 1; + // Enable USB pad function + hw->conf0.usb_pad_enable = 1; +} + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32c3/include/hal/include/hal/adc_hal.h b/tools/sdk/esp32c3/include/hal/include/hal/adc_hal.h index b8455e27ecd..787e50246e6 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/adc_hal.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/adc_hal.h @@ -36,9 +36,6 @@ #define ADC_HAL_DMA_INTR_MASK BIT(9) #endif -//For ADC module, each conversion contains 4 bytes -#define ADC_HAL_DATA_LEN_PER_CONV 4 - typedef enum adc_hal_work_mode_t { ADC_HAL_ULP_MODE, ADC_HAL_SINGLE_READ_MODE, diff --git a/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h b/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h index dc07531e0b9..3490986c28e 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h @@ -161,7 +161,8 @@ typedef struct { typedef struct { union { struct { - uint32_t data: 13; /*! ADC_CHANNEL_MAX), The data is invalid. */ diff --git a/tools/sdk/esp32c3/include/hal/include/hal/i2c_hal.h b/tools/sdk/esp32c3/include/hal/include/hal/i2c_hal.h index b255878cc43..cc56014b634 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/i2c_hal.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/i2c_hal.h @@ -120,6 +120,29 @@ typedef struct { */ #define i2c_hal_set_source_clk(hal, src_clk) i2c_ll_set_source_clk((hal)->dev, src_clk) +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +#define i2c_hal_set_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_set_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +#define i2c_hal_get_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_get_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + /** * @brief Init the I2C master. * diff --git a/tools/sdk/esp32c3/include/hal/include/hal/i2s_hal.h b/tools/sdk/esp32c3/include/hal/include/hal/i2s_hal.h index 037970fa2b3..2be94f66d15 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/i2s_hal.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/i2s_hal.h @@ -125,6 +125,16 @@ void i2s_hal_init(i2s_hal_context_t *hal, int i2s_num); */ void i2s_hal_set_clock_src(i2s_hal_context_t *hal, i2s_clock_src_t sel); +/** + * @brief Calculate the closest sample rate clock configuration. + * clock relationship: + * Fmclk = bck_div*fbck = fsclk/(mclk_div+b/a) + * + * @param clk_cfg I2S clock configuration(input) + * @param cal Point to `i2s_ll_mclk_div_t` structure(output). + */ +void i2s_hal_mclk_div_decimal_cal(i2s_hal_clock_cfg_t *clk_cfg, i2s_ll_mclk_div_t *cal); + /** * @brief Set Tx channel style * @@ -342,8 +352,9 @@ void i2s_hal_rx_set_common_mode(i2s_hal_context_t *hal, const i2s_hal_config_t * * * @param hal Context of the HAL layer * @param sample_rate PDM sample rate + * @param is_mono whether is mono */ -void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate); +void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate, bool is_mono); #endif #if SOC_I2S_SUPPORTS_PDM_RX diff --git a/tools/sdk/esp32c3/include/hal/include/hal/lcd_hal.h b/tools/sdk/esp32c3/include/hal/include/hal/lcd_hal.h index db255b3d1e4..1312b5135e5 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/lcd_hal.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/lcd_hal.h @@ -1,23 +1,52 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include +#include + #ifdef __cplusplus extern "C" { #endif +/** + * @brief LCD peripheral SOC layer handle + */ typedef struct lcd_cam_dev_t *lcd_soc_handle_t; +/** + * @brief LCD HAL layer context + */ typedef struct { - lcd_soc_handle_t dev; + lcd_soc_handle_t dev; // SOC layer handle } lcd_hal_context_t; +/** + * @brief LCD HAL layer initialization + * + * @param hal LCD HAL layer context + * @param id LCD peripheral ID + */ void lcd_hal_init(lcd_hal_context_t *hal, int id); +#define LCD_HAL_PCLK_FLAG_ALLOW_EQUAL_SYSCLK (1 << 0) + +/** + * @brief LCD PCLK clock calculation + * @note Currently this function is only used by RGB LCD driver, I80 driver still uses a fixed clock division + * + * @param hal LCD HAL layer context + * @param src_freq_hz LCD source clock frequency in Hz + * @param expect_pclk_freq_hz Expected LCD PCLK frequency in Hz + * @param lcd_clk_flags Extra flags to control LCD PCLK clock calculation, supported flags are prefixed with LCD_HAL_PCLK_FLAG_ + * @return Actual LCD PCLK frequency in Hz + */ +uint32_t lcd_hal_cal_pclk_freq(lcd_hal_context_t *hal, uint32_t src_freq_hz, uint32_t expect_pclk_freq_hz, int lcd_clk_flags); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h index 13810a79ac3..af11ef64a8d 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h @@ -34,6 +34,39 @@ typedef enum { LCD_CLK_SRC_XTAL, /*!< Select XTAL as the source clock */ } lcd_clock_source_t; +/** + * @brief LCD color space + */ +typedef enum { + LCD_COLOR_SPACE_RGB, /*!< Color space: RGB */ + LCD_COLOR_SPACE_YUV, /*!< Color space: YUV */ +} lcd_color_space_t; + +/** + * @brief LCD color range + */ +typedef enum { + LCD_COLOR_RANGE_LIMIT, /*!< Limited color range */ + LCD_COLOR_RANGE_FULL, /*!< Full color range */ +} lcd_color_range_t; + +/** + * @brief YUV sampling method + */ +typedef enum { + LCD_YUV_SAMPLE_422, /*!< YUV 4:2:2 sampling */ + LCD_YUV_SAMPLE_420, /*!< YUV 4:2:0 sampling */ + LCD_YUV_SAMPLE_411, /*!< YUV 4:1:1 sampling */ +} lcd_yuv_sample_t; + +/** + * @brief The standard used for conversion between RGB and YUV + */ +typedef enum { + LCD_YUV_CONV_STD_BT601, /*!< YUV<->RGB conversion standard: BT.601 */ + LCD_YUV_CONV_STD_BT709, /*!< YUV<->RGB conversion standard: BT.709 */ +} lcd_yuv_conv_std_t; + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/hal/include/hal/spi_types.h b/tools/sdk/esp32c3/include/hal/include/hal/spi_types.h index 169069c5c62..9c008838a19 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/spi_types.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/spi_types.h @@ -55,6 +55,22 @@ typedef struct { uint8_t data_lines; ///< The line width of data phase, e.g. 4-line-data-phase. } spi_line_mode_t; +/** + * @brief SPI command. + */ +typedef enum { + /* Slave HD Only */ + SPI_CMD_HD_WRBUF = BIT(0), + SPI_CMD_HD_RDBUF = BIT(1), + SPI_CMD_HD_WRDMA = BIT(2), + SPI_CMD_HD_RDDMA = BIT(3), + SPI_CMD_HD_SEG_END = BIT(4), + SPI_CMD_HD_EN_QPI = BIT(5), + SPI_CMD_HD_WR_END = BIT(6), + SPI_CMD_HD_INT0 = BIT(7), + SPI_CMD_HD_INT1 = BIT(8), + SPI_CMD_HD_INT2 = BIT(9), +} spi_command_t; /** @cond */ //Doxy command to hide preprocessor definitions from docs */ diff --git a/tools/sdk/esp32c3/include/hal/platform_port/include/hal/assert.h b/tools/sdk/esp32c3/include/hal/platform_port/include/hal/assert.h index 45e9b138741..1bfeada1f59 100644 --- a/tools/sdk/esp32c3/include/hal/platform_port/include/hal/assert.h +++ b/tools/sdk/esp32c3/include/hal/platform_port/include/hal/assert.h @@ -30,7 +30,9 @@ extern void abort(void); #endif #endif -#if CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent +#if IS_ULP_COCPU +#define HAL_ASSERT(__e) ((void)(__e)) +#elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : abort()) #elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 2 // full assertion #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, #__e)) diff --git a/tools/sdk/esp32c3/include/heap/include/esp_heap_caps.h b/tools/sdk/esp32c3/include/heap/include/esp_heap_caps.h index c7d85d4217f..2832b101b5e 100644 --- a/tools/sdk/esp32c3/include/heap/include/esp_heap_caps.h +++ b/tools/sdk/esp32c3/include/heap/include/esp_heap_caps.h @@ -33,7 +33,7 @@ extern "C" { #define MALLOC_CAP_INTERNAL (1<<11) ///< Memory must be internal; specifically it should not disappear when flash/spiram cache is switched off #define MALLOC_CAP_DEFAULT (1<<12) ///< Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call #define MALLOC_CAP_IRAM_8BIT (1<<13) ///< Memory must be in IRAM and allow unaligned access -#define MALLOC_CAP_RETENTION (1<<14) +#define MALLOC_CAP_RETENTION (1<<14) ///< Memory must be able to accessed by retention DMA #define MALLOC_CAP_RTCRAM (1<<15) ///< Memory must be in RTC fast memory #define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker @@ -58,8 +58,6 @@ esp_err_t heap_caps_register_failed_alloc_callback(esp_alloc_failed_hook_t callb * * Equivalent semantics to libc malloc(), for capability-aware memory. * - * In IDF, ``malloc(p)`` is equivalent to ``heap_caps_malloc(p, MALLOC_CAP_8BIT)``. - * * @param size Size, in bytes, of the amount of memory to allocate * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type * of memory to be returned diff --git a/tools/sdk/esp32c3/include/nvs_flash/include/nvs.h b/tools/sdk/esp32c3/include/nvs_flash/include/nvs.h index 0faef98fd3d..a800d4d1847 100644 --- a/tools/sdk/esp32c3/include/nvs_flash/include/nvs.h +++ b/tools/sdk/esp32c3/include/nvs_flash/include/nvs.h @@ -132,6 +132,8 @@ typedef struct nvs_opaque_iterator_t *nvs_iterator_t; * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); @@ -161,6 +163,8 @@ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *ou * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open_from_partition(const char *part_name, const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); diff --git a/tools/sdk/esp32c3/include/protocomm/include/transports/protocomm_ble.h b/tools/sdk/esp32c3/include/protocomm/include/transports/protocomm_ble.h index d684e7e921a..0efb31c2134 100644 --- a/tools/sdk/esp32c3/include/protocomm/include/transports/protocomm_ble.h +++ b/tools/sdk/esp32c3/include/protocomm/include/transports/protocomm_ble.h @@ -52,7 +52,7 @@ typedef struct protocomm_ble_config { /** * BLE device name being broadcast at the time of provisioning */ - char device_name[MAX_BLE_DEVNAME_LEN]; + char device_name[MAX_BLE_DEVNAME_LEN + 1]; /** * 128 bit UUID of the provisioning service diff --git a/tools/sdk/esp32c3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h b/tools/sdk/esp32c3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h index 9355d034ef4..59f2224a9a9 100644 --- a/tools/sdk/esp32c3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h +++ b/tools/sdk/esp32c3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h @@ -11,10 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once + #include #include #include + #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/adc_channel.h b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/adc_channel.h index 9a645006c44..49f3ca9cb77 100644 --- a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/adc_channel.h +++ b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/adc_channel.h @@ -15,19 +15,19 @@ #ifndef _SOC_ADC_CHANNEL_H #define _SOC_ADC_CHANNEL_H -#define ADC1_GPIO1_CHANNEL ADC1_CHANNEL_0 +#define ADC1_GPIO0_CHANNEL ADC1_CHANNEL_0 #define ADC1_CHANNEL_0_GPIO_NUM 0 -#define ADC1_GPIO2_CHANNEL ADC1_CHANNEL_1 +#define ADC1_GPIO1_CHANNEL ADC1_CHANNEL_1 #define ADC1_CHANNEL_1_GPIO_NUM 1 -#define ADC1_GPIO3_CHANNEL ADC1_CHANNEL_2 +#define ADC1_GPIO2_CHANNEL ADC1_CHANNEL_2 #define ADC1_CHANNEL_2_GPIO_NUM 2 -#define ADC1_GPIO4_CHANNEL ADC1_CHANNEL_3 +#define ADC1_GPIO3_CHANNEL ADC1_CHANNEL_3 #define ADC1_CHANNEL_3_GPIO_NUM 3 -#define ADC1_GPIO5_CHANNEL ADC1_CHANNEL_4 +#define ADC1_GPIO4_CHANNEL ADC1_CHANNEL_4 #define ADC1_CHANNEL_4_GPIO_NUM 4 #define ADC2_GPIO5_CHANNEL ADC2_CHANNEL_0 diff --git a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/io_mux_reg.h b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/io_mux_reg.h index 618f8fa5d30..7eb6d258673 100644 --- a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/io_mux_reg.h +++ b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/io_mux_reg.h @@ -138,6 +138,9 @@ #define SD_DATA2_GPIO_NUM 9 #define SD_DATA3_GPIO_NUM 10 +#define USB_DM_GPIO_NUM 18 +#define USB_DP_GPIO_NUM 19 + #define MAX_RTC_GPIO_NUM 5 #define MAX_PAD_GPIO_NUM 21 #define MAX_GPIO_NUM 25 diff --git a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/rtc.h b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/rtc.h index 5222da63ad7..75a19cc0944 100644 --- a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/rtc.h +++ b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/rtc.h @@ -49,7 +49,10 @@ extern "C" { #define RTC_SLOW_CLK_8MD256_CAL_TIMEOUT_THRES(cycles) (cycles << 12) #define RTC_SLOW_CLK_150K_CAL_TIMEOUT_THRES(cycles) (cycles << 10) -#define RTC_SLOW_CLK_FREQ_150K 150000 +// On esp32c3, RC_SLOW_CLK has a freq of ~136kHz +#define SOC_CLK_RC_SLOW_FREQ_APPROX 136000 +// '150K' does not mean the actual freq, it represents the clock source is RC_SLOW_CLK. RC_SLOW_CLK has a freq of ~150kHz only on esp32. +#define RTC_SLOW_CLK_FREQ_150K SOC_CLK_RC_SLOW_FREQ_APPROX #define RTC_SLOW_CLK_FREQ_8MD256 (RTC_FAST_CLK_FREQ_APPROX / 256) #define RTC_SLOW_CLK_FREQ_32K 32768 @@ -74,7 +77,7 @@ extern "C" { #define DELAY_SLOW_CLK_SWITCH 300 #define DELAY_8M_ENABLE 50 -/* Number of 8M/256 clock cycles to use for XTAL frequency estimation. +/* Number of RC_FAST_D256 clock cycles to use for XTAL frequency estimation. * 10 cycles will take approximately 300 microseconds. */ #define XTAL_FREQ_EST_CYCLES 10 @@ -155,7 +158,7 @@ typedef enum { typedef enum { RTC_CPU_FREQ_SRC_XTAL, //!< XTAL RTC_CPU_FREQ_SRC_PLL, //!< PLL (480M or 320M) - RTC_CPU_FREQ_SRC_8M, //!< Internal 8M RTC oscillator + RTC_CPU_FREQ_SRC_8M, //!< Internal 17.5M RC oscillator RTC_CPU_FREQ_SRC_APLL //!< APLL } rtc_cpu_freq_src_t; @@ -173,9 +176,9 @@ typedef struct rtc_cpu_freq_config_s { * @brief RTC SLOW_CLK frequency values */ typedef enum { - RTC_SLOW_FREQ_RTC = 0, //!< Internal 150 kHz RC oscillator + RTC_SLOW_FREQ_RTC = 0, //!< Internal 136 kHz RC oscillator RTC_SLOW_FREQ_32K_XTAL = 1, //!< External 32 kHz XTAL - RTC_SLOW_FREQ_8MD256 = 2, //!< Internal 8 MHz RC oscillator, divided by 256 + RTC_SLOW_FREQ_8MD256 = 2, //!< Internal 17.5 MHz RC oscillator, divided by 256 } rtc_slow_freq_t; /** @@ -183,11 +186,11 @@ typedef enum { */ typedef enum { RTC_FAST_FREQ_XTALD4 = 0, //!< Main XTAL, divided by 4 - RTC_FAST_FREQ_8M = 1, //!< Internal 8 MHz RC oscillator + RTC_FAST_FREQ_8M = 1, //!< Internal 17.5 MHz RC oscillator } rtc_fast_freq_t; -/* With the default value of CK8M_DFREQ, 8M clock frequency is 8.5 MHz +/- 7% */ -#define RTC_FAST_CLK_FREQ_APPROX 8500000 +/* With the default value of CK8M_DFREQ, RTC_FAST clock frequency is 17.5 MHz +/- 7% */ +#define RTC_FAST_CLK_FREQ_APPROX 17500000 #define RTC_CLK_CAL_FRACT 19 //!< Number of fractional bits in values returned by rtc_clk_cal @@ -199,9 +202,9 @@ typedef enum { */ typedef enum { RTC_CAL_RTC_MUX = 0, //!< Currently selected RTC SLOW_CLK - RTC_CAL_8MD256 = 1, //!< Internal 8 MHz RC oscillator, divided by 256 + RTC_CAL_8MD256 = 1, //!< Internal 17.5 MHz RC oscillator, divided by 256 RTC_CAL_32K_XTAL = 2, //!< External 32 kHz XTAL - RTC_CAL_INTERNAL_OSC = 3 //!< Internal 150 kHz oscillator + RTC_CAL_INTERNAL_OSC = 3 //!< Internal 136 kHz oscillator } rtc_cal_sel_t; /** @@ -213,9 +216,9 @@ typedef struct { rtc_fast_freq_t fast_freq : 1; //!< RTC_FAST_CLK frequency to set rtc_slow_freq_t slow_freq : 2; //!< RTC_SLOW_CLK frequency to set uint32_t clk_rtc_clk_div : 8; - uint32_t clk_8m_clk_div : 3; //!< RTC 8M clock divider (division is by clk_8m_div+1, i.e. 0 means 8MHz frequency) - uint32_t slow_clk_dcap : 8; //!< RTC 150k clock adjustment parameter (higher value leads to lower frequency) - uint32_t clk_8m_dfreq : 8; //!< RTC 8m clock adjustment parameter (higher value leads to higher frequency) + uint32_t clk_8m_clk_div : 3; //!< RTC_FAST_CLK source RC_FAST clock divider (division is by clk_8m_div+1, i.e. 0 means ~17.5MHz frequency) + uint32_t slow_clk_dcap : 8; //!< RC_SLOW clock adjustment parameter (higher value leads to lower frequency) + uint32_t clk_8m_dfreq : 8; //!< RC_FAST clock adjustment parameter (higher value leads to higher frequency) } rtc_clk_config_t; /** @@ -333,31 +336,31 @@ bool rtc_clk_32k_enabled(void); void rtc_clk_32k_bootstrap(uint32_t cycle); /** - * @brief Enable or disable 8 MHz internal oscillator + * @brief Enable or disable 17.5 MHz internal oscillator * - * Output from 8 MHz internal oscillator is passed into a configurable + * Output from 17.5 MHz internal oscillator is passed into a configurable * divider, which by default divides the input clock frequency by 256. * Output of the divider may be used as RTC_SLOW_CLK source. * Output of the divider is referred to in register descriptions and code as * 8md256 or simply d256. Divider values other than 256 may be configured, but * this facility is not currently needed, so is not exposed in the code. * - * When 8MHz/256 divided output is not needed, the divider should be disabled + * When RC_FAST_D256 divided output is not needed, the divider should be disabled * to reduce power consumption. * - * @param clk_8m_en true to enable 8MHz generator + * @param clk_8m_en true to enable 17.5MHz generator * @param d256_en true to enable /256 divider */ void rtc_clk_8m_enable(bool clk_8m_en, bool d256_en); /** - * @brief Get the state of 8 MHz internal oscillator + * @brief Get the state of 17.5 MHz internal oscillator * @return true if the oscillator is enabled */ bool rtc_clk_8m_enabled(void); /** - * @brief Get the state of /256 divider which is applied to 8MHz clock + * @brief Get the state of /256 divider which is applied to 17.5MHz clock * @return true if the divided output is enabled */ bool rtc_clk_8md256_enabled(void); @@ -395,9 +398,9 @@ rtc_slow_freq_t rtc_clk_slow_freq_get(void); /** * @brief Get the approximate frequency of RTC_SLOW_CLK, in Hz * - * - if RTC_SLOW_FREQ_RTC is selected, returns ~150000 + * - if RTC_SLOW_FREQ_RTC is selected, returns 136000 * - if RTC_SLOW_FREQ_32K_XTAL is selected, returns 32768 - * - if RTC_SLOW_FREQ_8MD256 is selected, returns ~33000 + * - if RTC_SLOW_FREQ_8MD256 is selected, returns ~68000 * * rtc_clk_cal function can be used to get more precise value by comparing * RTC_SLOW_CLK frequency to the frequency of main XTAL. @@ -507,6 +510,11 @@ uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles); * 32k XTAL is being calibrated, but the oscillator has not started up (due to * incorrect loading capacitance, board design issue, or lack of 32 XTAL on board). * + * @note When 32k CLK is being calibrated, this function will check the accuracy + * of the clock. Since the xtal 32k or ext osc 32k is generally very stable, if + * the check fails, then consider this an invalid 32k clock and return 0. This + * check can filter some jamming signal. + * * @param cal_clk clock to be measured * @param slow_clk_cycles number of slow clock cycles to average * @return average slow clock period in microseconds, Q13.19 fixed point format, @@ -568,22 +576,22 @@ uint64_t rtc_deep_slp_time_get(void); void rtc_clk_wait_for_slow_cycle(void); /** - * @brief Enable the rtc digital 8M clock + * @brief Enable the digital RC_FAST_CLK * - * This function is used to enable the digital rtc 8M clock to support peripherals. - * For enabling the analog 8M clock, using `rtc_clk_8M_enable` function above. + * This function is used to enable the digital RC_FAST clock to support peripherals. + * For enabling the analog 17.5M clock, using `rtc_clk_8M_enable` function above. */ void rtc_dig_clk8m_enable(void); /** - * @brief Disable the rtc digital 8M clock + * @brief Disable the digital RC_FAST_CLK * - * This function is used to disable the digital rtc 8M clock, which is only used to support peripherals. + * This function is used to disable the digital RC_FAST clock, which is only used to support peripherals. */ void rtc_dig_clk8m_disable(void); /** - * @brief Get whether the rtc digital 8M clock is enabled + * @brief Get whether the digital RC_FAST_CLK is enabled */ bool rtc_dig_8m_enabled(void); @@ -639,7 +647,7 @@ typedef struct { uint32_t wifi_pd_en : 1; //!< power down WiFi uint32_t bt_pd_en : 1; //!< power down BT uint32_t cpu_pd_en : 1; //!< power down CPU, but not restart when lightsleep. - uint32_t int_8m_pd_en : 1; //!< Power down Internal 8M oscillator + uint32_t int_8m_pd_en : 1; //!< Power down Internal 17.5M oscillator uint32_t dig_peri_pd_en : 1; //!< power down digital peripherals uint32_t deep_slp : 1; //!< power down digital domain uint32_t wdt_flashboot_mod_en : 1; //!< enable WDT flashboot mode @@ -669,7 +677,7 @@ typedef struct { #define RTC_SLEEP_PD_BT BIT(7) //!< Power down BT #define RTC_SLEEP_PD_CPU BIT(8) //!< Power down CPU when in lightsleep, but not restart #define RTC_SLEEP_PD_DIG_PERIPH BIT(9) //!< Power down DIG peripherals -#define RTC_SLEEP_PD_INT_8M BIT(10) //!< Power down Internal 8M oscillator +#define RTC_SLEEP_PD_INT_8M BIT(10) //!< Power down Internal 17.5M oscillator #define RTC_SLEEP_PD_XTAL BIT(11) //!< Power down main XTAL //These flags are not power domains, but will affect some sleep parameters @@ -785,7 +793,7 @@ uint32_t rtc_deep_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt); * RTC power and clock control initialization settings */ typedef struct { - uint32_t ck8m_wait : 8; //!< Number of rtc_fast_clk cycles to wait for 8M clock to be ready + uint32_t ck8m_wait : 8; //!< Number of rtc_fast_clk cycles to wait for 17.5M clock to be ready uint32_t xtal_wait : 8; //!< Number of rtc_fast_clk cycles to wait for XTAL clock to be ready uint32_t pll_wait : 8; //!< Number of rtc_fast_clk cycles to wait for PLL to be ready uint32_t clkctl_init : 1; //!< Perform clock control related initialization diff --git a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc.h b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc.h index 72dbb15a609..574cb8d3b12 100644 --- a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc.h +++ b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc.h @@ -238,6 +238,10 @@ #define SOC_DIRAM_DRAM_LOW 0x3FC80000 #define SOC_DIRAM_DRAM_HIGH 0x3FCE0000 +#define SOC_I_D_OFFSET (SOC_DIRAM_IRAM_LOW - SOC_DIRAM_DRAM_LOW) +#define MAP_DRAM_TO_IRAM(addr) (addr + SOC_I_D_OFFSET) +#define MAP_IRAM_TO_DRAM(addr) (addr - SOC_I_D_OFFSET) + // Region of memory accessible via DMA. See esp_ptr_dma_capable(). #define SOC_DMA_LOW 0x3FC88000 #define SOC_DMA_HIGH 0x3FD00000 @@ -250,10 +254,6 @@ //(excluding RTC data region, that's checked separately.) See esp_ptr_internal(). #define SOC_MEM_INTERNAL_LOW 0x3FC80000 #define SOC_MEM_INTERNAL_HIGH 0x3FCE0000 -#define SOC_MEM_INTERNAL_LOW1 0x40370000 -#define SOC_MEM_INTERNAL_HIGH1 0x403E0000 -#define SOC_MEM_INTERNAL_LOW2 0x600FE000 -#define SOC_MEM_INTERNAL_HIGH2 0x60100000 #define SOC_MAX_CONTIGUOUS_RAM_SIZE (SOC_IRAM_HIGH - SOC_IRAM_LOW) ///< Largest span of contiguous memory (DRAM or IRAM) in the address space @@ -266,7 +266,8 @@ #define SOC_DEBUG_HIGH 0x28000000 // Start (highest address) of ROM boot stack, only relevant during early boot -#define SOC_ROM_STACK_START 0x3fcebf10 +#define SOC_ROM_STACK_START 0x3fcde710 +#define SOC_ROM_STACK_SIZE 0x2000 //On RISC-V CPUs, the interrupt sources are all external interrupts, whose type, source and priority are configured by SW. //There is no HW NMI conception. SW should controlled the masked levels through INT_THRESH_REG. diff --git a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc_caps.h b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc_caps.h index 56b20dc884f..91aee64f270 100644 --- a/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc_caps.h +++ b/tools/sdk/esp32c3/include/soc/esp32c3/include/soc/soc_caps.h @@ -56,6 +56,8 @@ #define SOC_ADC_DIGI_CONTROLLER_NUM (1U) #define SOC_ADC_PATT_LEN_MAX (8) /*!< One pattern table, each contains 8 items. Each item takes 1 byte */ #define SOC_ADC_DIGI_MAX_BITWIDTH (12) +#define SOC_ADC_DIGI_RESULT_BYTES (4) +#define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4) #define SOC_ADC_DIGI_FILTER_NUM (2) #define SOC_ADC_DIGI_MONITOR_NUM (2) /*!< F_sample = F_digi_con / 2 / interval. F_digi_con = 5M for now. 30 <= interva <= 4095 */ @@ -210,6 +212,7 @@ /*-------------------------- SPI CAPS ----------------------------------------*/ #define SOC_SPI_PERIPH_NUM 2 #define SOC_SPI_PERIPH_CS_NUM(i) 6 +#define SOC_SPI_MAX_CS_NUM 6 #define SOC_SPI_MAXIMUM_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32c3/include/soc/include/soc/spi_periph.h b/tools/sdk/esp32c3/include/soc/include/soc/spi_periph.h index 7aa38650356..d93abf87ef4 100644 --- a/tools/sdk/esp32c3/include/soc/include/soc/spi_periph.h +++ b/tools/sdk/esp32c3/include/soc/include/soc/spi_periph.h @@ -66,7 +66,7 @@ typedef struct { const uint8_t spid6_in; const uint8_t spid7_in; #endif // SOC_SPI_SUPPORT_OCT - const uint8_t spics_out[3]; // /CS GPIO output mux signals + const uint8_t spics_out[SOC_SPI_MAX_CS_NUM]; // /CS GPIO output mux signals const uint8_t spics_in; const uint8_t spidqs_out; const uint8_t spicd_out; diff --git a/tools/sdk/esp32c3/include/spi_flash/include/esp_private/spi_flash_os.h b/tools/sdk/esp32c3/include/spi_flash/include/esp_private/spi_flash_os.h index e73511bc117..996606dbcee 100644 --- a/tools/sdk/esp32c3/include/spi_flash/include/esp_private/spi_flash_os.h +++ b/tools/sdk/esp32c3/include/spi_flash/include/esp_private/spi_flash_os.h @@ -34,11 +34,32 @@ #endif #include "esp_flash.h" #include "hal/spi_flash_hal.h" +#include "soc/soc_caps.h" #ifdef __cplusplus extern "C" { #endif +// Type of MSPI IO +typedef enum { + ESP_MSPI_IO_CLK = 0, + ESP_MSPI_IO_Q, + ESP_MSPI_IO_D, + ESP_MSPI_IO_CS0, /* cs for spi flash */ + ESP_MSPI_IO_HD, + ESP_MSPI_IO_WP, +#if SOC_SPI_MEM_SUPPORT_OPI_MODE + ESP_MSPI_IO_DQS, + ESP_MSPI_IO_D4, + ESP_MSPI_IO_D5, + ESP_MSPI_IO_D6, + ESP_MSPI_IO_D7, +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE +#if CONFIG_SPIRAM + ESP_MSPI_IO_CS1 /* cs for spi ram */ +#endif +} esp_mspi_io_t; + /** * @brief To setup Flash chip */ @@ -80,6 +101,15 @@ void spi_timing_psram_tuning(void); */ void esp_mspi_pin_init(void); +/** + * @brief Get the number of the GPIO corresponding to the given MSPI io + * + * @param[in] io MSPI io + * + * @return MSPI IO number + */ +uint8_t esp_mspi_get_io(esp_mspi_io_t io); + /** * @brief Set SPI1 registers to make ROM functions work * @note This function is used for setting SPI1 registers to the state that ROM SPI functions work diff --git a/tools/sdk/esp32c3/include/tcp_transport/include/esp_transport.h b/tools/sdk/esp32c3/include/tcp_transport/include/esp_transport.h index 5c7f2f77ed2..979bd7130c8 100644 --- a/tools/sdk/esp32c3/include/tcp_transport/include/esp_transport.h +++ b/tools/sdk/esp32c3/include/tcp_transport/include/esp_transport.h @@ -32,7 +32,7 @@ typedef struct esp_transport_keepalive { int keep_alive_count; /*!< Keep-alive packet retry send count */ } esp_transport_keep_alive_t; -typedef struct esp_transport_internal* esp_transport_list_handle_t; +typedef struct esp_transport_list_t* esp_transport_list_handle_t; typedef struct esp_transport_item_t* esp_transport_handle_t; typedef int (*connect_func)(esp_transport_handle_t t, const char *host, int port, int timeout_ms); @@ -45,6 +45,10 @@ typedef esp_transport_handle_t (*payload_transfer_func)(esp_transport_handle_t); typedef struct esp_tls_last_error* esp_tls_error_handle_t; +/** + * @brief Error types for TCP connection issues not covered in socket's errno + */ + /** * @brief Create transport list * @@ -340,6 +344,7 @@ esp_tls_error_handle_t esp_transport_get_error_handle(esp_transport_handle_t t); */ int esp_transport_get_errno(esp_transport_handle_t t); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/wpa_supplicant/port/include/supplicant_opt.h b/tools/sdk/esp32c3/include/wpa_supplicant/port/include/supplicant_opt.h index 59b428d5462..da753327694 100644 --- a/tools/sdk/esp32c3/include/wpa_supplicant/port/include/supplicant_opt.h +++ b/tools/sdk/esp32c3/include/wpa_supplicant/port/include/supplicant_opt.h @@ -29,9 +29,6 @@ #define DEBUG_PRINT #endif -#if CONFIG_WPA_11KV_SUPPORT -#define ROAMING_SUPPORT 1 -#endif #if CONFIG_WPA_SCAN_CACHE #define SCAN_CACHE_SUPPORTED diff --git a/tools/sdk/esp32c3/ld/esp32c3.rom.ld b/tools/sdk/esp32c3/ld/esp32c3.rom.ld index dfae6c9270b..61d7034aeb6 100644 --- a/tools/sdk/esp32c3/ld/esp32c3.rom.ld +++ b/tools/sdk/esp32c3/ld/esp32c3.rom.ld @@ -1545,7 +1545,7 @@ pm_set_beacon_filter = 0x4000166c; pm_is_in_wifi_slice_threshold = 0x40001670; pm_is_waked = 0x40001674; pm_keep_alive = 0x40001678; -pm_on_beacon_rx = 0x4000167c; +/* pm_on_beacon_rx = 0x4000167c; */ pm_on_data_rx = 0x40001680; pm_on_tbtt = 0x40001684; pm_parse_beacon = 0x40001688; @@ -1554,7 +1554,7 @@ pm_process_tim = 0x4000168c; pm_rx_data_process = 0x40001694; /*pm_sleep = 0x40001698;*/ pm_sleep_for = 0x4000169c; -pm_tbtt_process = 0x400016a0; +/* pm_tbtt_process = 0x400016a0; */ ppAMPDU2Normal = 0x400016a4; ppAssembleAMPDU = 0x400016a8; ppCalFrameTimes = 0x400016ac; @@ -1634,7 +1634,7 @@ wdev_mac_special_reg_store = 0x400017e0; wdev_mac_wakeup = 0x400017e4; wdev_mac_sleep = 0x400017e8; hal_mac_is_dma_enable = 0x400017ec; -wDev_ProcessFiq = 0x400017f0; +/* wDev_ProcessFiq = 0x400017f0; */ wDev_ProcessRxSucData = 0x400017f4; wdevProcessRxSucDataAll = 0x400017f8; wdev_csi_len_align = 0x400017fc; diff --git a/tools/sdk/esp32c3/ld/libbtdm_app.a b/tools/sdk/esp32c3/ld/libbtdm_app.a index e5be73f4c62..dcba8f5d98b 100644 Binary files a/tools/sdk/esp32c3/ld/libbtdm_app.a and b/tools/sdk/esp32c3/ld/libbtdm_app.a differ diff --git a/tools/sdk/esp32c3/ld/libcat_face_detect.a b/tools/sdk/esp32c3/ld/libcat_face_detect.a index 92ffea09ff7..a8f07c5306e 100644 Binary files a/tools/sdk/esp32c3/ld/libcat_face_detect.a and b/tools/sdk/esp32c3/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32c3/ld/libcolor_detect.a b/tools/sdk/esp32c3/ld/libcolor_detect.a index e073722fb38..673e3ca97f2 100644 Binary files a/tools/sdk/esp32c3/ld/libcolor_detect.a and b/tools/sdk/esp32c3/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32c3/ld/libdl.a b/tools/sdk/esp32c3/ld/libdl.a index 76e1b7c50bc..4d17fc89deb 100644 Binary files a/tools/sdk/esp32c3/ld/libdl.a and b/tools/sdk/esp32c3/ld/libdl.a differ diff --git a/tools/sdk/esp32c3/ld/libhuman_face_detect.a b/tools/sdk/esp32c3/ld/libhuman_face_detect.a index d91b25cc251..51e2793cbc1 100644 Binary files a/tools/sdk/esp32c3/ld/libhuman_face_detect.a and b/tools/sdk/esp32c3/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32c3/ld/libmfn.a b/tools/sdk/esp32c3/ld/libmfn.a index a1d56e467c8..fff3cf7b643 100644 Binary files a/tools/sdk/esp32c3/ld/libmfn.a and b/tools/sdk/esp32c3/ld/libmfn.a differ diff --git a/tools/sdk/esp32c3/ld/sections.ld b/tools/sdk/esp32c3/ld/sections.ld index 0ccca859ca0..64c8d4758ae 100644 --- a/tools/sdk/esp32c3/ld/sections.ld +++ b/tools/sdk/esp32c3/ld/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32c3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32c3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -310,8 +310,8 @@ SECTIONS _bss_start = ABSOLUTE(.); *(.bss .bss.*) - *(.ext_ram.bss .ext_ram.bss.*) *(.dynbss .dynsbss .gnu.linkonce.b .gnu.linkonce.b.* .gnu.linkonce.sb .gnu.linkonce.sb.* .gnu.linkonce.sb2 .gnu.linkonce.sb2.* .sbss .sbss.* .sbss2 .sbss2.* .scommon .share.mem) + *(.ext_ram.bss .ext_ram.bss.*) *(COMMON) _bt_bss_start = ABSOLUTE(.); *libbt.a:(.bss .bss.* COMMON) @@ -424,8 +424,8 @@ SECTIONS { _flash_rodata_start = ABSOLUTE(.); - *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .srodata.*) *(.rodata_wlog_error .rodata_wlog_error.*) + *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libgcc.a:save-restore.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.*) .srodata.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ *(.gnu.linkonce.r.*) diff --git a/tools/sdk/esp32c3/lib/libapp_trace.a b/tools/sdk/esp32c3/lib/libapp_trace.a index 7564b09114e..0aa1aea81bb 100644 Binary files a/tools/sdk/esp32c3/lib/libapp_trace.a and b/tools/sdk/esp32c3/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32c3/lib/libapp_update.a b/tools/sdk/esp32c3/lib/libapp_update.a index 70cb3ebb3e6..2c7cc1933ed 100644 Binary files a/tools/sdk/esp32c3/lib/libapp_update.a and b/tools/sdk/esp32c3/lib/libapp_update.a differ diff --git a/tools/sdk/esp32c3/lib/libasio.a b/tools/sdk/esp32c3/lib/libasio.a index 31e7ab2227b..8edcb880d40 100644 Binary files a/tools/sdk/esp32c3/lib/libasio.a and b/tools/sdk/esp32c3/lib/libasio.a differ diff --git a/tools/sdk/esp32c3/lib/libbootloader_support.a b/tools/sdk/esp32c3/lib/libbootloader_support.a index e067f27aac7..62c42012164 100644 Binary files a/tools/sdk/esp32c3/lib/libbootloader_support.a and b/tools/sdk/esp32c3/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32c3/lib/libbt.a b/tools/sdk/esp32c3/lib/libbt.a index 85dbd49eacf..bcdaa73c9d2 100644 Binary files a/tools/sdk/esp32c3/lib/libbt.a and b/tools/sdk/esp32c3/lib/libbt.a differ diff --git a/tools/sdk/esp32c3/lib/libcbor.a b/tools/sdk/esp32c3/lib/libcbor.a index 9d2fd145b1c..6b8d229e5dc 100644 Binary files a/tools/sdk/esp32c3/lib/libcbor.a and b/tools/sdk/esp32c3/lib/libcbor.a differ diff --git a/tools/sdk/esp32c3/lib/libcmock.a b/tools/sdk/esp32c3/lib/libcmock.a index a8461d61d6d..0cde875bf3c 100644 Binary files a/tools/sdk/esp32c3/lib/libcmock.a and b/tools/sdk/esp32c3/lib/libcmock.a differ diff --git a/tools/sdk/esp32c3/lib/libcoap.a b/tools/sdk/esp32c3/lib/libcoap.a index 6515e5f0be4..7413a0bff75 100644 Binary files a/tools/sdk/esp32c3/lib/libcoap.a and b/tools/sdk/esp32c3/lib/libcoap.a differ diff --git a/tools/sdk/esp32c3/lib/libcoexist.a b/tools/sdk/esp32c3/lib/libcoexist.a index 533272c3ada..91354dcb869 100644 Binary files a/tools/sdk/esp32c3/lib/libcoexist.a and b/tools/sdk/esp32c3/lib/libcoexist.a differ diff --git a/tools/sdk/esp32c3/lib/libconsole.a b/tools/sdk/esp32c3/lib/libconsole.a index 6f84bc4cd4c..2cd518a81e6 100644 Binary files a/tools/sdk/esp32c3/lib/libconsole.a and b/tools/sdk/esp32c3/lib/libconsole.a differ diff --git a/tools/sdk/esp32c3/lib/libcore.a b/tools/sdk/esp32c3/lib/libcore.a index ca6d3671a7b..77c4b01926c 100644 Binary files a/tools/sdk/esp32c3/lib/libcore.a and b/tools/sdk/esp32c3/lib/libcore.a differ diff --git a/tools/sdk/esp32c3/lib/libcxx.a b/tools/sdk/esp32c3/lib/libcxx.a index 632eef82b92..45fb23f4cff 100644 Binary files a/tools/sdk/esp32c3/lib/libcxx.a and b/tools/sdk/esp32c3/lib/libcxx.a differ diff --git a/tools/sdk/esp32c3/lib/libdriver.a b/tools/sdk/esp32c3/lib/libdriver.a index cc26db02f58..4c6860ceb8a 100644 Binary files a/tools/sdk/esp32c3/lib/libdriver.a and b/tools/sdk/esp32c3/lib/libdriver.a differ diff --git a/tools/sdk/esp32c3/lib/libefuse.a b/tools/sdk/esp32c3/lib/libefuse.a index ed15c1191a6..247ba0e4848 100644 Binary files a/tools/sdk/esp32c3/lib/libefuse.a and b/tools/sdk/esp32c3/lib/libefuse.a differ diff --git a/tools/sdk/esp32c3/lib/libesp-dsp.a b/tools/sdk/esp32c3/lib/libesp-dsp.a index 65b587d0acd..9088ed79314 100644 Binary files a/tools/sdk/esp32c3/lib/libesp-dsp.a and b/tools/sdk/esp32c3/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32c3/lib/libesp-tls.a b/tools/sdk/esp32c3/lib/libesp-tls.a index b42bd4a6a6b..1cea74126c8 100644 Binary files a/tools/sdk/esp32c3/lib/libesp-tls.a and b/tools/sdk/esp32c3/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32c3/lib/libesp32-camera.a b/tools/sdk/esp32c3/lib/libesp32-camera.a index 9ce21fa220c..27fa9e13fe1 100644 Binary files a/tools/sdk/esp32c3/lib/libesp32-camera.a and b/tools/sdk/esp32c3/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_adc_cal.a b/tools/sdk/esp32c3/lib/libesp_adc_cal.a index 985566335c7..7321dd60f3f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_adc_cal.a and b/tools/sdk/esp32c3/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_common.a b/tools/sdk/esp32c3/lib/libesp_common.a index 7c29bd6b8f3..799318c0252 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_common.a and b/tools/sdk/esp32c3/lib/libesp_common.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_eth.a b/tools/sdk/esp32c3/lib/libesp_eth.a index 7292c582dd3..291bc9a10ac 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_eth.a and b/tools/sdk/esp32c3/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_event.a b/tools/sdk/esp32c3/lib/libesp_event.a index ae1ae34e39d..3f2b238cbb3 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_event.a and b/tools/sdk/esp32c3/lib/libesp_event.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_gdbstub.a b/tools/sdk/esp32c3/lib/libesp_gdbstub.a index 6f9739a03d5..1bad075cbd0 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_gdbstub.a and b/tools/sdk/esp32c3/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_hid.a b/tools/sdk/esp32c3/lib/libesp_hid.a index 04ec9bcfa59..5dcfb0440fa 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_hid.a and b/tools/sdk/esp32c3/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_http_client.a b/tools/sdk/esp32c3/lib/libesp_http_client.a index 176b6a898d3..e59f798c0cd 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_http_client.a and b/tools/sdk/esp32c3/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_http_server.a b/tools/sdk/esp32c3/lib/libesp_http_server.a index 20119d65724..7a07f2569cc 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_http_server.a and b/tools/sdk/esp32c3/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_https_ota.a b/tools/sdk/esp32c3/lib/libesp_https_ota.a index 8411cb47918..9aaccf8c228 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_https_ota.a and b/tools/sdk/esp32c3/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_https_server.a b/tools/sdk/esp32c3/lib/libesp_https_server.a index cfa67d53545..565efddfb0b 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_https_server.a and b/tools/sdk/esp32c3/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_hw_support.a b/tools/sdk/esp32c3/lib/libesp_hw_support.a index d06f5c7d666..586432c1aea 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_hw_support.a and b/tools/sdk/esp32c3/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_ipc.a b/tools/sdk/esp32c3/lib/libesp_ipc.a index 32bcd7f214d..fe1ac0ffd7e 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_ipc.a and b/tools/sdk/esp32c3/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_lcd.a b/tools/sdk/esp32c3/lib/libesp_lcd.a index f228736f91c..164296786f9 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_lcd.a and b/tools/sdk/esp32c3/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_littlefs.a b/tools/sdk/esp32c3/lib/libesp_littlefs.a index f24eca069ca..93a3774147f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_littlefs.a and b/tools/sdk/esp32c3/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_local_ctrl.a b/tools/sdk/esp32c3/lib/libesp_local_ctrl.a index dd956332a64..53a533be576 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_local_ctrl.a and b/tools/sdk/esp32c3/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_netif.a b/tools/sdk/esp32c3/lib/libesp_netif.a index 05ee91018cc..0f56f7ee64f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_netif.a and b/tools/sdk/esp32c3/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_phy.a b/tools/sdk/esp32c3/lib/libesp_phy.a index f83ca100d93..a14f34c3e4b 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_phy.a and b/tools/sdk/esp32c3/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_pm.a b/tools/sdk/esp32c3/lib/libesp_pm.a index 64d9a294010..e659c1f57e8 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_pm.a and b/tools/sdk/esp32c3/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_rainmaker.a b/tools/sdk/esp32c3/lib/libesp_rainmaker.a index b81bc9d8b2d..4acd548aef0 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_rainmaker.a and b/tools/sdk/esp32c3/lib/libesp_rainmaker.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_ringbuf.a b/tools/sdk/esp32c3/lib/libesp_ringbuf.a index cbb21343a17..d01e40e580c 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_ringbuf.a and b/tools/sdk/esp32c3/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_rom.a b/tools/sdk/esp32c3/lib/libesp_rom.a index 95243d9499e..a3da84b2ff1 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_rom.a and b/tools/sdk/esp32c3/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_schedule.a b/tools/sdk/esp32c3/lib/libesp_schedule.a index eac19120c06..7527b198d5e 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_schedule.a and b/tools/sdk/esp32c3/lib/libesp_schedule.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a b/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a index 3fa3bd7c9da..3790af9f411 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_system.a b/tools/sdk/esp32c3/lib/libesp_system.a index 9e3f46389f5..f78186dae20 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_system.a and b/tools/sdk/esp32c3/lib/libesp_system.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_timer.a b/tools/sdk/esp32c3/lib/libesp_timer.a index e49b1bf49c1..2b1962464e2 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_timer.a and b/tools/sdk/esp32c3/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_websocket_client.a b/tools/sdk/esp32c3/lib/libesp_websocket_client.a index d549614c720..ac57ff7242e 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_websocket_client.a and b/tools/sdk/esp32c3/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_wifi.a b/tools/sdk/esp32c3/lib/libesp_wifi.a index c3d10097213..0c3aa9d16e2 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_wifi.a and b/tools/sdk/esp32c3/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32c3/lib/libespcoredump.a b/tools/sdk/esp32c3/lib/libespcoredump.a index 2257bd5506f..f6a495511fe 100644 Binary files a/tools/sdk/esp32c3/lib/libespcoredump.a and b/tools/sdk/esp32c3/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32c3/lib/libespnow.a b/tools/sdk/esp32c3/lib/libespnow.a index 9a177fe7ec4..5d90d0d6a36 100644 Binary files a/tools/sdk/esp32c3/lib/libespnow.a and b/tools/sdk/esp32c3/lib/libespnow.a differ diff --git a/tools/sdk/esp32c3/lib/libexpat.a b/tools/sdk/esp32c3/lib/libexpat.a index ba5425bf647..3420373e18c 100644 Binary files a/tools/sdk/esp32c3/lib/libexpat.a and b/tools/sdk/esp32c3/lib/libexpat.a differ diff --git a/tools/sdk/esp32c3/lib/libfatfs.a b/tools/sdk/esp32c3/lib/libfatfs.a index 61e38ded214..d6e53af2821 100644 Binary files a/tools/sdk/esp32c3/lib/libfatfs.a and b/tools/sdk/esp32c3/lib/libfatfs.a differ diff --git a/tools/sdk/esp32c3/lib/libfb_gfx.a b/tools/sdk/esp32c3/lib/libfb_gfx.a index 23cd0bff10c..f26a3898a2e 100644 Binary files a/tools/sdk/esp32c3/lib/libfb_gfx.a and b/tools/sdk/esp32c3/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32c3/lib/libfreemodbus.a b/tools/sdk/esp32c3/lib/libfreemodbus.a index f7bb645a3f0..cbde0048525 100644 Binary files a/tools/sdk/esp32c3/lib/libfreemodbus.a and b/tools/sdk/esp32c3/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32c3/lib/libfreertos.a b/tools/sdk/esp32c3/lib/libfreertos.a index 3b92c397381..3755d4a4e0f 100644 Binary files a/tools/sdk/esp32c3/lib/libfreertos.a and b/tools/sdk/esp32c3/lib/libfreertos.a differ diff --git a/tools/sdk/esp32c3/lib/libgpio_button.a b/tools/sdk/esp32c3/lib/libgpio_button.a index 7f894ec2771..053c6fa82c6 100644 Binary files a/tools/sdk/esp32c3/lib/libgpio_button.a and b/tools/sdk/esp32c3/lib/libgpio_button.a differ diff --git a/tools/sdk/esp32c3/lib/libhal.a b/tools/sdk/esp32c3/lib/libhal.a index 7bf9e7898a8..34ee839e76d 100644 Binary files a/tools/sdk/esp32c3/lib/libhal.a and b/tools/sdk/esp32c3/lib/libhal.a differ diff --git a/tools/sdk/esp32c3/lib/libheap.a b/tools/sdk/esp32c3/lib/libheap.a index ff45ddce40e..d7662ef5f53 100644 Binary files a/tools/sdk/esp32c3/lib/libheap.a and b/tools/sdk/esp32c3/lib/libheap.a differ diff --git a/tools/sdk/esp32c3/lib/libjsmn.a b/tools/sdk/esp32c3/lib/libjsmn.a index bbe757d1634..fa0ca03f7ee 100644 Binary files a/tools/sdk/esp32c3/lib/libjsmn.a and b/tools/sdk/esp32c3/lib/libjsmn.a differ diff --git a/tools/sdk/esp32c3/lib/libjson.a b/tools/sdk/esp32c3/lib/libjson.a index 51d9e9eb140..52f3fc25483 100644 Binary files a/tools/sdk/esp32c3/lib/libjson.a and b/tools/sdk/esp32c3/lib/libjson.a differ diff --git a/tools/sdk/esp32c3/lib/libjson_generator.a b/tools/sdk/esp32c3/lib/libjson_generator.a index c0b35b7cd41..3c0ce42b5ec 100644 Binary files a/tools/sdk/esp32c3/lib/libjson_generator.a and b/tools/sdk/esp32c3/lib/libjson_generator.a differ diff --git a/tools/sdk/esp32c3/lib/libjson_parser.a b/tools/sdk/esp32c3/lib/libjson_parser.a index c2ea9008db3..9662b871c81 100644 Binary files a/tools/sdk/esp32c3/lib/libjson_parser.a and b/tools/sdk/esp32c3/lib/libjson_parser.a differ diff --git a/tools/sdk/esp32c3/lib/liblibsodium.a b/tools/sdk/esp32c3/lib/liblibsodium.a index 0d2f6dba14f..d4b96e72a9a 100644 Binary files a/tools/sdk/esp32c3/lib/liblibsodium.a and b/tools/sdk/esp32c3/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32c3/lib/liblog.a b/tools/sdk/esp32c3/lib/liblog.a index a9c0fc8b652..9175623223c 100644 Binary files a/tools/sdk/esp32c3/lib/liblog.a and b/tools/sdk/esp32c3/lib/liblog.a differ diff --git a/tools/sdk/esp32c3/lib/liblwip.a b/tools/sdk/esp32c3/lib/liblwip.a index b9adc29dcdb..9da9917aa13 100644 Binary files a/tools/sdk/esp32c3/lib/liblwip.a and b/tools/sdk/esp32c3/lib/liblwip.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedcrypto.a b/tools/sdk/esp32c3/lib/libmbedcrypto.a index 94d058ab9c0..afd69e4764e 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedcrypto.a and b/tools/sdk/esp32c3/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedtls.a b/tools/sdk/esp32c3/lib/libmbedtls.a index 8ee8bc3b44a..a8ea79d87a8 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedtls.a and b/tools/sdk/esp32c3/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedtls_2.a b/tools/sdk/esp32c3/lib/libmbedtls_2.a index 4bd67487838..6ad139dc3ae 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedtls_2.a and b/tools/sdk/esp32c3/lib/libmbedtls_2.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedx509.a b/tools/sdk/esp32c3/lib/libmbedx509.a index 07d76ff1132..1a547303b11 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedx509.a and b/tools/sdk/esp32c3/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32c3/lib/libmdns.a b/tools/sdk/esp32c3/lib/libmdns.a index 21e74569dd8..67a3f23d125 100644 Binary files a/tools/sdk/esp32c3/lib/libmdns.a and b/tools/sdk/esp32c3/lib/libmdns.a differ diff --git a/tools/sdk/esp32c3/lib/libmesh.a b/tools/sdk/esp32c3/lib/libmesh.a index 372094681b5..2ea73dd23b7 100644 Binary files a/tools/sdk/esp32c3/lib/libmesh.a and b/tools/sdk/esp32c3/lib/libmesh.a differ diff --git a/tools/sdk/esp32c3/lib/libmqtt.a b/tools/sdk/esp32c3/lib/libmqtt.a index 68b97f6d251..5240047a41c 100644 Binary files a/tools/sdk/esp32c3/lib/libmqtt.a and b/tools/sdk/esp32c3/lib/libmqtt.a differ diff --git a/tools/sdk/esp32c3/lib/libnet80211.a b/tools/sdk/esp32c3/lib/libnet80211.a index e534cae265d..e941bc42c53 100644 Binary files a/tools/sdk/esp32c3/lib/libnet80211.a and b/tools/sdk/esp32c3/lib/libnet80211.a differ diff --git a/tools/sdk/esp32c3/lib/libnewlib.a b/tools/sdk/esp32c3/lib/libnewlib.a index 30af7c741e9..44f55c66dfe 100644 Binary files a/tools/sdk/esp32c3/lib/libnewlib.a and b/tools/sdk/esp32c3/lib/libnewlib.a differ diff --git a/tools/sdk/esp32c3/lib/libnghttp.a b/tools/sdk/esp32c3/lib/libnghttp.a index 84048fa73ed..e5968170fe3 100644 Binary files a/tools/sdk/esp32c3/lib/libnghttp.a and b/tools/sdk/esp32c3/lib/libnghttp.a differ diff --git a/tools/sdk/esp32c3/lib/libnvs_flash.a b/tools/sdk/esp32c3/lib/libnvs_flash.a index b3d6edb0650..6698097f671 100644 Binary files a/tools/sdk/esp32c3/lib/libnvs_flash.a and b/tools/sdk/esp32c3/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32c3/lib/libopenssl.a b/tools/sdk/esp32c3/lib/libopenssl.a index c6cd0ddc939..c0ffbdb63c9 100644 Binary files a/tools/sdk/esp32c3/lib/libopenssl.a and b/tools/sdk/esp32c3/lib/libopenssl.a differ diff --git a/tools/sdk/esp32c3/lib/libpp.a b/tools/sdk/esp32c3/lib/libpp.a index bcef5290d0d..592f4f2e2cd 100644 Binary files a/tools/sdk/esp32c3/lib/libpp.a and b/tools/sdk/esp32c3/lib/libpp.a differ diff --git a/tools/sdk/esp32c3/lib/libprotobuf-c.a b/tools/sdk/esp32c3/lib/libprotobuf-c.a index 581d8721225..247ff9c9058 100644 Binary files a/tools/sdk/esp32c3/lib/libprotobuf-c.a and b/tools/sdk/esp32c3/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32c3/lib/libprotocomm.a b/tools/sdk/esp32c3/lib/libprotocomm.a index 7ee8cdddf65..03034b5009a 100644 Binary files a/tools/sdk/esp32c3/lib/libprotocomm.a and b/tools/sdk/esp32c3/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32c3/lib/libpthread.a b/tools/sdk/esp32c3/lib/libpthread.a index e7225dfd7a1..e99282f39cd 100644 Binary files a/tools/sdk/esp32c3/lib/libpthread.a and b/tools/sdk/esp32c3/lib/libpthread.a differ diff --git a/tools/sdk/esp32c3/lib/libqrcode.a b/tools/sdk/esp32c3/lib/libqrcode.a index f9fc6dadd6f..89a54fd2de9 100644 Binary files a/tools/sdk/esp32c3/lib/libqrcode.a and b/tools/sdk/esp32c3/lib/libqrcode.a differ diff --git a/tools/sdk/esp32c3/lib/libriscv.a b/tools/sdk/esp32c3/lib/libriscv.a index f09486c488a..a58067acc07 100644 Binary files a/tools/sdk/esp32c3/lib/libriscv.a and b/tools/sdk/esp32c3/lib/libriscv.a differ diff --git a/tools/sdk/esp32c3/lib/librmaker_common.a b/tools/sdk/esp32c3/lib/librmaker_common.a index 218c8e4ffec..e3872d03542 100644 Binary files a/tools/sdk/esp32c3/lib/librmaker_common.a and b/tools/sdk/esp32c3/lib/librmaker_common.a differ diff --git a/tools/sdk/esp32c3/lib/libsdmmc.a b/tools/sdk/esp32c3/lib/libsdmmc.a index 5bbbba55c4e..062a09d9d0a 100644 Binary files a/tools/sdk/esp32c3/lib/libsdmmc.a and b/tools/sdk/esp32c3/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32c3/lib/libsmartconfig.a b/tools/sdk/esp32c3/lib/libsmartconfig.a index e049d15b38a..73843b74201 100644 Binary files a/tools/sdk/esp32c3/lib/libsmartconfig.a and b/tools/sdk/esp32c3/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32c3/lib/libsoc.a b/tools/sdk/esp32c3/lib/libsoc.a index 5c59a58ba53..f51949f8de6 100644 Binary files a/tools/sdk/esp32c3/lib/libsoc.a and b/tools/sdk/esp32c3/lib/libsoc.a differ diff --git a/tools/sdk/esp32c3/lib/libspiffs.a b/tools/sdk/esp32c3/lib/libspiffs.a index 85084a78bbe..76822774a41 100644 Binary files a/tools/sdk/esp32c3/lib/libspiffs.a and b/tools/sdk/esp32c3/lib/libspiffs.a differ diff --git a/tools/sdk/esp32c3/lib/libtcp_transport.a b/tools/sdk/esp32c3/lib/libtcp_transport.a index f8db463453c..9857f6913cc 100644 Binary files a/tools/sdk/esp32c3/lib/libtcp_transport.a and b/tools/sdk/esp32c3/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32c3/lib/libtcpip_adapter.a b/tools/sdk/esp32c3/lib/libtcpip_adapter.a index fb30295d4ab..3ed5e4d8200 100644 Binary files a/tools/sdk/esp32c3/lib/libtcpip_adapter.a and b/tools/sdk/esp32c3/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32c3/lib/libunity.a b/tools/sdk/esp32c3/lib/libunity.a index 214b6d15b86..41be56ccb47 100644 Binary files a/tools/sdk/esp32c3/lib/libunity.a and b/tools/sdk/esp32c3/lib/libunity.a differ diff --git a/tools/sdk/esp32c3/lib/libvfs.a b/tools/sdk/esp32c3/lib/libvfs.a index 81f303c4b14..9caeed7b9b1 100644 Binary files a/tools/sdk/esp32c3/lib/libvfs.a and b/tools/sdk/esp32c3/lib/libvfs.a differ diff --git a/tools/sdk/esp32c3/lib/libwapi.a b/tools/sdk/esp32c3/lib/libwapi.a index 7df392bd54a..8ae9bd0f122 100644 Binary files a/tools/sdk/esp32c3/lib/libwapi.a and b/tools/sdk/esp32c3/lib/libwapi.a differ diff --git a/tools/sdk/esp32c3/lib/libwear_levelling.a b/tools/sdk/esp32c3/lib/libwear_levelling.a index f373ec82015..11fec91d0a4 100644 Binary files a/tools/sdk/esp32c3/lib/libwear_levelling.a and b/tools/sdk/esp32c3/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32c3/lib/libwifi_provisioning.a b/tools/sdk/esp32c3/lib/libwifi_provisioning.a index c098a2d5342..e9a38643614 100644 Binary files a/tools/sdk/esp32c3/lib/libwifi_provisioning.a and b/tools/sdk/esp32c3/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32c3/lib/libwpa_supplicant.a b/tools/sdk/esp32c3/lib/libwpa_supplicant.a index fd1a6c308e0..a62c356917c 100644 Binary files a/tools/sdk/esp32c3/lib/libwpa_supplicant.a and b/tools/sdk/esp32c3/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32c3/lib/libws2812_led.a b/tools/sdk/esp32c3/lib/libws2812_led.a index a40df230896..e614166ecc8 100644 Binary files a/tools/sdk/esp32c3/lib/libws2812_led.a and b/tools/sdk/esp32c3/lib/libws2812_led.a differ diff --git a/tools/sdk/esp32c3/qio_qspi/include/sdkconfig.h b/tools/sdk/esp32c3/qio_qspi/include/sdkconfig.h index f01a2832105..d27bbee2618 100644 --- a/tools/sdk/esp32c3/qio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32c3/qio_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32c3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -117,7 +119,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -191,6 +193,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -267,8 +270,8 @@ #define CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES 4 -#define CONFIG_ESP_SLEEP_POWER_DOWN_FLASH 1 #define CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 @@ -372,7 +375,6 @@ #define CONFIG_FREERTOS_OPTIMIZED_SCHEDULER 1 #define CONFIG_FREERTOS_HZ 1000 #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 -#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1 #define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 #define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 @@ -619,6 +621,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -673,7 +676,6 @@ #define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT CONFIG_PTHREAD_TASK_PRIO_DEFAULT #define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT #define CONFIG_ESP_GRATUITOUS_ARP CONFIG_LWIP_ESP_GRATUITOUS_ARP -#define CONFIG_ESP_SYSTEM_PD_FLASH CONFIG_ESP_SLEEP_POWER_DOWN_FLASH #define CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP #define CONFIG_FLASHMODE_QIO CONFIG_ESPTOOLPY_FLASHMODE_QIO #define CONFIG_GAP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING @@ -744,5 +746,5 @@ #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32c3/qio_qspi/libspi_flash.a b/tools/sdk/esp32c3/qio_qspi/libspi_flash.a index ce99ae2fce8..2ee7f978db5 100644 Binary files a/tools/sdk/esp32c3/qio_qspi/libspi_flash.a and b/tools/sdk/esp32c3/qio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32c3/qout_qspi/include/sdkconfig.h b/tools/sdk/esp32c3/qout_qspi/include/sdkconfig.h index 620064d7d10..edc3b3d62b4 100644 --- a/tools/sdk/esp32c3/qout_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32c3/qout_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32c3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -117,7 +119,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -191,6 +193,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -267,8 +270,8 @@ #define CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES 4 -#define CONFIG_ESP_SLEEP_POWER_DOWN_FLASH 1 #define CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 @@ -372,7 +375,6 @@ #define CONFIG_FREERTOS_OPTIMIZED_SCHEDULER 1 #define CONFIG_FREERTOS_HZ 1000 #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 -#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1 #define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 #define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 @@ -619,6 +621,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -673,7 +676,6 @@ #define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT CONFIG_PTHREAD_TASK_PRIO_DEFAULT #define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT #define CONFIG_ESP_GRATUITOUS_ARP CONFIG_LWIP_ESP_GRATUITOUS_ARP -#define CONFIG_ESP_SYSTEM_PD_FLASH CONFIG_ESP_SLEEP_POWER_DOWN_FLASH #define CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP #define CONFIG_FLASHMODE_QOUT CONFIG_ESPTOOLPY_FLASHMODE_QOUT #define CONFIG_GAP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING @@ -744,5 +746,5 @@ #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32c3/qout_qspi/libspi_flash.a b/tools/sdk/esp32c3/qout_qspi/libspi_flash.a index 061be7138ae..f0ca4b56750 100644 Binary files a/tools/sdk/esp32c3/qout_qspi/libspi_flash.a and b/tools/sdk/esp32c3/qout_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32c3/sdkconfig b/tools/sdk/esp32c3/sdkconfig index f760352e352..40110bae543 100644 --- a/tools/sdk/esp32c3/sdkconfig +++ b/tools/sdk/esp32c3/sdkconfig @@ -171,10 +171,11 @@ CONFIG_ESP_RMAKER_USE_CERT_BUNDLE=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD=0 # CONFIG_ESP_RMAKER_SKIP_COMMON_NAME_CHECK is not set -# CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK is not set +CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y # CONFIG_ESP_RMAKER_SKIP_PROJECT_NAME_CHECK is not set CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE=1024 CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD=90 +# CONFIG_ESP_RMAKER_OTA_DISABLE_AUTO_REBOOT is not set # end of ESP RainMaker OTA Config # @@ -201,6 +202,7 @@ CONFIG_ESP_RMAKER_CMD_RESP_ENABLE=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32c3" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y CONFIG_ARDUINO_RUN_CORE0=y @@ -323,7 +325,6 @@ CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y # CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N27 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set @@ -339,7 +340,8 @@ CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=10 +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -573,6 +575,7 @@ CONFIG_BT_MULTI_CONNECTION_ENBALE=y # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 +CONFIG_BT_MAX_DEVICE_NAME_LEN=32 CONFIG_BT_BLE_RPA_SUPPORTED=y CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y @@ -883,9 +886,10 @@ CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4 # # Sleep Config # -CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y +# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y -# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set # end of Sleep Config # @@ -938,6 +942,13 @@ CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -1030,6 +1041,7 @@ CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -1125,7 +1137,7 @@ CONFIG_FREERTOS_HZ=1000 # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y -CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y @@ -1692,6 +1704,7 @@ CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 CONFIG_WIFI_PROV_BLE_BONDING=y CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y +# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set # end of Wi-Fi Provisioning Manager # @@ -1775,11 +1788,13 @@ CONFIG_BF3005_SUPPORT=y CONFIG_BF20A6_SUPPORT=y # CONFIG_SC101IOT_SUPPORT is not set CONFIG_SC030IOT_SUPPORT=y +# CONFIG_SC031GS_SUPPORT is not set # CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set CONFIG_SCCB_HARDWARE_I2C_PORT1=y CONFIG_SCCB_CLK_FREQ=100000 # CONFIG_GC_SENSOR_WINDOWING_MODE is not set CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y +CONFIG_CAMERA_TASK_STACK_SIZE=2048 CONFIG_CAMERA_CORE0=y # CONFIG_CAMERA_CORE1 is not set # CONFIG_CAMERA_NO_AFFINITY is not set @@ -2038,7 +2053,7 @@ CONFIG_ADC2_DISABLE_DAC=y # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -CONFIG_ESP_SYSTEM_PD_FLASH=y +# CONFIG_ESP_SYSTEM_PD_FLASH is not set CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin b/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin index 4180c36cc9b..b8c8c6d1444 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_40m.elf b/tools/sdk/esp32s2/bin/bootloader_dio_40m.elf new file mode 100755 index 00000000000..bf5b0d7da03 Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_dio_40m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin b/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin index 6edf5bda6c5..2f483a0784d 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_80m.elf b/tools/sdk/esp32s2/bin/bootloader_dio_80m.elf new file mode 100755 index 00000000000..a4ce1c26f1a Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_dio_80m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin b/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin index 4180c36cc9b..b8c8c6d1444 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_40m.elf b/tools/sdk/esp32s2/bin/bootloader_dout_40m.elf new file mode 100755 index 00000000000..bf5b0d7da03 Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_dout_40m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin b/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin index 6edf5bda6c5..2f483a0784d 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_80m.elf b/tools/sdk/esp32s2/bin/bootloader_dout_80m.elf new file mode 100755 index 00000000000..a4ce1c26f1a Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_dout_80m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin b/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin index 6e4c666af3a..9142e2dfffc 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_40m.elf b/tools/sdk/esp32s2/bin/bootloader_qio_40m.elf new file mode 100755 index 00000000000..5f4c46e2d92 Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_qio_40m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin b/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin index ed66e39aebe..7336872d588 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_80m.elf b/tools/sdk/esp32s2/bin/bootloader_qio_80m.elf new file mode 100755 index 00000000000..14e6bde6b37 Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_qio_80m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin b/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin index 623b73c5bc6..786ade83123 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_40m.elf b/tools/sdk/esp32s2/bin/bootloader_qout_40m.elf new file mode 100755 index 00000000000..25f3b85db79 Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_qout_40m.elf differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin b/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin index ba157d20cb1..bfbbe738cc2 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_80m.elf b/tools/sdk/esp32s2/bin/bootloader_qout_80m.elf new file mode 100755 index 00000000000..d529374aa73 Binary files /dev/null and b/tools/sdk/esp32s2/bin/bootloader_qout_80m.elf differ diff --git a/tools/sdk/esp32s2/dio_qspi/include/sdkconfig.h b/tools/sdk/esp32s2/dio_qspi/include/sdkconfig.h index bdf5bd1f7fc..5756bdec37b 100644 --- a/tools/sdk/esp32s2/dio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s2/dio_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s2" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -181,6 +183,8 @@ #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 @@ -531,6 +535,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -633,5 +638,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s2/dio_qspi/libspi_flash.a b/tools/sdk/esp32s2/dio_qspi/libspi_flash.a index f100953f607..16db795ed01 100644 Binary files a/tools/sdk/esp32s2/dio_qspi/libspi_flash.a and b/tools/sdk/esp32s2/dio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s2/dout_qspi/include/sdkconfig.h b/tools/sdk/esp32s2/dout_qspi/include/sdkconfig.h index e99db87435a..06c698e7e9f 100644 --- a/tools/sdk/esp32s2/dout_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s2/dout_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s2" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -181,6 +183,8 @@ #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 @@ -531,6 +535,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -633,5 +638,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s2/dout_qspi/libspi_flash.a b/tools/sdk/esp32s2/dout_qspi/libspi_flash.a index 7f963bfb642..f6c598d25dd 100644 Binary files a/tools/sdk/esp32s2/dout_qspi/libspi_flash.a and b/tools/sdk/esp32s2/dout_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/video/video.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/video/video.h index 84474654663..e8227ea6069 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/video/video.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/video/video.h @@ -302,6 +302,45 @@ typedef struct TU_ATTR_PACKED { uint8_t bCopyProtect; } tusb_desc_cs_video_fmt_uncompressed_t; +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFormatIndex; + uint8_t bNumFrameDescriptors; + uint8_t bmFlags; + uint8_t bDefaultFrameIndex; + uint8_t bAspectRatioX; + uint8_t bAspectRatioY; + uint8_t bmInterlaceFlags; + uint8_t bCopyProtect; +} tusb_desc_cs_video_fmt_mjpeg_t; + +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFormatIndex; + uint32_t dwMaxVideoFrameBufferSize; /* deprecated */ + uint8_t bFormatType; +} tusb_desc_cs_video_fmt_dv_t; + +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFormatIndex; + uint8_t bNumFrameDescriptors; + uint8_t guidFormat[16]; + uint8_t bBitsPerPixel; + uint8_t bDefaultFrameIndex; + uint8_t bAspectRatioX; + uint8_t bAspectRatioY; + uint8_t bmInterlaceFlags; + uint8_t bCopyProtect; + uint8_t bVaribaleSize; +} tusb_desc_cs_video_fmt_frame_based_t; + typedef struct TU_ATTR_PACKED { uint8_t bLength; uint8_t bDescriptorType; @@ -318,6 +357,24 @@ typedef struct TU_ATTR_PACKED { uint32_t dwFrameInterval[]; } tusb_desc_cs_video_frm_uncompressed_t; +typedef tusb_desc_cs_video_frm_uncompressed_t tusb_desc_cs_video_frm_mjpeg_t; + +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFrameIndex; + uint8_t bmCapabilities; + uint16_t wWidth; + uint16_t wHeight; + uint32_t dwMinBitRate; + uint32_t dwMaxBitRate; + uint32_t dwDefaultFrameInterval; + uint8_t bFrameIntervalType; + uint32_t dwBytesPerLine; + uint32_t dwFrameInterval[]; +} tusb_desc_cs_video_frm_frame_based_t; + //--------------------------------------------------------------------+ // Requests //--------------------------------------------------------------------+ @@ -378,8 +435,11 @@ TU_VERIFY_STATIC( sizeof(video_probe_and_commit_control_t) == 48, "size is not c #define TUD_VIDEO_DESC_CS_VS_IN_LEN 13 #define TUD_VIDEO_DESC_CS_VS_OUT_LEN 9 #define TUD_VIDEO_DESC_CS_VS_FMT_UNCOMPR_LEN 27 +#define TUD_VIDEO_DESC_CS_VS_FMT_MJPEG_LEN 11 #define TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT_LEN 38 #define TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_DISC_LEN 26 +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT_LEN 38 +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC_LEN 26 #define TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN 6 /* 2.2 compression formats */ @@ -462,6 +522,25 @@ TU_VERIFY_STATIC( sizeof(video_probe_and_commit_control_t) == 48, "size is not c _frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \ U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), (TU_ARGS_NUM(__VA_ARGS__)), __VA_ARGS__ +/* Motion-JPEG 3.1.1 Table 3-1 */ +#define TUD_VIDEO_DESC_CS_VS_FMT_MJPEG(_fmtidx, _numfrmdesc, _fixed_sz, _frmidx, _asrx, _asry, _interlace, _cp) \ + TUD_VIDEO_DESC_CS_VS_FMT_MJPEG_LEN, TUSB_DESC_CS_INTERFACE, VIDEO_CS_ITF_VS_FORMAT_MJPEG, \ + _fmtidx, _numfrmdesc, _fixed_sz, _frmidx, _asrx, _asry, _interlace, _cp + +/* Motion-JPEG 3.1.1 Table 3-2 and 3-3 */ +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT(_frmidx, _cap, _width, _height, _minbr, _maxbr, _maxfrmbufsz, _frminterval, _minfrminterval, _maxfrminterval, _frmintervalstep) \ + TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT_LEN, TUSB_DESC_CS_INTERFACE, VIDEO_CS_ITF_VS_FRAME_MJPEG, \ + _frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \ + U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), 0, \ + U32_TO_U8S_LE(_minfrminterval), U32_TO_U8S_LE(_maxfrminterval), U32_TO_U8S_LE(_frmintervalstep) + +/* Motion-JPEG 3.1.1 Table 3-2 and 3-4 */ +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC(_frmidx, _cap, _width, _height, _minbr, _maxbr, _maxfrmbufsz, _frminterval, ...) \ + TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC_LEN + (TU_ARGS_NUM(__VA_ARGS__)) * 4, \ + TUSB_DESC_CS_INTERFACE, VIDEO_CS_VS_INTERFACE_FRAME_MJPEG, \ + _frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \ + U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), (TU_ARGS_NUM(__VA_ARGS__)), __VA_ARGS__ + /* 3.9.2.6 */ #define TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING(_color, _trns, _mat) \ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN, \ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h index baa82fc14dc..86c68baf80a 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h @@ -111,6 +111,11 @@ #define TUP_DCD_ENDPOINT_MAX 8 #define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER +#elif TU_CHECK_MCU(OPT_MCU_PIC32MX, OPT_MCU_PIC32MM, OPT_MCU_PIC32MK) || \ + TU_CHECK_MCU(OPT_MCU_PIC24, OPT_MCU_DSPIC33) + #define TUP_DCD_ENDPOINT_MAX 16 + #define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER + //------------- ST -------------// #elif TU_CHECK_MCU(OPT_MCU_STM32F0) #define TUP_DCD_ENDPOINT_MAX 8 @@ -184,6 +189,11 @@ #elif TU_CHECK_MCU(OPT_MCU_STM32WB) #define TUP_DCD_ENDPOINT_MAX 8 +#elif TU_CHECK_MCU(OPT_MCU_STM32U5) + #define TUP_USBIP_DWC2 + #define TUP_USBIP_DWC2_STM32 + #define TUP_DCD_ENDPOINT_MAX 6 + //------------- Sony -------------// #elif TU_CHECK_MCU(OPT_MCU_CXD56) #define TUP_DCD_ENDPOINT_MAX 7 diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h index 1f2a38d4c7e..e11f08dd171 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h @@ -513,6 +513,20 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_edpt_packet_size(tusb_desc_endpo return tu_le16toh(desc_ep->wMaxPacketSize) & TU_GENMASK(10, 0); } +#if CFG_TUSB_DEBUG +TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_dir_str(tusb_dir_t dir) +{ + static const char *str[] = {"out", "in"}; + return str[dir]; +} + +TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_type_str(tusb_xfer_type_t t) +{ + static const char *str[] = {"control", "isochronous", "bulk", "interrupt"}; + return str[t]; +} +#endif + //--------------------------------------------------------------------+ // Descriptor helper //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h index 1187e0d6e08..ea786362ef1 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h @@ -64,6 +64,10 @@ // NOTE: H7 with only 1 USB port: H72x / H73x / H7Ax / H7Bx // USB_OTG_FS_PERIPH_BASE and OTG_FS_IRQn not defined + #if (! defined USB2_OTG_FS) + #define USB_OTG_FS_PERIPH_BASE USB1_OTG_HS_PERIPH_BASE + #define OTG_FS_IRQn OTG_HS_IRQn + #endif #elif CFG_TUSB_MCU == OPT_MCU_STM32F7 #include "stm32f7xx.h" @@ -78,6 +82,12 @@ #define EP_MAX_FS 6 #define EP_FIFO_SIZE_FS 1280 +#elif CFG_TUSB_MCU == OPT_MCU_STM32U5 + #include "stm32u5xx.h" + #define USB_OTG_FS_PERIPH_BASE USB_OTG_FS_BASE + #define EP_MAX_FS 6 + #define EP_FIFO_SIZE_FS 1280 + #else #error "Unsupported MCUs" #endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h index e0447b10c5e..f95ae62734e 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h @@ -33,7 +33,7 @@ typedef int make_iso_compilers_happy; #include "common/tusb_compiler.h" #define TUSB_VERSION_MAJOR 0 -#define TUSB_VERSION_MINOR 13 +#define TUSB_VERSION_MINOR 14 #define TUSB_VERSION_REVISION 0 #define TUSB_VERSION_STRING TU_STRING(TUSB_VERSION_MAJOR) "." TU_STRING(TUSB_VERSION_MINOR) "." TU_STRING(TUSB_VERSION_REVISION) @@ -84,6 +84,7 @@ typedef int make_iso_compilers_happy; #define OPT_MCU_STM32G0 310 ///< ST G0 #define OPT_MCU_STM32G4 311 ///< ST G4 #define OPT_MCU_STM32WB 312 ///< ST WB +#define OPT_MCU_STM32U5 313 ///< ST U5 // Sony #define OPT_MCU_CXD56 400 ///< SONY CXD56 @@ -146,6 +147,11 @@ typedef int make_iso_compilers_happy; // PIC #define OPT_MCU_PIC32MZ 1900 ///< MicroChip PIC32MZ family +#define OPT_MCU_PIC32MM 1901 ///< MicroChip PIC32MM family +#define OPT_MCU_PIC32MX 1902 ///< MicroChip PIC32MX family +#define OPT_MCU_PIC32MK 1903 ///< MicroChip PIC32MK family +#define OPT_MCU_PIC24 1910 ///< MicroChip PIC24 family +#define OPT_MCU_DSPIC33 1911 ///< MicroChip DSPIC33 family // BridgeTek #define OPT_MCU_FT90X 2000 ///< BridgeTek FT90x diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h index 2f4e9062200..1a641be10ec 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h @@ -26,7 +26,7 @@ extern "C" { #endif -/// Type of hold a GPIO in low state +// Type of hold a GPIO in low state typedef enum { GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */ GPIO_SHORT_HOLD = -1, /*!< The short hold GPIO */ diff --git a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h index d90a56e992c..7b2fd50b620 100644 --- a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h +++ b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h @@ -39,15 +39,19 @@ esp_err_t touch_pad_sw_start(void); * @brief Set touch sensor times of charge and discharge and sleep time. * Excessive total time will slow down the touch response. * Too small measurement time will not be sampled enough, resulting in inaccurate measurements. - * + * @note Though this API name is same as ESP32, it has opposite logic of capacity. + * The touch sensor on ESP32-S2 will fix the count of charge and discharge cycles (specified by the second parameter) + * and then record the count of the clock cycles(which is 8 MHz) during the sensing period as the raw value. + * That means the raw value will increase as the capacity of the touch pad increasing. * @note The greater the duty cycle of the measurement time, the more system power is consumed. + * * @param sleep_cycle The touch sensor will sleep after each measurement. * sleep_cycle decide the interval between each measurement. * t_sleep = sleep_cycle / (RTC_SLOW_CLK frequency). * The approximate frequency value of RTC_SLOW_CLK can be obtained using rtc_clk_slow_freq_get_hz function. - * @param meas_times The times of charge and discharge in each measure process of touch channels. - * The timer frequency is 8Mhz. Range: 0 ~ 0xffff. - * Recommended typical value: Modify this value to make the measurement time around 1ms. + * @param meas_times The times of charge and discharge in each measurement of touch channels. Range: 0 ~ 0xffff. + * Recommended typical value: Modify this value to make the measurement time around 1 ms. + * The clock frequency is 8 MHz, so the raw value will be about 8000 if the measurement time is 1 ms * @return * - ESP_OK on success */ diff --git a/tools/sdk/esp32s2/include/driver/include/driver/i2s.h b/tools/sdk/esp32s2/include/driver/include/driver/i2s.h index 389b631ba7e..d231ad396bb 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/i2s.h @@ -113,6 +113,7 @@ typedef struct { * We assume that the current 'dma_buf_len' is 100, then the real length of the DMA buffer is 8 * 100 = 800 bytes. * Note that the length of an internal real DMA buffer shouldn't be greater than 4092. */ + bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */ bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */ int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value. If fixed_mclk set, mclk_multiple won't take effect */ diff --git a/tools/sdk/esp32s2/include/esp-dl/include/dl_define.hpp b/tools/sdk/esp32s2/include/esp-dl/include/dl_define.hpp index 734c0b80a4a..3f285f39206 100644 --- a/tools/sdk/esp32s2/include/esp-dl/include/dl_define.hpp +++ b/tools/sdk/esp32s2/include/esp-dl/include/dl_define.hpp @@ -38,11 +38,6 @@ } #endif -#define DL_Q16_MIN (-32768) -#define DL_Q16_MAX (32767) -#define DL_Q8_MIN (-128) -#define DL_Q8_MAX (127) - #ifndef DL_MAX #define DL_MAX(x, y) (((x) < (y)) ? (y) : (x)) #endif @@ -60,13 +55,24 @@ #endif #ifndef DL_RIGHT_SHIFT -#define DL_RIGHT_SHIFT(x, shift) ((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift)) +#define DL_RIGHT_SHIFT(x, shift) (((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift))) #endif #ifndef DL_LEFT_SHIFT -#define DL_LEFT_SHIFT(x, shift) ((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift)) +#define DL_LEFT_SHIFT(x, shift) (((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift))) +#endif + +#ifndef DL_SCALE +#define DL_SCALE(exponent) (((exponent) > 0) ? (1 << (exponent)) : ((float)1.0 / (1 << -(exponent)))) #endif +#ifndef DL_RESCALE +#define DL_RESCALE(exponent) (((exponent) > 0) ? ((float)1.0 / (1 << (exponent))) : (1 << -(exponent))) +#endif + +#define QIQO 0 +#define QIFO 1 + namespace dl { typedef enum @@ -75,9 +81,6 @@ namespace dl ReLU, /**/ LeakyReLU, /**/ PReLU, /**/ - // TODO: Sigmoid, /**/ - // TODO: Softmax, /**/ - PADDING_SAME_BEGIN, /**/ + PADDING_SAME_BEGIN, /**/ PADDING_SAME_END, /**/ } padding_type_t; - + typedef enum { PADDING_EMPTY, PADDING_CONSTANT, - PADDING_EDGE, + PADDING_EDGE, PADDING_REFLECT, PADDING_SYMMETRIC, } padding_mode_t; diff --git a/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_sigmoid.hpp b/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_sigmoid.hpp new file mode 100644 index 00000000000..e8d147d78cd --- /dev/null +++ b/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_sigmoid.hpp @@ -0,0 +1,147 @@ +#pragma once + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Sigmoid(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Sigmoid : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Sigmoid object + * + * @param output_exponent exponent of output + * @param name name of Sigmoid + */ + Sigmoid(const int output_exponent, const char *name = "Sigmoid") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Sigmoid object + * + */ + ~Sigmoid() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Sigmoid result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Sigmoid operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Sigmoid result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + temp = temp / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "sigmoid"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_softmax.hpp b/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_softmax.hpp new file mode 100644 index 00000000000..9e845af00c8 --- /dev/null +++ b/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_softmax.hpp @@ -0,0 +1,175 @@ +#pragma once + +#include +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Softmax(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Softmax : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int loop; /**/ + int channel; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Softmax object + * + * @param output_exponent exponent of output + * @param name name of Softmax + * @param inplace true: the output will store to input + * false: the output will store to a separate memory + */ + Softmax(const int output_exponent, const char *name = "Softmax") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Softmax object + * + */ + ~Softmax() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->channel = input.shape[2]; + this->loop = input.get_size() / this->channel; + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Softmax result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Softmax operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Softmax result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + std::unique_ptr buf(new float[this->channel]); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->loop; i++) + { + I max_input = input_ptr[0]; + for (size_t j = 1; j < this->channel; j++) + max_input = DL_MAX(max_input, input_ptr[j]); + + float summary = 0.0; + for (size_t j = 0; j < this->channel; j++) + { + buf[j] = dl::math::exp_fast(((float)input_ptr[j] - max_input) * this->scale); + // buf[j] = exp(((float)input_ptr[j] - max_input) * this->scale); + summary += buf[j]; + } + + if constexpr (type == QIQO) + { + summary = this->rescale / summary; + for (size_t j = 0; j < this->channel; j++) + dl::tool::truncate(output_ptr[j], buf[j] * summary); + } + else if constexpr (type == QIFO) + { + summary = 1.0 / summary; + for (size_t j = 0; j < this->channel; j++) + output_ptr[j] = buf[j] * summary; + } + + input_ptr += this->channel; + output_ptr += this->channel; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "softmax"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_tanh.hpp b/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_tanh.hpp new file mode 100644 index 00000000000..12eae71e55e --- /dev/null +++ b/tools/sdk/esp32s2/include/esp-dl/include/layer/dl_layer_tanh.hpp @@ -0,0 +1,150 @@ +#pragma once + +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief TanH(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class TanH : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new TanH object + * + * @param output_exponent exponent of output + * @param name name of TanH + */ + TanH(const int output_exponent, const char *name = "TanH") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the TanH object + * + */ + ~TanH() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent + 1); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& TanH result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call TanH operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return TanH result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + // float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + float temp = exp((float)input_ptr[i] * this->scale); + temp = (temp - 1.0f) / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "tanh"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32s2/include/esp-dl/include/math/dl_math.hpp b/tools/sdk/esp32s2/include/esp-dl/include/math/dl_math.hpp index d3f2b94d3de..dfe89c89931 100644 --- a/tools/sdk/esp32s2/include/esp-dl/include/math/dl_math.hpp +++ b/tools/sdk/esp32s2/include/esp-dl/include/math/dl_math.hpp @@ -1,6 +1,7 @@ #pragma once #include "dl_define.hpp" +#include "dl_tool.hpp" namespace dl { @@ -8,7 +9,7 @@ namespace dl { /** * @brief x^a. - * + * * @param x as a base * @param a as an exponent * @return x^a @@ -31,7 +32,7 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ @@ -43,7 +44,7 @@ namespace dl /** * @brief 1/sqrt(x). - * + * * @param x as a base * @return 1/sqrt(x) */ @@ -61,15 +62,15 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ inline float sqrt_newton(float x) { /** - * Use Newton iteration method to find the square root - * */ + * Use Newton iteration method to find the square root + * */ if (x == 0.f) return 0.f; float result = x; @@ -84,7 +85,7 @@ namespace dl /** * @brief n-th root of x. - * + * * @param x as a base * @param n root times * @return n-th root of x @@ -112,7 +113,7 @@ namespace dl /** * @brief atan(x). - * + * * @param x as an input * @return atan(x) in range [-pi/2, pi/2] */ @@ -125,10 +126,10 @@ namespace dl // TODO:@yuanjiong /** - * @brief - * + * @brief + * * @param x - * @param y + * @param y * @return in range [-pi, pi] */ inline float atan2(float x, float y) @@ -150,7 +151,7 @@ namespace dl /** * @brief acos(x). - * + * * @param x as an input * @return acos(x) in range [-pi/2, pi/2] */ @@ -161,7 +162,7 @@ namespace dl /** * @brief asin(x). - * + * * @param x as an input * @return asin(x) in range [0, pi] */ @@ -172,12 +173,12 @@ namespace dl /** * @brief e^x - * + * * @param x exponent * @param steps iteration steps * @return e^x */ - inline float exp_fast(double x, int steps) + inline float exp_fast(float x, int steps = 8) { x = 1.0 + x / (1 << steps); for (int i = 0; i < steps; i++) diff --git a/tools/sdk/esp32s2/include/esp-dl/include/tool/dl_tool.hpp b/tools/sdk/esp32s2/include/esp-dl/include/tool/dl_tool.hpp index e5490e073d1..6566e535b85 100644 --- a/tools/sdk/esp32s2/include/esp-dl/include/tool/dl_tool.hpp +++ b/tools/sdk/esp32s2/include/esp-dl/include/tool/dl_tool.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "esp_system.h" @@ -26,7 +27,7 @@ namespace dl { /** * @brief Set memory zero. - * + * * @param ptr pointer of memory * @param n byte number */ @@ -34,8 +35,8 @@ namespace dl /** * @brief Set array value. - * - * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction + * + * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction * @param ptr pointer of array * @param value value to set * @param len length of array @@ -59,7 +60,7 @@ namespace dl /** * @brief Copy memory. - * + * * @param dst pointer of destination * @param src pointer of source * @param n byte number @@ -68,7 +69,7 @@ namespace dl /** * @brief Apply memory without initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -76,7 +77,7 @@ namespace dl */ inline void *malloc_aligned(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); @@ -99,7 +100,7 @@ namespace dl /** * @brief Apply memory with zero-initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -116,7 +117,7 @@ namespace dl /** * @brief Free the calloc_aligned() and malloc_aligned() memory - * + * * @param address pointer of memory to free */ inline void free_aligned(void *address) @@ -129,7 +130,7 @@ namespace dl /** * @brief Apply memory without initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -137,14 +138,16 @@ namespace dl */ inline void *malloc_aligned_prefer(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); - if (NULL == res){ + if (NULL == res) + { res = heap_caps_malloc(total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); } #if DL_SPIRAM_SUPPORT - if (NULL == res){ + if (NULL == res) + { res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_SPIRAM); } #endif @@ -163,7 +166,7 @@ namespace dl /** * @brief Apply memory with zero-initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -179,7 +182,7 @@ namespace dl /** * @brief Free the calloc_aligned_prefer() and malloc_aligned_prefer() memory - * + * * @param address pointer of memory to free */ inline void free_aligned_prefer(void *address) @@ -192,7 +195,7 @@ namespace dl /** * @brief Truncate the input into int8_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -200,17 +203,12 @@ namespace dl template void truncate(int8_t &output, T input) { - if (input >= DL_Q8_MAX) - output = DL_Q8_MAX; - else if (input <= DL_Q8_MIN) - output = DL_Q8_MIN; - else - output = input; + output = DL_CLIP(input, INT8_MIN, INT8_MAX); } /** * @brief Truncate the input into int16_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -218,17 +216,24 @@ namespace dl template void truncate(int16_t &output, T input) { - if (input >= DL_Q16_MAX) - output = DL_Q16_MAX; - else if (input <= DL_Q16_MIN) - output = DL_Q16_MIN; - else - output = input; + output = DL_CLIP(input, INT16_MIN, INT16_MAX); + } + + template + void truncate(int32_t &output, T input) + { + output = DL_CLIP(input, INT32_MIN, INT32_MAX); + } + + template + void truncate(int64_t &output, T input) + { + output = DL_CLIP(input, INT64_MIN, INT64_MAX); } /** * @brief Calculate the exponent of quantizing 1/n into max_value range. - * + * * @param n 1/n: value to be quantized * @param max_value the max_range */ @@ -248,7 +253,7 @@ namespace dl /** * @brief Print vector in format "[x1, x2, ...]\n". - * + * * @param array to print */ inline void print_vector(std::vector &array, const char *message = NULL) @@ -266,7 +271,7 @@ namespace dl /** * @brief Get the cycle object - * + * * @return cycle count */ inline uint32_t get_cycle() @@ -293,8 +298,8 @@ namespace dl public: /** * @brief Construct a new Latency object. - * - * @param size + * + * @param size */ Latency(const uint32_t size = 1) : size(size), period(0), @@ -307,7 +312,7 @@ namespace dl /** * @brief Destroy the Latency object. - * + * */ ~Latency() { @@ -317,7 +322,7 @@ namespace dl /** * @brief Record the start timestamp. - * + * */ void start() { @@ -330,7 +335,7 @@ namespace dl /** * @brief Record the period. - * + * */ void end() { @@ -355,7 +360,7 @@ namespace dl /** * @brief Return the period. - * + * * @return this->timestamp_end - this->timestamp */ uint32_t get_period() @@ -365,8 +370,8 @@ namespace dl /** * @brief Get the average period. - * - * @return average latency + * + * @return average latency */ uint32_t get_average_period() { @@ -375,7 +380,7 @@ namespace dl /** * @brief Clear the period - * + * */ void clear_period() { @@ -396,7 +401,7 @@ namespace dl /** * @brief Print in format "{message}: {this->period} {unit}\n". - * + * * @param message message of print */ void print(const char *message) @@ -410,7 +415,7 @@ namespace dl /** * @brief Print in format "{prefix}::{key}: {this->period} {unit}\n". - * + * * @param prefix prefix of print * @param key key of print */ diff --git a/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/dsp_types.h b/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/dsp_types.h index 1f11ea4520b..807608477a9 100644 --- a/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/dsp_types.h +++ b/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/dsp_types.h @@ -2,6 +2,7 @@ #define _dsp_types_H_ #include #include +#include // union to simplify access to the 16 bit data typedef union sc16_u diff --git a/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/esp_dsp.h b/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/esp_dsp.h index 419ed299965..9ce979e9955 100644 --- a/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/esp_dsp.h +++ b/tools/sdk/esp32s2/include/esp-dsp/modules/common/include/esp_dsp.h @@ -22,6 +22,7 @@ extern "C" // Common includes #include "dsp_common.h" +#include "dsp_types.h" // Signal processing #include "dsps_dotprod.h" diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_afe_config.h b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_afe_config.h index 01ef439c27d..3bf55f78e18 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_afe_config.h +++ b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_afe_config.h @@ -31,6 +31,7 @@ typedef struct { int total_ch_num; // total channel num. It must be: total_ch_num = mic_num + ref_num int mic_num; // mic channel num int ref_num; // reference channel num + int sample_rate; // sample rate of audio } afe_pcm_config_t; typedef struct { @@ -75,6 +76,7 @@ typedef struct { .pcm_config.total_ch_num = 2, \ .pcm_config.mic_num = 1, \ .pcm_config.ref_num = 1, \ + .pcm_config.sample_rate = 16000, \ } #elif CONFIG_IDF_TARGET_ESP32S3 #define AFE_CONFIG_DEFAULT() { \ @@ -97,5 +99,6 @@ typedef struct { .pcm_config.total_ch_num = 3, \ .pcm_config.mic_num = 2, \ .pcm_config.ref_num = 1, \ + .pcm_config.sample_rate = 16000, \ } #endif \ No newline at end of file diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_iface.h b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_iface.h index 63e5a4d4b48..6f3e5eadb34 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_iface.h +++ b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_iface.h @@ -7,6 +7,10 @@ #define ESP_MN_MAX_PHRASE_LEN 63 #define ESP_MN_MIN_PHRASE_LEN 2 +#define ESP_MN_PREFIX "mn" +#define ESP_MN_ENGLISH "en" +#define ESP_MN_CHINESE "cn" + typedef enum { ESP_MN_STATE_DETECTING = 0, // detecting ESP_MN_STATE_DETECTED = 1, // detected @@ -84,6 +88,14 @@ typedef int (*esp_mn_iface_op_set_det_threshold_t)(model_iface_data_t *model, fl */ typedef int (*esp_mn_iface_op_get_samp_rate_t)(model_iface_data_t *model); +/** + * @brief Get the language of model + * + * @param model The language name + * @return Language name string defined in esp_mn_models.h, eg: ESP_MN_CHINESE, ESP_MN_ENGLISH + */ +typedef char * (*esp_mn_iface_op_get_language_t)(model_iface_data_t *model); + /** * @brief Feed samples of an audio stream to the speech recognition model and detect if there is a speech command found. * diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_models.h b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_models.h index c65e0aabdb5..15d7ddd4ca1 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_models.h +++ b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_mn_models.h @@ -5,11 +5,6 @@ //a specific phrase or word. - -#define ESP_MN_PREFIX "mn" -#define ESP_MN_ENGLISH "en" -#define ESP_MN_CHINESE "cn" - /** * @brief Get the multinet handle from model name * @@ -29,9 +24,8 @@ char *esp_mn_language_from_name(char *model_name); /* Configure wake word to use based on what's selected in menuconfig. */ -#if defined CONFIG_USE_MULTINET -#if CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION +#ifdef CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION #include "multinet2_ch.h" #define MULTINET_COEFF get_coeff_multinet2_ch #define MULTINET_MODEL_NAME "mn2_cn" @@ -41,10 +35,6 @@ char *esp_mn_language_from_name(char *model_name); #define MULTINET_MODEL_NAME "NULL" #endif -#else -#define MULTINET_COEFF "COEFF_NULL" -#define MULTINET_MODEL_NAME "NULL" -#endif /* example diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_ns.h b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_ns.h index 1932600b72f..c113aedca58 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_ns.h +++ b/tools/sdk/esp32s2/include/esp-sr/include/esp32/esp_ns.h @@ -46,13 +46,14 @@ ns_handle_t ns_create(int frame_length); * @warning frame_length only supports be 10 ms. * * @param frame_length The length of the audio processing can only be 10ms. - * @param mode 0: Mild, 1: Medium, 2: Aggressive + * @param mode 0: Mild, 1: Medium, 2: Aggressive + * @param sample_rate The sample rate of the audio. * * @return * - NULL: Create failed * - Others: The instance of NS */ -ns_handle_t ns_pro_create(int frame_length, int mode); +ns_handle_t ns_pro_create(int frame_length, int mode, int sample_rate); /** * @brief Feed samples of an audio stream to the NS and get the audio stream after Noise suppression. diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_speech_commands.h b/tools/sdk/esp32s2/include/esp-sr/src/include/esp_mn_speech_commands.h similarity index 99% rename from tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_speech_commands.h rename to tools/sdk/esp32s2/include/esp-sr/src/include/esp_mn_speech_commands.h index 2ef3c164578..c7b29274096 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_mn_speech_commands.h +++ b/tools/sdk/esp32s2/include/esp-sr/src/include/esp_mn_speech_commands.h @@ -117,7 +117,7 @@ esp_mn_phrase_t *esp_mn_commands_get_from_string(const char *phoneme_string); * - NULL Success * - others The list of error phrase which can not be parsed by multinet. */ -esp_mn_error_t *esp_mn_commands_update(const esp_mn_iface_t *multinet, const model_iface_data_t *model_data); +esp_mn_error_t *esp_mn_commands_update(const esp_mn_iface_t *multinet, model_iface_data_t *model_data); /** * @brief Print the MultiNet Speech Commands. diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_process_sdkconfig.h b/tools/sdk/esp32s2/include/esp-sr/src/include/esp_process_sdkconfig.h similarity index 80% rename from tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_process_sdkconfig.h rename to tools/sdk/esp32s2/include/esp-sr/src/include/esp_process_sdkconfig.h index aca5c50eab4..9743dcad7da 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_process_sdkconfig.h +++ b/tools/sdk/esp32s2/include/esp-sr/src/include/esp_process_sdkconfig.h @@ -20,4 +20,4 @@ void check_chip_config(void); * - ESP_OK Success * - ESP_ERR_INVALID_STATE Fail */ -esp_err_t esp_mn_commands_update_from_sdkconfig(esp_mn_iface_t *multinet, const model_iface_data_t *model_data); +esp_mn_error_t* esp_mn_commands_update_from_sdkconfig(const esp_mn_iface_t *multinet, model_iface_data_t *model_data); diff --git a/tools/sdk/esp32s2/include/esp-sr/include/esp32/model_path.h b/tools/sdk/esp32s2/include/esp-sr/src/include/model_path.h similarity index 88% rename from tools/sdk/esp32s2/include/esp-sr/include/esp32/model_path.h rename to tools/sdk/esp32s2/include/esp-sr/src/include/model_path.h index 4900dbb7eda..0c685cdd310 100644 --- a/tools/sdk/esp32s2/include/esp-sr/include/esp32/model_path.h +++ b/tools/sdk/esp32s2/include/esp-sr/src/include/model_path.h @@ -76,4 +76,19 @@ void srmodel_spiffs_deinit(srmodel_list_t *models); * * @return the base path od srmodel spiffs */ -char *get_model_base_path(void); \ No newline at end of file +char *get_model_base_path(void); + + +#ifdef ESP_PLATFORM +#include "dl_lib_coefgetter_if.h" +/** + * @brief Return model_coeff_getter_t pointer base on model_name + * + * @warning Just support ESP32 to load old wakenet + * + * @param model_name The model name + * + * @return model_coeff_getter_t pointer or NULL + */ +model_coeff_getter_t* srmodel_get_model_coeff(char *model_name); +#endif \ No newline at end of file diff --git a/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h b/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h index 2025bb403a9..ee84b307baf 100755 --- a/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h +++ b/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h @@ -18,8 +18,8 @@ .pin_pwdn = PIN_PWDN, .pin_reset = PIN_RESET, .pin_xclk = PIN_XCLK, - .pin_sscb_sda = PIN_SIOD, - .pin_sscb_scl = PIN_SIOC, + .pin_sccb_sda = PIN_SIOD, + .pin_sccb_scl = PIN_SIOC, .pin_d7 = PIN_D7, .pin_d6 = PIN_D6, .pin_d5 = PIN_D5, @@ -112,8 +112,14 @@ typedef struct { int pin_pwdn; /*!< GPIO pin for camera power down line */ int pin_reset; /*!< GPIO pin for camera reset line */ int pin_xclk; /*!< GPIO pin for camera XCLK line */ - int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ - int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ + union { + int pin_sccb_sda; /*!< GPIO pin for camera SDA line */ + int pin_sscb_sda __attribute__((deprecated("please use pin_sccb_sda instead"))); /*!< GPIO pin for camera SDA line (legacy name) */ + }; + union { + int pin_sccb_scl; /*!< GPIO pin for camera SCL line */ + int pin_sscb_scl __attribute__((deprecated("please use pin_sccb_scl instead"))); /*!< GPIO pin for camera SCL line (legacy name) */ + }; int pin_d7; /*!< GPIO pin for camera D7 line */ int pin_d6; /*!< GPIO pin for camera D6 line */ int pin_d5; /*!< GPIO pin for camera D5 line */ @@ -141,6 +147,8 @@ typedef struct { #if CONFIG_CAMERA_CONVERTER_ENABLED camera_conv_mode_t conv_mode; /*!< RGB<->YUV Conversion mode */ #endif + + int sccb_i2c_port; /*!< If pin_sccb_sda is -1, use the already configured I2C bus by number */ } camera_config_t; /** diff --git a/tools/sdk/esp32s2/include/esp32-camera/driver/include/sensor.h b/tools/sdk/esp32s2/include/esp32-camera/driver/include/sensor.h index d5ec7463fd3..6ab12a21aa5 100755 --- a/tools/sdk/esp32s2/include/esp32-camera/driver/include/sensor.h +++ b/tools/sdk/esp32s2/include/esp32-camera/driver/include/sensor.h @@ -30,6 +30,7 @@ typedef enum { BF20A6_PID = 0x20a6, SC101IOT_PID = 0xda4a, SC030IOT_PID = 0x9a46, + SC031GS_PID = 0x0031, } camera_pid_t; typedef enum { @@ -46,6 +47,7 @@ typedef enum { CAMERA_BF20A6, CAMERA_SC101IOT, CAMERA_SC030IOT, + CAMERA_SC031GS, CAMERA_MODEL_MAX, CAMERA_NONE, } camera_model_t; @@ -64,6 +66,7 @@ typedef enum { BF20A6_SCCB_ADDR = 0x6E, SC101IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 + SC031GS_SCCB_ADDR = 0x30, } camera_sccb_addr_t; typedef enum { @@ -209,7 +212,7 @@ typedef struct _sensor { // Sensor function pointers int (*init_status) (sensor_t *sensor); - int (*reset) (sensor_t *sensor); + int (*reset) (sensor_t *sensor); // Reset the configuration of the sensor, and return ESP_OK if reset is successful int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); int (*set_framesize) (sensor_t *sensor, framesize_t framesize); int (*set_contrast) (sensor_t *sensor, int level); diff --git a/tools/sdk/esp32s2/include/esp_common/include/esp_idf_version.h b/tools/sdk/esp32s2/include/esp_common/include/esp_idf_version.h index ef308895c9d..74dda44cbdc 100644 --- a/tools/sdk/esp32s2/include/esp_common/include/esp_idf_version.h +++ b/tools/sdk/esp32s2/include/esp_common/include/esp_idf_version.h @@ -23,7 +23,7 @@ extern "C" { /** Minor version number (x.X.x) */ #define ESP_IDF_VERSION_MINOR 4 /** Patch version number (x.x.X) */ -#define ESP_IDF_VERSION_PATCH 2 +#define ESP_IDF_VERSION_PATCH 3 /** * Macro to convert IDF version number into an integer diff --git a/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h index 1c8b78583ff..1f790b5ff86 100644 --- a/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h @@ -40,6 +40,8 @@ initializer that should be kept in sync .global_user_ctx_free_fn = NULL, \ .global_transport_ctx = NULL, \ .global_transport_ctx_free_fn = NULL, \ + .enable_so_linger = false, \ + .linger_timeout = 0, \ .open_fn = NULL, \ .close_fn = NULL, \ .uri_match_fn = NULL \ @@ -185,6 +187,9 @@ typedef struct httpd_config { */ httpd_free_ctx_fn_t global_transport_ctx_free_fn; + bool enable_so_linger; /*!< bool to enable/disable linger */ + int linger_timeout; /*!< linger timeout (in seconds) */ + /** * Custom session opening callback. * diff --git a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_clk.h b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_clk.h index 5a4666fdddf..8846f9272d9 100644 --- a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_clk.h +++ b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_clk.h @@ -82,6 +82,19 @@ int esp_clk_xtal_freq(void); */ uint64_t esp_clk_rtc_time(void); +/** + * @brief obtain internal critical section used esp_clk implementation. + * + * This is used by the esp_light_sleep_start() to avoid deadlocking when it + * calls esp_clk related API after stalling the other CPU. + */ +void esp_clk_private_lock(void); + +/** + * @brief counterpart of esp_clk_private_lock + */ +void esp_clk_private_unlock(void); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_sleep_internal.h b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_sleep_internal.h new file mode 100644 index 00000000000..ee0b72953f0 --- /dev/null +++ b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_private/esp_sleep_internal.h @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief Enables the use of ADC and temperature sensor in monitor (ULP) mode + * + * @note This state is kept in RTC memory and will keep its value after a deep sleep wakeup + * + */ +void esp_sleep_enable_adc_tsens_monitor(bool enable); + + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_sleep.h b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_sleep.h index 75d2f9726c3..8090fe85211 100644 --- a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_sleep.h +++ b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_sleep.h @@ -69,7 +69,7 @@ typedef enum { ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program - ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only) + ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3) ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only) ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only) ESP_SLEEP_WAKEUP_COCPU, //!< Wakeup caused by COCPU int diff --git a/tools/sdk/esp32s2/include/esp_ipc/include/esp_ipc_isr.h b/tools/sdk/esp32s2/include/esp_ipc/include/esp_ipc_isr.h index 22fa5b10b03..70290ba5618 100644 --- a/tools/sdk/esp32s2/include/esp_ipc/include/esp_ipc_isr.h +++ b/tools/sdk/esp32s2/include/esp_ipc/include/esp_ipc_isr.h @@ -62,6 +62,7 @@ void esp_ipc_isr_asm_call_blocking(esp_ipc_isr_func_t func, void* arg); * - If the stall feature is paused using esp_ipc_isr_stall_pause(), this function will have no effect * * @note This function is not available in single-core mode. + * @note It is the caller's responsibility to avoid deadlocking on spinlocks */ void esp_ipc_isr_stall_other_cpu(void); diff --git a/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_io.h b/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_io.h index 57f27ac96aa..2f2c613f1a8 100644 --- a/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_io.h +++ b/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_io.h @@ -47,7 +47,7 @@ esp_err_t esp_lcd_panel_io_rx_param(esp_lcd_panel_io_handle_t io, int lcd_cmd, v * this function will wait until they are finished and the queue is empty before sending the command(s). * * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()` - * @param[in] lcd_cmd The specific LCD command + * @param[in] lcd_cmd The specific LCD command (set to -1 if no command needed - only in SPI and I2C) * @param[in] param Buffer that holds the command specific parameters, set to NULL if no parameter is needed for the command * @param[in] param_size Size of `param` in memory, in bytes, set to zero if no parameter is needed for the command * @return diff --git a/tools/sdk/esp32s2/include/esp_littlefs/include/esp_littlefs.h b/tools/sdk/esp32s2/include/esp_littlefs/include/esp_littlefs.h index 07f35231291..6337f7b17b5 100644 --- a/tools/sdk/esp32s2/include/esp_littlefs/include/esp_littlefs.h +++ b/tools/sdk/esp32s2/include/esp_littlefs/include/esp_littlefs.h @@ -2,22 +2,16 @@ #define ESP_LITTLEFS_H__ #include "esp_err.h" -#include "littlefs/lfs.h" -#include "sdkconfig.h" +#include #ifdef __cplusplus extern "C" { #endif -/** - * @brief Last Modified Time - * - * Use 't' for LITTLEFS_ATTR_MTIME to match example: - * https://github.com/ARMmbed/littlefs/issues/23#issuecomment-482293539 - * And to match other external tools such as: - * https://github.com/earlephilhower/mklittlefs - */ -#define LITTLEFS_ATTR_MTIME ((uint8_t) 't') +#define ESP_LITTLEFS_VERSION_NUMBER "1.5.0" +#define ESP_LITTLEFS_VERSION_MAJOR 1 +#define ESP_LITTLEFS_VERSION_MINOR 5 +#define ESP_LITTLEFS_VERSION_PATCH 0 /** *Configuration structure for esp_vfs_littlefs_register. @@ -88,14 +82,6 @@ esp_err_t esp_littlefs_format(const char* partition_label); */ esp_err_t esp_littlefs_info(const char* partition_label, size_t *total_bytes, size_t *used_bytes); -#if CONFIG_LITTLEFS_HUMAN_READABLE -/** - * @brief converts an enumerated lfs error into a string. - * @param lfs_errno The enumerated littlefs error. - */ -const char * esp_littlefs_errno(enum lfs_error lfs_errno); -#endif - #ifdef __cplusplus } // extern "C" #endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/lfs_config.h b/tools/sdk/esp32s2/include/esp_littlefs/src/lfs_config.h deleted file mode 100644 index 809d2ccc517..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/lfs_config.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_CFG_H -#define LFS_CFG_H - -// System includes -#include -#include -#include -#include -#include "esp_heap_caps.h" - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return heap_caps_malloc(size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h b/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h deleted file mode 100644 index 1a9456c5196..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Block device emulated in a file - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_FILEBD_H -#define LFS_FILEBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_FILEBD_YES_TRACE -#define LFS_FILEBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_FILEBD_TRACE(...) -#endif - -// filebd config (optional) -struct lfs_filebd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; -}; - -// filebd state -typedef struct lfs_filebd { - int fd; - const struct lfs_filebd_config *cfg; -} lfs_filebd_t; - - -// Create a file block device using the geometry in lfs_config -int lfs_filebd_create(const struct lfs_config *cfg, const char *path); -int lfs_filebd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_filebd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_filebd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_filebd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h b/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h deleted file mode 100644 index 3a70bc6e134..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Block device emulated in RAM - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_RAMBD_H -#define LFS_RAMBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_RAMBD_YES_TRACE -#define LFS_RAMBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_RAMBD_TRACE(...) -#endif - -// rambd config (optional) -struct lfs_rambd_config { - // 8-bit erase value to simulate erasing with. -1 indicates no erase - // occurs, which is still a valid block device - int32_t erase_value; - - // Optional statically allocated buffer for the block device. - void *buffer; -}; - -// rambd state -typedef struct lfs_rambd { - uint8_t *buffer; - const struct lfs_rambd_config *cfg; -} lfs_rambd_t; - - -// Create a RAM block device using the geometry in lfs_config -int lfs_rambd_create(const struct lfs_config *cfg); -int lfs_rambd_createcfg(const struct lfs_config *cfg, - const struct lfs_rambd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_rambd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_rambd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h b/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h deleted file mode 100644 index 61679e5e026..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Testing block device, wraps filebd and rambd while providing a bunch - * of hooks for testing littlefs in various conditions. - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_TESTBD_H -#define LFS_TESTBD_H - -#include "lfs.h" -#include "lfs_util.h" -#include "bd/lfs_rambd.h" -#include "bd/lfs_filebd.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_TESTBD_YES_TRACE -#define LFS_TESTBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_TESTBD_TRACE(...) -#endif - -// Mode determining how "bad blocks" behave during testing. This simulates -// some real-world circumstances such as progs not sticking (prog-noop), -// a readonly disk (erase-noop), and ECC failures (read-error). -// -// Not that read-noop is not allowed. Read _must_ return a consistent (but -// may be arbitrary) value on every read. -enum lfs_testbd_badblock_behavior { - LFS_TESTBD_BADBLOCK_PROGERROR, - LFS_TESTBD_BADBLOCK_ERASEERROR, - LFS_TESTBD_BADBLOCK_READERROR, - LFS_TESTBD_BADBLOCK_PROGNOOP, - LFS_TESTBD_BADBLOCK_ERASENOOP, -}; - -// Type for measuring wear -typedef uint32_t lfs_testbd_wear_t; -typedef int32_t lfs_testbd_swear_t; - -// testbd config, this is required for testing -struct lfs_testbd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; - - // Number of erase cycles before a block becomes "bad". The exact behavior - // of bad blocks is controlled by the badblock_mode. - uint32_t erase_cycles; - - // The mode determining how bad blocks fail - uint8_t badblock_behavior; - - // Number of write operations (erase/prog) before forcefully killing - // the program with exit. Simulates power-loss. 0 disables. - uint32_t power_cycles; - - // Optional buffer for RAM block device. - void *buffer; - - // Optional buffer for wear - void *wear_buffer; -}; - -// testbd state -typedef struct lfs_testbd { - union { - struct { - lfs_filebd_t bd; - struct lfs_filebd_config cfg; - } file; - struct { - lfs_rambd_t bd; - struct lfs_rambd_config cfg; - } ram; - } u; - - bool persist; - uint32_t power_cycles; - lfs_testbd_wear_t *wear; - - const struct lfs_testbd_config *cfg; -} lfs_testbd_t; - - -/// Block device API /// - -// Create a test block device using the geometry in lfs_config -// -// Note that filebd is used if a path is provided, if path is NULL -// testbd will use rambd which can be much faster. -int lfs_testbd_create(const struct lfs_config *cfg, const char *path); -int lfs_testbd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_testbd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_testbd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_testbd_sync(const struct lfs_config *cfg); - - -/// Additional extended API for driving test features /// - -// Get simulated wear on a given block -lfs_testbd_swear_t lfs_testbd_getwear(const struct lfs_config *cfg, - lfs_block_t block); - -// Manually set simulated wear on a given block -int lfs_testbd_setwear(const struct lfs_config *cfg, - lfs_block_t block, lfs_testbd_wear_t wear); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/lfs.h b/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/lfs.h deleted file mode 100644 index 3fc1e982f1a..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/lfs.h +++ /dev/null @@ -1,701 +0,0 @@ -/* - * The little filesystem - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_H -#define LFS_H - -#include -#include -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/// Version info /// - -// Software library version -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_VERSION 0x00020005 -#define LFS_VERSION_MAJOR (0xffff & (LFS_VERSION >> 16)) -#define LFS_VERSION_MINOR (0xffff & (LFS_VERSION >> 0)) - -// Version of On-disk data structures -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_DISK_VERSION 0x00020000 -#define LFS_DISK_VERSION_MAJOR (0xffff & (LFS_DISK_VERSION >> 16)) -#define LFS_DISK_VERSION_MINOR (0xffff & (LFS_DISK_VERSION >> 0)) - - -/// Definitions /// - -// Type definitions -typedef uint32_t lfs_size_t; -typedef uint32_t lfs_off_t; - -typedef int32_t lfs_ssize_t; -typedef int32_t lfs_soff_t; - -typedef uint32_t lfs_block_t; - -// Maximum name size in bytes, may be redefined to reduce the size of the -// info struct. Limited to <= 1022. Stored in superblock and must be -// respected by other littlefs drivers. -#ifndef LFS_NAME_MAX -#define LFS_NAME_MAX 255 -#endif - -// Maximum size of a file in bytes, may be redefined to limit to support other -// drivers. Limited on disk to <= 4294967296. However, above 2147483647 the -// functions lfs_file_seek, lfs_file_size, and lfs_file_tell will return -// incorrect values due to using signed integers. Stored in superblock and -// must be respected by other littlefs drivers. -#ifndef LFS_FILE_MAX -#define LFS_FILE_MAX 2147483647 -#endif - -// Maximum size of custom attributes in bytes, may be redefined, but there is -// no real benefit to using a smaller LFS_ATTR_MAX. Limited to <= 1022. -#ifndef LFS_ATTR_MAX -#define LFS_ATTR_MAX 1022 -#endif - -// Possible error codes, these are negative to allow -// valid positive return values -enum lfs_error { - LFS_ERR_OK = 0, // No error - LFS_ERR_IO = -5, // Error during device operation - LFS_ERR_CORRUPT = -84, // Corrupted - LFS_ERR_NOENT = -2, // No directory entry - LFS_ERR_EXIST = -17, // Entry already exists - LFS_ERR_NOTDIR = -20, // Entry is not a dir - LFS_ERR_ISDIR = -21, // Entry is a dir - LFS_ERR_NOTEMPTY = -39, // Dir is not empty - LFS_ERR_BADF = -9, // Bad file number - LFS_ERR_FBIG = -27, // File too large - LFS_ERR_INVAL = -22, // Invalid parameter - LFS_ERR_NOSPC = -28, // No space left on device - LFS_ERR_NOMEM = -12, // No more memory available - LFS_ERR_NOATTR = -61, // No data/attr available - LFS_ERR_NAMETOOLONG = -36, // File name too long -}; - -// File types -enum lfs_type { - // file types - LFS_TYPE_REG = 0x001, - LFS_TYPE_DIR = 0x002, - - // internally used types - LFS_TYPE_SPLICE = 0x400, - LFS_TYPE_NAME = 0x000, - LFS_TYPE_STRUCT = 0x200, - LFS_TYPE_USERATTR = 0x300, - LFS_TYPE_FROM = 0x100, - LFS_TYPE_TAIL = 0x600, - LFS_TYPE_GLOBALS = 0x700, - LFS_TYPE_CRC = 0x500, - - // internally used type specializations - LFS_TYPE_CREATE = 0x401, - LFS_TYPE_DELETE = 0x4ff, - LFS_TYPE_SUPERBLOCK = 0x0ff, - LFS_TYPE_DIRSTRUCT = 0x200, - LFS_TYPE_CTZSTRUCT = 0x202, - LFS_TYPE_INLINESTRUCT = 0x201, - LFS_TYPE_SOFTTAIL = 0x600, - LFS_TYPE_HARDTAIL = 0x601, - LFS_TYPE_MOVESTATE = 0x7ff, - - // internal chip sources - LFS_FROM_NOOP = 0x000, - LFS_FROM_MOVE = 0x101, - LFS_FROM_USERATTRS = 0x102, -}; - -// File open flags -enum lfs_open_flags { - // open flags - LFS_O_RDONLY = 1, // Open a file as read only -#ifndef LFS_READONLY - LFS_O_WRONLY = 2, // Open a file as write only - LFS_O_RDWR = 3, // Open a file as read and write - LFS_O_CREAT = 0x0100, // Create a file if it does not exist - LFS_O_EXCL = 0x0200, // Fail if a file already exists - LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size - LFS_O_APPEND = 0x0800, // Move to end of file on every write -#endif - - // internally used flags -#ifndef LFS_READONLY - LFS_F_DIRTY = 0x010000, // File does not match storage - LFS_F_WRITING = 0x020000, // File has been written since last flush -#endif - LFS_F_READING = 0x040000, // File has been read since last flush -#ifndef LFS_READONLY - LFS_F_ERRED = 0x080000, // An error occurred during write -#endif - LFS_F_INLINE = 0x100000, // Currently inlined in directory entry -}; - -// File seek flags -enum lfs_whence_flags { - LFS_SEEK_SET = 0, // Seek relative to an absolute position - LFS_SEEK_CUR = 1, // Seek relative to the current file position - LFS_SEEK_END = 2, // Seek relative to the end of the file -}; - - -// Configuration provided during initialization of the littlefs -struct lfs_config { - // Opaque user provided context that can be used to pass - // information to the block device operations - void *context; - - // Read a region in a block. Negative error codes are propagated - // to the user. - int (*read)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - - // Program a region in a block. The block must have previously - // been erased. Negative error codes are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*prog)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - - // Erase a block. A block must be erased before being programmed. - // The state of an erased block is undefined. Negative error codes - // are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*erase)(const struct lfs_config *c, lfs_block_t block); - - // Sync the state of the underlying block device. Negative error codes - // are propagated to the user. - int (*sync)(const struct lfs_config *c); - -#ifdef LFS_THREADSAFE - // Lock the underlying block device. Negative error codes - // are propagated to the user. - int (*lock)(const struct lfs_config *c); - - // Unlock the underlying block device. Negative error codes - // are propagated to the user. - int (*unlock)(const struct lfs_config *c); -#endif - - // Minimum size of a block read in bytes. All read operations will be a - // multiple of this value. - lfs_size_t read_size; - - // Minimum size of a block program in bytes. All program operations will be - // a multiple of this value. - lfs_size_t prog_size; - - // Size of an erasable block in bytes. This does not impact ram consumption - // and may be larger than the physical erase size. However, non-inlined - // files take up at minimum one block. Must be a multiple of the read and - // program sizes. - lfs_size_t block_size; - - // Number of erasable blocks on the device. - lfs_size_t block_count; - - // Number of erase cycles before littlefs evicts metadata logs and moves - // the metadata to another block. Suggested values are in the - // range 100-1000, with large values having better performance at the cost - // of less consistent wear distribution. - // - // Set to -1 to disable block-level wear-leveling. - int32_t block_cycles; - - // Size of block caches in bytes. Each cache buffers a portion of a block in - // RAM. The littlefs needs a read cache, a program cache, and one additional - // cache per file. Larger caches can improve performance by storing more - // data and reducing the number of disk accesses. Must be a multiple of the - // read and program sizes, and a factor of the block size. - lfs_size_t cache_size; - - // Size of the lookahead buffer in bytes. A larger lookahead buffer - // increases the number of blocks found during an allocation pass. The - // lookahead buffer is stored as a compact bitmap, so each byte of RAM - // can track 8 blocks. Must be a multiple of 8. - lfs_size_t lookahead_size; - - // Optional statically allocated read buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *read_buffer; - - // Optional statically allocated program buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *prog_buffer; - - // Optional statically allocated lookahead buffer. Must be lookahead_size - // and aligned to a 32-bit boundary. By default lfs_malloc is used to - // allocate this buffer. - void *lookahead_buffer; - - // Optional upper limit on length of file names in bytes. No downside for - // larger names except the size of the info struct which is controlled by - // the LFS_NAME_MAX define. Defaults to LFS_NAME_MAX when zero. Stored in - // superblock and must be respected by other littlefs drivers. - lfs_size_t name_max; - - // Optional upper limit on files in bytes. No downside for larger files - // but must be <= LFS_FILE_MAX. Defaults to LFS_FILE_MAX when zero. Stored - // in superblock and must be respected by other littlefs drivers. - lfs_size_t file_max; - - // Optional upper limit on custom attributes in bytes. No downside for - // larger attributes size but must be <= LFS_ATTR_MAX. Defaults to - // LFS_ATTR_MAX when zero. - lfs_size_t attr_max; - - // Optional upper limit on total space given to metadata pairs in bytes. On - // devices with large blocks (e.g. 128kB) setting this to a low size (2-8kB) - // can help bound the metadata compaction time. Must be <= block_size. - // Defaults to block_size when zero. - lfs_size_t metadata_max; -}; - -// File info structure -struct lfs_info { - // Type of the file, either LFS_TYPE_REG or LFS_TYPE_DIR - uint8_t type; - - // Size of the file, only valid for REG files. Limited to 32-bits. - lfs_size_t size; - - // Name of the file stored as a null-terminated string. Limited to - // LFS_NAME_MAX+1, which can be changed by redefining LFS_NAME_MAX to - // reduce RAM. LFS_NAME_MAX is stored in superblock and must be - // respected by other littlefs drivers. - char name[LFS_NAME_MAX+1]; -}; - -// Custom attribute structure, used to describe custom attributes -// committed atomically during file writes. -struct lfs_attr { - // 8-bit type of attribute, provided by user and used to - // identify the attribute - uint8_t type; - - // Pointer to buffer containing the attribute - void *buffer; - - // Size of attribute in bytes, limited to LFS_ATTR_MAX - lfs_size_t size; -}; - -// Optional configuration provided during lfs_file_opencfg -struct lfs_file_config { - // Optional statically allocated file buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *buffer; - - // Optional list of custom attributes related to the file. If the file - // is opened with read access, these attributes will be read from disk - // during the open call. If the file is opened with write access, the - // attributes will be written to disk every file sync or close. This - // write occurs atomically with update to the file's contents. - // - // Custom attributes are uniquely identified by an 8-bit type and limited - // to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller - // than the buffer, it will be padded with zeros. If the stored attribute - // is larger, then it will be silently truncated. If the attribute is not - // found, it will be created implicitly. - struct lfs_attr *attrs; - - // Number of custom attributes in the list - lfs_size_t attr_count; -}; - - -/// internal littlefs data structures /// -typedef struct lfs_cache { - lfs_block_t block; - lfs_off_t off; - lfs_size_t size; - uint8_t *buffer; -} lfs_cache_t; - -typedef struct lfs_mdir { - lfs_block_t pair[2]; - uint32_t rev; - lfs_off_t off; - uint32_t etag; - uint16_t count; - bool erased; - bool split; - lfs_block_t tail[2]; -} lfs_mdir_t; - -// littlefs directory type -typedef struct lfs_dir { - struct lfs_dir *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - lfs_off_t pos; - lfs_block_t head[2]; -} lfs_dir_t; - -// littlefs file type -typedef struct lfs_file { - struct lfs_file *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - struct lfs_ctz { - lfs_block_t head; - lfs_size_t size; - } ctz; - - uint32_t flags; - lfs_off_t pos; - lfs_block_t block; - lfs_off_t off; - lfs_cache_t cache; - - const struct lfs_file_config *cfg; -} lfs_file_t; - -typedef struct lfs_superblock { - uint32_t version; - lfs_size_t block_size; - lfs_size_t block_count; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; -} lfs_superblock_t; - -typedef struct lfs_gstate { - uint32_t tag; - lfs_block_t pair[2]; -} lfs_gstate_t; - -// The littlefs filesystem type -typedef struct lfs { - lfs_cache_t rcache; - lfs_cache_t pcache; - - lfs_block_t root[2]; - struct lfs_mlist { - struct lfs_mlist *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - } *mlist; - uint32_t seed; - - lfs_gstate_t gstate; - lfs_gstate_t gdisk; - lfs_gstate_t gdelta; - - struct lfs_free { - lfs_block_t off; - lfs_block_t size; - lfs_block_t i; - lfs_block_t ack; - uint32_t *buffer; - } free; - - const struct lfs_config *cfg; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; - -#ifdef LFS_MIGRATE - struct lfs1 *lfs1; -#endif -} lfs_t; - - -/// Filesystem functions /// - -#ifndef LFS_READONLY -// Format a block device with the littlefs -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_format(lfs_t *lfs, const struct lfs_config *config); -#endif - -// Mounts a littlefs -// -// Requires a littlefs object and config struct. Multiple filesystems -// may be mounted simultaneously with multiple littlefs objects. Both -// lfs and config must be allocated while mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_mount(lfs_t *lfs, const struct lfs_config *config); - -// Unmounts a littlefs -// -// Does nothing besides releasing any allocated resources. -// Returns a negative error code on failure. -int lfs_unmount(lfs_t *lfs); - -/// General operations /// - -#ifndef LFS_READONLY -// Removes a file or directory -// -// If removing a directory, the directory must be empty. -// Returns a negative error code on failure. -int lfs_remove(lfs_t *lfs, const char *path); -#endif - -#ifndef LFS_READONLY -// Rename or move a file or directory -// -// If the destination exists, it must match the source in type. -// If the destination is a directory, the directory must be empty. -// -// Returns a negative error code on failure. -int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath); -#endif - -// Find info about a file or directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a negative error code on failure. -int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info); - -// Get a custom attribute -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller than -// the buffer, it will be padded with zeros. If the stored attribute is larger, -// then it will be silently truncated. If no attribute is found, the error -// LFS_ERR_NOATTR is returned and the buffer is filled with zeros. -// -// Returns the size of the attribute, or a negative error code on failure. -// Note, the returned size is the size of the attribute on disk, irrespective -// of the size of the buffer. This can be used to dynamically allocate a buffer -// or check for existence. -lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path, - uint8_t type, void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Set custom attributes -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. If an attribute is not found, it will be -// implicitly created. -// -// Returns a negative error code on failure. -int lfs_setattr(lfs_t *lfs, const char *path, - uint8_t type, const void *buffer, lfs_size_t size); -#endif - -#ifndef LFS_READONLY -// Removes a custom attribute -// -// If an attribute is not found, nothing happens. -// -// Returns a negative error code on failure. -int lfs_removeattr(lfs_t *lfs, const char *path, uint8_t type); -#endif - - -/// File operations /// - -#ifndef LFS_NO_MALLOC -// Open a file -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// Returns a negative error code on failure. -int lfs_file_open(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags); - -// if LFS_NO_MALLOC is defined, lfs_file_open() will fail with LFS_ERR_NOMEM -// thus use lfs_file_opencfg() with config.buffer set. -#endif - -// Open a file with extra configuration -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// The config struct provides additional config options per file as described -// above. The config struct must be allocated while the file is open, and the -// config struct must be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags, - const struct lfs_file_config *config); - -// Close a file -// -// Any pending writes are written out to storage as though -// sync had been called and releases any allocated resources. -// -// Returns a negative error code on failure. -int lfs_file_close(lfs_t *lfs, lfs_file_t *file); - -// Synchronize a file on storage -// -// Any pending writes are written out to storage. -// Returns a negative error code on failure. -int lfs_file_sync(lfs_t *lfs, lfs_file_t *file); - -// Read data from file -// -// Takes a buffer and size indicating where to store the read data. -// Returns the number of bytes read, or a negative error code on failure. -lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file, - void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Write data to file -// -// Takes a buffer and size indicating the data to write. The file will not -// actually be updated on the storage until either sync or close is called. -// -// Returns the number of bytes written, or a negative error code on failure. -lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file, - const void *buffer, lfs_size_t size); -#endif - -// Change the position of the file -// -// The change in position is determined by the offset and whence flag. -// Returns the new position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file, - lfs_soff_t off, int whence); - -#ifndef LFS_READONLY -// Truncates the size of the file to the specified size -// -// Returns a negative error code on failure. -int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size); -#endif - -// Return the position of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR) -// Returns the position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file); - -// Change the position of the file to the beginning of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_SET) -// Returns a negative error code on failure. -int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file); - -// Return the size of the file -// -// Similar to lfs_file_seek(lfs, file, 0, LFS_SEEK_END) -// Returns the size of the file, or a negative error code on failure. -lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file); - - -/// Directory operations /// - -#ifndef LFS_READONLY -// Create a directory -// -// Returns a negative error code on failure. -int lfs_mkdir(lfs_t *lfs, const char *path); -#endif - -// Open a directory -// -// Once open a directory can be used with read to iterate over files. -// Returns a negative error code on failure. -int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path); - -// Close a directory -// -// Releases any allocated resources. -// Returns a negative error code on failure. -int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir); - -// Read an entry in the directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a positive value on success, 0 at the end of directory, -// or a negative error code on failure. -int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info); - -// Change the position of the directory -// -// The new off must be a value previous returned from tell and specifies -// an absolute offset in the directory seek. -// -// Returns a negative error code on failure. -int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off); - -// Return the position of the directory -// -// The returned offset is only meant to be consumed by seek and may not make -// sense, but does indicate the current position in the directory iteration. -// -// Returns the position of the directory, or a negative error code on failure. -lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir); - -// Change the position of the directory to the beginning of the directory -// -// Returns a negative error code on failure. -int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir); - - -/// Filesystem-level filesystem operations - -// Finds the current size of the filesystem -// -// Note: Result is best effort. If files share COW structures, the returned -// size may be larger than the filesystem actually is. -// -// Returns the number of allocated blocks, or a negative error code on failure. -lfs_ssize_t lfs_fs_size(lfs_t *lfs); - -// Traverse through all blocks in use by the filesystem -// -// The provided callback will be called with each block address that is -// currently in use by the filesystem. This can be used to determine which -// blocks are in use or how much of the storage is available. -// -// Returns a negative error code on failure. -int lfs_fs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data); - -#ifndef LFS_READONLY -#ifdef LFS_MIGRATE -// Attempts to migrate a previous version of littlefs -// -// Behaves similarly to the lfs_format function. Attempts to mount -// the previous version of littlefs and update the filesystem so it can be -// mounted with the current version of littlefs. -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg); -#endif -#endif - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/lfs_util.h b/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/lfs_util.h deleted file mode 100644 index 0cbc2a31995..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs/lfs_util.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_UTIL_H -#define LFS_UTIL_H - -// Users can override lfs_util.h with their own configuration by defining -// LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h). -// -// If LFS_CONFIG is used, none of the default utils will be emitted and must be -// provided by the config file. To start, I would suggest copying lfs_util.h -// and modifying as needed. -#ifdef LFS_CONFIG -#define LFS_STRINGIZE(x) LFS_STRINGIZE2(x) -#define LFS_STRINGIZE2(x) #x -#include LFS_STRINGIZE(LFS_CONFIG) -#else - -// System includes -#include -#include -#include -#include - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return malloc(size); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif -#endif diff --git a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs_api.h b/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs_api.h deleted file mode 100644 index 135b05972d0..00000000000 --- a/tools/sdk/esp32s2/include/esp_littlefs/src/littlefs_api.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ESP_LITTLEFS_API_H__ -#define ESP_LITTLEFS_API_H__ - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp_vfs.h" -#include "esp_partition.h" -#include "littlefs/lfs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief a file descriptor - * That's also a singly linked list used for keeping tracks of all opened file descriptor - * - * Shortcomings/potential issues of 32-bit hash (when CONFIG_LITTLEFS_USE_ONLY_HASH) listed here: - * * unlink - If a different file is open that generates a hash collision, it will report an - * error that it cannot unlink an open file. - * * rename - If a different file is open that generates a hash collision with - * src or dst, it will report an error that it cannot rename an open file. - * Potential consequences: - * 1. A file cannot be deleted while a collision-geneating file is open. - * Worst-case, if the other file is always open during the lifecycle - * of your app, it's collision file cannot be deleted, which in the - * worst-case could cause storage-capacity issues. - * 2. Same as (1), but for renames - */ -typedef struct _vfs_littlefs_file_t { - lfs_file_t file; - uint32_t hash; - struct _vfs_littlefs_file_t * next; /*!< Pointer to next file in Singly Linked List */ -#ifndef CONFIG_LITTLEFS_USE_ONLY_HASH - char * path; -#endif -} vfs_littlefs_file_t; - -/** - * @brief littlefs definition structure - */ -typedef struct { - lfs_t *fs; /*!< Handle to the underlying littlefs */ - SemaphoreHandle_t lock; /*!< FS lock */ - const esp_partition_t* partition; /*!< The partition on which littlefs is located */ - char base_path[ESP_VFS_PATH_MAX+1]; /*!< Mount point */ - - struct lfs_config cfg; /*!< littlefs Mount configuration */ - - vfs_littlefs_file_t *file; /*!< Singly Linked List of files */ - - vfs_littlefs_file_t **cache; /*!< A cache of pointers to the opened files */ - uint16_t cache_size; /*!< The cache allocated size (in pointers) */ - uint16_t fd_count; /*!< The count of opened file descriptor used to speed up computation */ -} esp_littlefs_t; - -/** - * @brief Read a region in a block. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_read(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -/** - * @brief Program a region in a block. - * - * The block must have previously been erased. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_prog(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -/** - * @brief Erase a block. - * - * A block must be erased before being programmed. - * The state of an erased block is undefined. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * @return errorcode. 0 on success. - */ -int littlefs_api_erase(const struct lfs_config *c, lfs_block_t block); - -/** - * @brief Sync the state of the underlying block device. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_sync(const struct lfs_config *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/esp32s2/include/esp_rainmaker/include/esp_rmaker_ota.h b/tools/sdk/esp32s2/include/esp_rainmaker/include/esp_rmaker_ota.h index 6dc7962177e..c5483a8afbd 100644 --- a/tools/sdk/esp32s2/include/esp_rainmaker/include/esp_rmaker_ota.h +++ b/tools/sdk/esp32s2/include/esp_rainmaker/include/esp_rmaker_ota.h @@ -21,6 +21,31 @@ extern "C" { #endif +/** @cond **/ +/** ESP RainMaker Event Base */ +ESP_EVENT_DECLARE_BASE(RMAKER_OTA_EVENT); +/** @endcond **/ + +/** ESP RainMaker Events */ +typedef enum { + /* Invalid event. Used for internal handling only */ + RMAKER_OTA_EVENT_INVALID = 0, + /** RainMaker OTA is Starting */ + RMAKER_OTA_EVENT_STARTING, + /** RainMaker OTA has Started */ + RMAKER_OTA_EVENT_IN_PROGRESS, + /** RainMaker OTA Successful */ + RMAKER_OTA_EVENT_SUCCESSFUL, + /** RainMaker OTA Failed */ + RMAKER_OTA_EVENT_FAILED, + /** RainMaker OTA Rejected */ + RMAKER_OTA_EVENT_REJECTED, + /** RainMaker OTA Delayed */ + RMAKER_OTA_EVENT_DELAYED, + /** OTA Image has been flashed and active partition changed. Reboot is requested. Applicable only if Auto reboot is disabled **/ + RMAKER_OTA_EVENT_REQ_FOR_REBOOT, +} esp_rmaker_ota_event_t; + /** Default ESP RainMaker OTA Server Certificate */ extern const char *ESP_RMAKER_OTA_DEFAULT_SERVER_CERT; @@ -56,10 +81,16 @@ typedef struct { /** Size of the OTA File. Can be 0 if the file size isn't received from * the ESP RainMaker Cloud */ int filesize; + /** The firmware version of the OTA image **/ + char *fw_version; + /** The OTA Job ID received from cloud **/ + char *ota_job_id; /** The server certificate passed in esp_rmaker_enable_ota() */ const char *server_cert; /** The private data passed in esp_rmaker_enable_ota() */ char *priv; + /** OTA Metadata. Applicable only for OTA using Topics. Will be received (if applicable) from the backend, alongwith the OTA URL */ + char *metadata; } esp_rmaker_ota_data_t; /** Function prototype for OTA Callback @@ -170,6 +201,18 @@ esp_err_t esp_rmaker_ota_default_cb(esp_rmaker_ota_handle_t handle, esp_rmaker_o * @return error on failure */ esp_err_t esp_rmaker_ota_fetch(void); + +/** Fetch OTA Info with a delay + * + * For OTA using Topics, this API can be used to explicitly ask the backend if an OTA is available + * after a delay (in seconds) passed as an argument. + * + * @param[in] time Delay (in seconds) + * + * @return ESP_OK if the OTA fetch timer was created. + * @return error on failure + */ +esp_err_t esp_rmaker_ota_fetch_with_delay(int time); #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/esp_rom/esp32s2/esp_rom_caps.h b/tools/sdk/esp32s2/include/esp_rom/esp32s2/esp_rom_caps.h index 0f63dfb5423..1078ff8997f 100644 --- a/tools/sdk/esp32s2/include/esp_rom/esp32s2/esp_rom_caps.h +++ b/tools/sdk/esp32s2/include/esp_rom/esp32s2/esp_rom_caps.h @@ -1,18 +1,11 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #define ESP_ROM_HAS_CRC_LE (1) // ROM CRC library supports Little Endian #define ESP_ROM_SUPPORT_MULTIPLE_UART (1) // ROM has multiple UARTs available for logging +#define ESP_ROM_NEEDS_SWSETUP_WORKAROUND (1) // ROM uses 32-bit time_t. A workaround is required to prevent printf functions from crashing diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp32/rom/miniz.h b/tools/sdk/esp32s2/include/esp_rom/include/esp32/rom/miniz.h index 7661f804468..5fefa84999a 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp32/rom/miniz.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp32/rom/miniz.h @@ -760,7 +760,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp32c3/rom/miniz.h b/tools/sdk/esp32s2/include/esp_rom/include/esp32c3/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp32c3/rom/miniz.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp32c3/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp32h2/rom/miniz.h b/tools/sdk/esp32s2/include/esp_rom/include/esp32h2/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp32h2/rom/miniz.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp32h2/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp32s2/rom/miniz.h b/tools/sdk/esp32s2/include/esp_rom/include/esp32s2/rom/miniz.h index b9b9202aaa7..fd2fe3c9a19 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp32s2/rom/miniz.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp32s2/rom/miniz.h @@ -745,7 +745,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp32s3/rom/miniz.h b/tools/sdk/esp32s2/include/esp_rom/include/esp32s3/rom/miniz.h index 7553511349e..f095b539b9b 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp32s3/rom/miniz.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp32s3/rom/miniz.h @@ -728,7 +728,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_efuse.h b/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_efuse.h index 907e175ecad..6280a1e5b60 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_efuse.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -20,6 +12,7 @@ extern "C" { #include #include +#include "soc/soc_caps.h" #define ESP_ROM_EFUSE_FLASH_DEFAULT_SPI (0) #define ESP_ROM_EFUSE_FLASH_DEFAULT_HSPI (1) @@ -56,6 +49,18 @@ uint32_t esp_rom_efuse_get_flash_gpio_info(void); */ uint32_t esp_rom_efuse_get_flash_wp_gpio(void); +#if SOC_SPI_MEM_SUPPORT_OPI_MODE +/** + * @brief Read opi flash pads configuration from Efuse + * + * @return + * - 0 for default SPI pins. + * - Other values define a custom pin configuration mask. From the LSB, every 6 bits represent a GPIO number which stand for: + * DQS, D4, D5, D6, D7 accordingly. + */ +uint32_t esp_rom_efuse_get_opiconfig(void); +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE + /** * @brief Read eFuse to check whether secure boot has been enabled or not * diff --git a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h b/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h b/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h deleted file mode 100644 index 49ba82ddf00..00000000000 --- a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 72 diff --git a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h b/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32s2/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32s2/include/esp_timer/include/esp_private/esp_timer_private.h b/tools/sdk/esp32s2/include/esp_timer/include/esp_private/esp_timer_private.h index ecd42641115..6f32f1431e1 100644 --- a/tools/sdk/esp32s2/include/esp_timer/include/esp_private/esp_timer_private.h +++ b/tools/sdk/esp32s2/include/esp_timer/include/esp_private/esp_timer_private.h @@ -52,11 +52,11 @@ void esp_timer_private_update_apb_freq(uint32_t apb_ticks_per_us); void esp_timer_private_advance(int64_t time_us); /** - * @brief obtain internal critical section used esp_timer implementation + * @brief obtain internal critical section used in the esp_timer implementation * This can be used when a sequence of calls to esp_timer has to be made, * and it is necessary that the state of the timer is consistent between * the calls. Should be treated in the same way as a spinlock. - * Call esp_timer_unlock to release the lock + * Call esp_timer_private_unlock to release the lock */ void esp_timer_private_lock(void); diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_coexist_internal.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_coexist_internal.h index 7ba06d4c690..1633c020276 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_coexist_internal.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_coexist_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,6 +23,7 @@ typedef enum { } coex_prefer_t; typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); +typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void); /** * @brief Pre-Init software coexist @@ -115,6 +116,18 @@ int coex_wifi_release(uint32_t event); */ int coex_wifi_channel_set(uint8_t primary, uint8_t secondary); +/** + * @brief Register application callback function to Wi-Fi update low power clock module. + * + * @param callback : Wi-Fi update low power clock callback function + */ +void coex_wifi_register_update_lpclk_callback(coex_set_lpclk_source_callback_t callback); + +/** + * @brief Update low power clock interval + */ +void coex_update_lpclk_interval(void); + /** * @brief Get coexistence event duration. * diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi.h index a2c763260e5..7b2a7ef4851 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -496,6 +496,15 @@ bool esp_wifi_internal_is_tsf_active(void); * */ void esp_wifi_internal_update_light_sleep_wake_ahead_time(uint32_t); + +/** + * @brief Update WiFi TSF tick interval + * + * @return + * - true: Active + * - false: Not active + */ +esp_err_t esp_wifi_update_tsf_tick_interval(void); #endif /** @@ -590,6 +599,15 @@ void esp_wifi_set_sleep_delay_time(uint32_t return_to_sleep_delay); */ void esp_wifi_set_keep_alive_time(uint32_t keep_alive_time); +/** + * @brief Configure wifi beacon montior default parameters + * + * @param enable: enable or disable beacon monitor + * @param timeout: timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond + * @param threshold: maximum number of consecutive lost beacons allowed + */ +void esp_wifi_beacon_monitor_configure(bool enable, int timeout, int threshold, int delta_intr_early, int delta_timeout); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h index 88d0ee54029..8b921b9da7f 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -77,7 +77,7 @@ typedef struct { void (* _wifi_apb80m_release)(void); void (* _phy_disable)(void); void (* _phy_enable)(void); -#if CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 void (* _phy_common_clock_enable)(void); void (* _phy_common_clock_disable)(void); #endif diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h index e06569dfc15..08be53cf6a4 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h @@ -339,7 +339,7 @@ esp_err_t esp_wifi_restore(void); * * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. - * @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. + * @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between ESP32 and the AP is established. * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error * number ESP_ERR_WIFI_STATE. * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called @@ -600,18 +600,19 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); * @attention 1. It is discouraged to call this API since this doesn't validate the per-country rules, * it's up to the user to fill in all fields according to local regulations. * Please use esp_wifi_set_country_code instead. - * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO} - * @attention 3. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which - * the station is connected is used. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11} + * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}. + * @attention 3. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which + * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected * from the AP the country info is set back to the country info of the station automatically, * {.cc="US", .schan=1, .nchan=11} in the example. - * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. - * @attention 5. When the country info is changed because of configuration or because the station connects to a different + * @attention 5. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. + * @attention 6. When the country info is changed because of configuration or because the station connects to a different * external AP, the country IE in probe response/beacon of the soft-AP is also changed. - * @attention 6. The country configuration is stored into flash. - * @attention 7. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the + * @attention 7. The country configuration is stored into flash. + * @attention 8. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the * country info. * * @param country the configured country info @@ -909,7 +910,7 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range */ esp_err_t esp_wifi_set_max_tx_power(int8_t power); @@ -922,7 +923,7 @@ esp_err_t esp_wifi_set_max_tx_power(int8_t power); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument */ esp_err_t esp_wifi_get_max_tx_power(int8_t *power); @@ -1018,7 +1019,7 @@ esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); @@ -1031,7 +1032,7 @@ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi(bool en); @@ -1244,6 +1245,7 @@ esp_err_t esp_wifi_set_connectionless_wake_interval(uint16_t interval); * * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. * @attention 8. The default country is "CN" and ieee80211d_enabled is TRUE. + * @attention 9. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * * @param country the configured country ISO code * @param ieee80211d_enabled 802.11d is enabled or not diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi_types.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi_types.h index 89020d4abbf..4dae6a8c3fa 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi_types.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi_types.h @@ -219,6 +219,14 @@ typedef struct { bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ } wifi_pmf_config_t; +/** Configuration for SAE PWE derivation */ +typedef enum { + WPA3_SAE_PWE_UNSPECIFIED, + WPA3_SAE_PWE_HUNT_AND_PECK, + WPA3_SAE_PWE_HASH_TO_ELEMENT, + WPA3_SAE_PWE_BOTH, +} wifi_sae_pwe_method_t; + /** @brief Soft-AP configuration settings for the ESP32 */ typedef struct { uint8_t ssid[32]; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ @@ -249,6 +257,7 @@ typedef struct { uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ uint32_t reserved:29; /**< Reserved for future feature set */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Whether SAE hash to element is enabled */ } wifi_sta_config_t; /** @brief Configuration data for ESP32 AP or STA. diff --git a/tools/sdk/esp32s2/include/expat/expat/expat/lib/expat.h b/tools/sdk/esp32s2/include/expat/expat/expat/lib/expat.h index 0f021e25def..e2020a4a29e 100644 --- a/tools/sdk/esp32s2/include/expat/expat/expat/lib/expat.h +++ b/tools/sdk/esp32s2/include/expat/expat/expat/lib/expat.h @@ -15,6 +15,7 @@ Copyright (c) 2016 Cristian Rodríguez Copyright (c) 2016 Thomas Beutlich Copyright (c) 2017 Rhodri James + Copyright (c) 2022 Thijs Schreijer Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -174,8 +175,10 @@ struct XML_cp { }; /* This is called for an element declaration. See above for - description of the model argument. It's the caller's responsibility - to free model when finished with it. + description of the model argument. It's the user code's responsibility + to free model when finished with it. See XML_FreeContentModel. + There is no need to free the model from the handler, it can be kept + around and freed at a later stage. */ typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData, const XML_Char *name, @@ -237,6 +240,17 @@ XML_ParserCreate(const XML_Char *encoding); and the local part will be concatenated without any separator. It is a programming error to use the separator '\0' with namespace triplets (see XML_SetReturnNSTriplet). + If a namespace separator is chosen that can be part of a URI or + part of an XML name, splitting an expanded name back into its + 1, 2 or 3 original parts on application level in the element handler + may end up vulnerable, so these are advised against; sane choices for + a namespace separator are e.g. '\n' (line feed) and '|' (pipe). + + Note that Expat does not validate namespace URIs (beyond encoding) + against RFC 3986 today (and is not required to do so with regard to + the XML 1.0 namespaces specification) but it may start doing that + in future releases. Before that, an application using Expat must + be ready to receive namespace URIs containing non-URI characters. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); @@ -317,7 +331,7 @@ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *pubid, int has_internal_subset); -/* This is called for the start of the DOCTYPE declaration when the +/* This is called for the end of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ @@ -1041,7 +1055,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold( */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 4 -#define XML_MICRO_VERSION 3 +#define XML_MICRO_VERSION 8 #ifdef __cplusplus } diff --git a/tools/sdk/esp32s2/include/expat/port/include/expat_config.h b/tools/sdk/esp32s2/include/expat/port/include/expat_config.h index 468910220f4..42acb52a5ca 100644 --- a/tools/sdk/esp32s2/include/expat/port/include/expat_config.h +++ b/tools/sdk/esp32s2/include/expat/port/include/expat_config.h @@ -63,7 +63,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.4.3" +#define PACKAGE_STRING "expat 2.4.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -72,13 +72,13 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.4.3" +#define PACKAGE_VERSION "2.4.8" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.4.3" +#define VERSION "2.4.8" /* whether byteorder is bigendian */ /* #undef WORDS_BIGENDIAN */ diff --git a/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/idf_additions.h b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/idf_additions.h new file mode 100644 index 00000000000..bd1d0bd2381 --- /dev/null +++ b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/idf_additions.h @@ -0,0 +1,57 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "idf_additions_inc.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Saves the current priority and current base priority of a task, then raises the tasks + * current and base priority to uxNewPriority if uxNewPriority is of a higher priority. + * Once a task's priority has been raised with this function, the priority can be restored + * by calling prvTaskPriorityRestore() + * - Note that this function differs from vTaskPrioritySet() as the task's current priority + * will be modified even if the task has already inherited a priority. + * - This function is intended for special circumstance where a task must be forced immediately + * to a higher priority. + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @note vTaskPrioritySet() should not be called while a task's priority is already raised via this function + * + * @param pxSavedPriority returns base and current priorities + * + * @param uxNewPriority The priority to which the task will be set. + */ +void prvTaskPriorityRaise( prvTaskSavedPriority_t * pxSavedPriority, UBaseType_t uxNewPriority ); + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Restore a task's priority that was previously raised by prvTaskPriorityRaise(). + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @param pxSavedPriority previously saved base and current priorities that need to be restored + */ +void prvTaskPriorityRestore( prvTaskSavedPriority_t * pxSavedPriority ); + +#endif // ( INCLUDE_vTaskPrioritySet == 1) diff --git a/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/idf_additions_inc.h b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/idf_additions_inc.h new file mode 100644 index 00000000000..25b0b6d9a4d --- /dev/null +++ b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/idf_additions_inc.h @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#ifndef FREERTOS_ADDITITIONS_INC_H_ +#define FREERTOS_ADDITITIONS_INC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +typedef struct { + UBaseType_t uxPriority; +#if ( configUSE_MUTEXES == 1 ) + UBaseType_t uxBasePriority; +#endif +} prvTaskSavedPriority_t; + +#endif // ( INCLUDE_vTaskPrioritySet == 1) + +#ifdef __cplusplus +} +#endif + +#endif //FREERTOS_ADDITITIONS_INC_H_ diff --git a/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos_tasks_c_additions.h b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos_tasks_c_additions.h deleted file mode 100644 index 464c0b3ffb9..00000000000 --- a/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos_tasks_c_additions.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -/** - * This file will be included in `tasks.c` file, thus, it must NOT be included - * by any (other) file. - * The functions below only consist in getters for the static variables in - * `tasks.c` file. - * The only source files that should call these functions are the ones in - * `/additions` directory. - */ - -#if ( configENABLE_TASK_SNAPSHOT == 1 ) - - UBaseType_t pxTCBGetSize ( void ) - { - return sizeof(TCB_t); - } - - ListItem_t* pxTCBGetStateListItem ( void *pxTCB ) - { - return &(((TCB_t*)pxTCB)->xStateListItem); - } - - StackType_t* pxTCBGetStartOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxStack; - } - - StackType_t* pxTCBGetTopOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxTopOfStack; - } - - StackType_t* pxTCBGetEndOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxEndOfStack; - } - - - List_t* pxListGetReadyTask ( UBaseType_t idx ) - { - return &( pxReadyTasksLists[idx] ); - } - - List_t* pxListGetReadyPendingTask ( UBaseType_t idx ) - { - return &( xPendingReadyList[idx] ); - } - - List_t* pxGetDelayedTaskList ( void ) { - return pxDelayedTaskList; - } - - List_t* pxGetOverflowDelayedTaskList ( void ) { - return pxOverflowDelayedTaskList; - } - - List_t* pxGetTasksWaitingTermination ( void ) { - return &xTasksWaitingTermination; - } - - List_t* pxGetSuspendedTaskList ( void ) { - return &xSuspendedTaskList; - } - -#endif diff --git a/tools/sdk/esp32s2/include/freertos/include/freertos/task.h b/tools/sdk/esp32s2/include/freertos/include/freertos/task.h index 88b2730933d..89841757d49 100644 --- a/tools/sdk/esp32s2/include/freertos/include/freertos/task.h +++ b/tools/sdk/esp32s2/include/freertos/include/freertos/task.h @@ -2655,12 +2655,13 @@ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, * not have this parameter and always waits for notifications on index 0. * * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value - * will be cleared in the calling task's notification value before the task - * checks to see if any notifications are pending, and optionally blocks if no - * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if - * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have - * the effect of resetting the task's notification value to 0. Setting - * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged. + * will be cleared in the calling task's notification value before the task is + * marked as waiting for a new notification (provided a notification is not + * already pending). Optionally blocks if no notifications are pending. Setting + * ulBitsToClearOnEntry to ULONG_MAX (if limits.h is included) or 0xffffffffUL + * (if limits.h is not included) will have the effect of resetting the task's + * notification value to 0. Setting ulBitsToClearOnEntry to 0 will leave the + * task's notification value unchanged. * * @param ulBitsToClearOnExit If a notification is pending or received before * the calling task exits the xTaskNotifyWait() function then the task's @@ -3367,6 +3368,25 @@ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION; +#ifdef ESP_PLATFORM +/* + * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN + * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. + * + * This function is a wrapper to take the "xTaskQueueMutex" spinlock of tasks.c. + * This lock is taken whenver any of the task lists or event lists are + * accessed/modified, such as when adding/removing tasks to/from the delayed + * task list or various event lists. + * + * This functions is meant to be called by xEventGroupSetBits() and + * vEventGroupDelete() as both those functions will access event lists (instead + * of delegating the entire responsibility to one of vTask...EventList() + * functions). + */ +void vTaskTakeEventListLock( void ); +void vTaskReleaseEventListLock( void ); +#endif // ESP_PLATFORM + /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. diff --git a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/i2c_ll.h b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/i2c_ll.h index 1d2b8a0c137..f332613e562 100644 --- a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/i2c_ll.h +++ b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/i2c_ll.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // The LL layer for I2C register operations @@ -907,6 +899,39 @@ static inline void i2c_ll_update(i2c_dev_t *hw) ;// ESP32S2 do not support } +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +static inline void i2c_ll_set_scl_clk_timing(i2c_dev_t *hw, int high_period, int low_period, int wait_high_period) +{ + hw->scl_low_period.period = low_period; + hw->scl_high_period.period = high_period; + hw->scl_high_period.scl_wait_high_period = wait_high_period; +} + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +static inline void i2c_ll_get_scl_clk_timing(i2c_dev_t *hw, int *high_period, int *low_period, int *wait_high_period) +{ + *high_period = hw->scl_high_period.period; + *wait_high_period = hw->scl_high_period.scl_wait_high_period; + *low_period = hw->scl_low_period.period; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_ll.h b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_ll.h index b975206d0f2..c43e3e8e51e 100644 --- a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_ll.h +++ b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_ll.h @@ -84,6 +84,21 @@ typedef enum { } spi_ll_trans_len_cond_t; FLAG_ATTR(spi_ll_trans_len_cond_t) +// SPI base command in esp32s2 +typedef enum { + /* Slave HD Only */ + SPI_LL_BASE_CMD_HD_WRBUF = 0x01, + SPI_LL_BASE_CMD_HD_RDBUF = 0x02, + SPI_LL_BASE_CMD_HD_WRDMA = 0x03, + SPI_LL_BASE_CMD_HD_RDDMA = 0x04, + SPI_LL_BASE_CMD_HD_SEG_END = 0x05, + SPI_LL_BASE_CMD_HD_EN_QPI = 0x06, + SPI_LL_BASE_CMD_HD_WR_END = 0x07, + SPI_LL_BASE_CMD_HD_INT0 = 0x08, + SPI_LL_BASE_CMD_HD_INT1 = 0x09, + SPI_LL_BASE_CMD_HD_INT2 = 0x0A, +} spi_ll_base_command_t; + /*------------------------------------------------------------------------------ * Control *----------------------------------------------------------------------------*/ @@ -1273,6 +1288,104 @@ static inline bool spi_ll_tx_get_empty_err(spi_dev_t *hw) #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK +/** + * Get the base spi command in esp32s2 + * + * @param cmd_t Command value + */ +static inline uint8_t spi_ll_get_slave_hd_base_command(spi_command_t cmd_t) +{ + uint8_t cmd_base = 0x00; + switch (cmd_t) + { + case SPI_CMD_HD_WRBUF: + cmd_base = SPI_LL_BASE_CMD_HD_WRBUF; + break; + case SPI_CMD_HD_RDBUF: + cmd_base = SPI_LL_BASE_CMD_HD_RDBUF; + break; + case SPI_CMD_HD_WRDMA: + cmd_base = SPI_LL_BASE_CMD_HD_WRDMA; + break; + case SPI_CMD_HD_RDDMA: + cmd_base = SPI_LL_BASE_CMD_HD_RDDMA; + break; + case SPI_CMD_HD_SEG_END: + cmd_base = SPI_LL_BASE_CMD_HD_SEG_END; + break; + case SPI_CMD_HD_EN_QPI: + cmd_base = SPI_LL_BASE_CMD_HD_EN_QPI; + break; + case SPI_CMD_HD_WR_END: + cmd_base = SPI_LL_BASE_CMD_HD_WR_END; + break; + case SPI_CMD_HD_INT0: + cmd_base = SPI_LL_BASE_CMD_HD_INT0; + break; + case SPI_CMD_HD_INT1: + cmd_base = SPI_LL_BASE_CMD_HD_INT1; + break; + case SPI_CMD_HD_INT2: + cmd_base = SPI_LL_BASE_CMD_HD_INT2; + break; + default: + HAL_ASSERT(cmd_base); + } + return cmd_base; +} + +/** + * Get the spi communication command + * + * @param cmd_t Base command value + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline uint16_t spi_ll_get_slave_hd_command(spi_command_t cmd_t, spi_line_mode_t line_mode) +{ + uint8_t cmd_base = spi_ll_get_slave_hd_base_command(cmd_t); + uint8_t cmd_mod = 0x00; //CMD:1-bit, ADDR:1-bit, DATA:1-bit + + if (line_mode.data_lines == 2) { + if (line_mode.addr_lines == 2) { + cmd_mod = 0x50; //CMD:1-bit, ADDR:2-bit, DATA:2-bit + } else { + cmd_mod = 0x10; //CMD:1-bit, ADDR:1-bit, DATA:2-bit + } + } else if (line_mode.data_lines == 4) { + if (line_mode.addr_lines == 4) { + cmd_mod = 0xA0; //CMD:1-bit, ADDR:4-bit, DATA:4-bit + } else { + cmd_mod = 0x20; //CMD:1-bit, ADDR:1-bit, DATA:4-bit + } + } + if (cmd_base == SPI_LL_BASE_CMD_HD_SEG_END || cmd_base == SPI_LL_BASE_CMD_HD_EN_QPI) { + cmd_mod = 0x00; + } + + return cmd_base | cmd_mod; +} + +/** + * Get the dummy bits + * + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline int spi_ll_get_slave_hd_dummy_bits(spi_line_mode_t line_mode) +{ + uint8_t dummy_bits = 0; + + if (line_mode.data_lines == 2) { + dummy_bits = 4; + } else if (line_mode.data_lines == 4) { + dummy_bits = 4; + } else { + dummy_bits = 8; + } + + HAL_ASSERT(dummy_bits); + return dummy_bits; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/hal/include/hal/adc_hal.h b/tools/sdk/esp32s2/include/hal/include/hal/adc_hal.h index b8455e27ecd..787e50246e6 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/adc_hal.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/adc_hal.h @@ -36,9 +36,6 @@ #define ADC_HAL_DMA_INTR_MASK BIT(9) #endif -//For ADC module, each conversion contains 4 bytes -#define ADC_HAL_DATA_LEN_PER_CONV 4 - typedef enum adc_hal_work_mode_t { ADC_HAL_ULP_MODE, ADC_HAL_SINGLE_READ_MODE, diff --git a/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h b/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h index dc07531e0b9..3490986c28e 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h @@ -161,7 +161,8 @@ typedef struct { typedef struct { union { struct { - uint32_t data: 13; /*! ADC_CHANNEL_MAX), The data is invalid. */ diff --git a/tools/sdk/esp32s2/include/hal/include/hal/i2c_hal.h b/tools/sdk/esp32s2/include/hal/include/hal/i2c_hal.h index b255878cc43..cc56014b634 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/i2c_hal.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/i2c_hal.h @@ -120,6 +120,29 @@ typedef struct { */ #define i2c_hal_set_source_clk(hal, src_clk) i2c_ll_set_source_clk((hal)->dev, src_clk) +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +#define i2c_hal_set_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_set_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +#define i2c_hal_get_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_get_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + /** * @brief Init the I2C master. * diff --git a/tools/sdk/esp32s2/include/hal/include/hal/i2s_hal.h b/tools/sdk/esp32s2/include/hal/include/hal/i2s_hal.h index 037970fa2b3..2be94f66d15 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/i2s_hal.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/i2s_hal.h @@ -125,6 +125,16 @@ void i2s_hal_init(i2s_hal_context_t *hal, int i2s_num); */ void i2s_hal_set_clock_src(i2s_hal_context_t *hal, i2s_clock_src_t sel); +/** + * @brief Calculate the closest sample rate clock configuration. + * clock relationship: + * Fmclk = bck_div*fbck = fsclk/(mclk_div+b/a) + * + * @param clk_cfg I2S clock configuration(input) + * @param cal Point to `i2s_ll_mclk_div_t` structure(output). + */ +void i2s_hal_mclk_div_decimal_cal(i2s_hal_clock_cfg_t *clk_cfg, i2s_ll_mclk_div_t *cal); + /** * @brief Set Tx channel style * @@ -342,8 +352,9 @@ void i2s_hal_rx_set_common_mode(i2s_hal_context_t *hal, const i2s_hal_config_t * * * @param hal Context of the HAL layer * @param sample_rate PDM sample rate + * @param is_mono whether is mono */ -void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate); +void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate, bool is_mono); #endif #if SOC_I2S_SUPPORTS_PDM_RX diff --git a/tools/sdk/esp32s2/include/hal/include/hal/lcd_hal.h b/tools/sdk/esp32s2/include/hal/include/hal/lcd_hal.h index db255b3d1e4..1312b5135e5 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/lcd_hal.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/lcd_hal.h @@ -1,23 +1,52 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include +#include + #ifdef __cplusplus extern "C" { #endif +/** + * @brief LCD peripheral SOC layer handle + */ typedef struct lcd_cam_dev_t *lcd_soc_handle_t; +/** + * @brief LCD HAL layer context + */ typedef struct { - lcd_soc_handle_t dev; + lcd_soc_handle_t dev; // SOC layer handle } lcd_hal_context_t; +/** + * @brief LCD HAL layer initialization + * + * @param hal LCD HAL layer context + * @param id LCD peripheral ID + */ void lcd_hal_init(lcd_hal_context_t *hal, int id); +#define LCD_HAL_PCLK_FLAG_ALLOW_EQUAL_SYSCLK (1 << 0) + +/** + * @brief LCD PCLK clock calculation + * @note Currently this function is only used by RGB LCD driver, I80 driver still uses a fixed clock division + * + * @param hal LCD HAL layer context + * @param src_freq_hz LCD source clock frequency in Hz + * @param expect_pclk_freq_hz Expected LCD PCLK frequency in Hz + * @param lcd_clk_flags Extra flags to control LCD PCLK clock calculation, supported flags are prefixed with LCD_HAL_PCLK_FLAG_ + * @return Actual LCD PCLK frequency in Hz + */ +uint32_t lcd_hal_cal_pclk_freq(lcd_hal_context_t *hal, uint32_t src_freq_hz, uint32_t expect_pclk_freq_hz, int lcd_clk_flags); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h index 13810a79ac3..af11ef64a8d 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h @@ -34,6 +34,39 @@ typedef enum { LCD_CLK_SRC_XTAL, /*!< Select XTAL as the source clock */ } lcd_clock_source_t; +/** + * @brief LCD color space + */ +typedef enum { + LCD_COLOR_SPACE_RGB, /*!< Color space: RGB */ + LCD_COLOR_SPACE_YUV, /*!< Color space: YUV */ +} lcd_color_space_t; + +/** + * @brief LCD color range + */ +typedef enum { + LCD_COLOR_RANGE_LIMIT, /*!< Limited color range */ + LCD_COLOR_RANGE_FULL, /*!< Full color range */ +} lcd_color_range_t; + +/** + * @brief YUV sampling method + */ +typedef enum { + LCD_YUV_SAMPLE_422, /*!< YUV 4:2:2 sampling */ + LCD_YUV_SAMPLE_420, /*!< YUV 4:2:0 sampling */ + LCD_YUV_SAMPLE_411, /*!< YUV 4:1:1 sampling */ +} lcd_yuv_sample_t; + +/** + * @brief The standard used for conversion between RGB and YUV + */ +typedef enum { + LCD_YUV_CONV_STD_BT601, /*!< YUV<->RGB conversion standard: BT.601 */ + LCD_YUV_CONV_STD_BT709, /*!< YUV<->RGB conversion standard: BT.709 */ +} lcd_yuv_conv_std_t; + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/hal/include/hal/spi_types.h b/tools/sdk/esp32s2/include/hal/include/hal/spi_types.h index 169069c5c62..9c008838a19 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/spi_types.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/spi_types.h @@ -55,6 +55,22 @@ typedef struct { uint8_t data_lines; ///< The line width of data phase, e.g. 4-line-data-phase. } spi_line_mode_t; +/** + * @brief SPI command. + */ +typedef enum { + /* Slave HD Only */ + SPI_CMD_HD_WRBUF = BIT(0), + SPI_CMD_HD_RDBUF = BIT(1), + SPI_CMD_HD_WRDMA = BIT(2), + SPI_CMD_HD_RDDMA = BIT(3), + SPI_CMD_HD_SEG_END = BIT(4), + SPI_CMD_HD_EN_QPI = BIT(5), + SPI_CMD_HD_WR_END = BIT(6), + SPI_CMD_HD_INT0 = BIT(7), + SPI_CMD_HD_INT1 = BIT(8), + SPI_CMD_HD_INT2 = BIT(9), +} spi_command_t; /** @cond */ //Doxy command to hide preprocessor definitions from docs */ diff --git a/tools/sdk/esp32s2/include/hal/platform_port/include/hal/assert.h b/tools/sdk/esp32s2/include/hal/platform_port/include/hal/assert.h index 45e9b138741..1bfeada1f59 100644 --- a/tools/sdk/esp32s2/include/hal/platform_port/include/hal/assert.h +++ b/tools/sdk/esp32s2/include/hal/platform_port/include/hal/assert.h @@ -30,7 +30,9 @@ extern void abort(void); #endif #endif -#if CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent +#if IS_ULP_COCPU +#define HAL_ASSERT(__e) ((void)(__e)) +#elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : abort()) #elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 2 // full assertion #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, #__e)) diff --git a/tools/sdk/esp32s2/include/heap/include/esp_heap_caps.h b/tools/sdk/esp32s2/include/heap/include/esp_heap_caps.h index c7d85d4217f..2832b101b5e 100644 --- a/tools/sdk/esp32s2/include/heap/include/esp_heap_caps.h +++ b/tools/sdk/esp32s2/include/heap/include/esp_heap_caps.h @@ -33,7 +33,7 @@ extern "C" { #define MALLOC_CAP_INTERNAL (1<<11) ///< Memory must be internal; specifically it should not disappear when flash/spiram cache is switched off #define MALLOC_CAP_DEFAULT (1<<12) ///< Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call #define MALLOC_CAP_IRAM_8BIT (1<<13) ///< Memory must be in IRAM and allow unaligned access -#define MALLOC_CAP_RETENTION (1<<14) +#define MALLOC_CAP_RETENTION (1<<14) ///< Memory must be able to accessed by retention DMA #define MALLOC_CAP_RTCRAM (1<<15) ///< Memory must be in RTC fast memory #define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker @@ -58,8 +58,6 @@ esp_err_t heap_caps_register_failed_alloc_callback(esp_alloc_failed_hook_t callb * * Equivalent semantics to libc malloc(), for capability-aware memory. * - * In IDF, ``malloc(p)`` is equivalent to ``heap_caps_malloc(p, MALLOC_CAP_8BIT)``. - * * @param size Size, in bytes, of the amount of memory to allocate * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type * of memory to be returned diff --git a/tools/sdk/esp32s2/include/nvs_flash/include/nvs.h b/tools/sdk/esp32s2/include/nvs_flash/include/nvs.h index 0faef98fd3d..a800d4d1847 100644 --- a/tools/sdk/esp32s2/include/nvs_flash/include/nvs.h +++ b/tools/sdk/esp32s2/include/nvs_flash/include/nvs.h @@ -132,6 +132,8 @@ typedef struct nvs_opaque_iterator_t *nvs_iterator_t; * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); @@ -161,6 +163,8 @@ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *ou * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open_from_partition(const char *part_name, const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); diff --git a/tools/sdk/esp32s2/include/protocomm/include/transports/protocomm_ble.h b/tools/sdk/esp32s2/include/protocomm/include/transports/protocomm_ble.h index d684e7e921a..0efb31c2134 100644 --- a/tools/sdk/esp32s2/include/protocomm/include/transports/protocomm_ble.h +++ b/tools/sdk/esp32s2/include/protocomm/include/transports/protocomm_ble.h @@ -52,7 +52,7 @@ typedef struct protocomm_ble_config { /** * BLE device name being broadcast at the time of provisioning */ - char device_name[MAX_BLE_DEVNAME_LEN]; + char device_name[MAX_BLE_DEVNAME_LEN + 1]; /** * 128 bit UUID of the provisioning service diff --git a/tools/sdk/esp32s2/include/rmaker_common/include/esp_rmaker_mqtt_glue.h b/tools/sdk/esp32s2/include/rmaker_common/include/esp_rmaker_mqtt_glue.h index 9355d034ef4..59f2224a9a9 100644 --- a/tools/sdk/esp32s2/include/rmaker_common/include/esp_rmaker_mqtt_glue.h +++ b/tools/sdk/esp32s2/include/rmaker_common/include/esp_rmaker_mqtt_glue.h @@ -11,10 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once + #include #include #include + #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/rtc.h b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/rtc.h index 12cb8ba1e80..c23f73d5145 100644 --- a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/rtc.h +++ b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/rtc.h @@ -540,6 +540,11 @@ uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles, ui * 32k XTAL is being calibrated, but the oscillator has not started up (due to * incorrect loading capacitance, board design issue, or lack of 32 XTAL on board). * + * @note When 32k CLK is being calibrated, this function will check the accuracy + * of the clock. Since the xtal 32k or ext osc 32k is generally very stable, if + * the check fails, then consider this an invalid 32k clock and return 0. This + * check can filter some jamming signal. + * * @param cal_clk clock to be measured * @param slow_clk_cycles number of slow clock cycles to average * @return average slow clock period in microseconds, Q13.19 fixed point format, diff --git a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc.h b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc.h index ae4cf0103a2..2f62a827a01 100644 --- a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc.h +++ b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc.h @@ -277,6 +277,10 @@ #define SOC_DIRAM_DRAM_LOW 0x3FFB0000 #define SOC_DIRAM_DRAM_HIGH 0x40000000 +#define SOC_I_D_OFFSET (SOC_DIRAM_IRAM_LOW - SOC_DIRAM_DRAM_LOW) +#define MAP_DRAM_TO_IRAM(addr) (addr + SOC_I_D_OFFSET) +#define MAP_IRAM_TO_DRAM(addr) (addr - SOC_I_D_OFFSET) + // Region of memory accessible via DMA in internal memory. See esp_ptr_dma_capable(). #define SOC_DMA_LOW 0x3FFB0000 #define SOC_DMA_HIGH 0x40000000 diff --git a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc_caps.h b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc_caps.h index 62c02d62ff9..8a7cdba9ef8 100644 --- a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc_caps.h +++ b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/soc_caps.h @@ -69,6 +69,8 @@ #define SOC_ADC_DIGI_CONTROLLER_NUM (2) #define SOC_ADC_PATT_LEN_MAX (32) /*!< Two pattern table, each contains 16 items. Each item takes 1 byte */ #define SOC_ADC_DIGI_MAX_BITWIDTH (12) +#define SOC_ADC_DIGI_RESULT_BYTES (2) +#define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (2) /*!< F_sample = F_digi_con / 2 / interval. F_digi_con = 5M for now. 30 <= interva <= 4095 */ #define SOC_ADC_SAMPLE_FREQ_THRES_HIGH 83333 #define SOC_ADC_SAMPLE_FREQ_THRES_LOW 611 @@ -201,9 +203,10 @@ #define SOC_SIGMADELTA_CHANNEL_NUM (8) // 8 channels /*-------------------------- SPI CAPS ----------------------------------------*/ -#define SOC_SPI_PERIPH_NUM 3 -#define SOC_SPI_DMA_CHAN_NUM 3 +#define SOC_SPI_PERIPH_NUM 3 +#define SOC_SPI_DMA_CHAN_NUM 3 #define SOC_SPI_PERIPH_CS_NUM(i) (((i)==0)? 2: (((i)==1)? 6: 3)) +#define SOC_SPI_MAX_CS_NUM 6 #define SOC_SPI_MAXIMUM_BUFFER_SIZE 72 #define SOC_SPI_MAX_PRE_DIVIDER 8192 diff --git a/tools/sdk/esp32s2/include/soc/include/soc/spi_periph.h b/tools/sdk/esp32s2/include/soc/include/soc/spi_periph.h index 7aa38650356..d93abf87ef4 100644 --- a/tools/sdk/esp32s2/include/soc/include/soc/spi_periph.h +++ b/tools/sdk/esp32s2/include/soc/include/soc/spi_periph.h @@ -66,7 +66,7 @@ typedef struct { const uint8_t spid6_in; const uint8_t spid7_in; #endif // SOC_SPI_SUPPORT_OCT - const uint8_t spics_out[3]; // /CS GPIO output mux signals + const uint8_t spics_out[SOC_SPI_MAX_CS_NUM]; // /CS GPIO output mux signals const uint8_t spics_in; const uint8_t spidqs_out; const uint8_t spicd_out; diff --git a/tools/sdk/esp32s2/include/spi_flash/include/esp_private/spi_flash_os.h b/tools/sdk/esp32s2/include/spi_flash/include/esp_private/spi_flash_os.h index e73511bc117..996606dbcee 100644 --- a/tools/sdk/esp32s2/include/spi_flash/include/esp_private/spi_flash_os.h +++ b/tools/sdk/esp32s2/include/spi_flash/include/esp_private/spi_flash_os.h @@ -34,11 +34,32 @@ #endif #include "esp_flash.h" #include "hal/spi_flash_hal.h" +#include "soc/soc_caps.h" #ifdef __cplusplus extern "C" { #endif +// Type of MSPI IO +typedef enum { + ESP_MSPI_IO_CLK = 0, + ESP_MSPI_IO_Q, + ESP_MSPI_IO_D, + ESP_MSPI_IO_CS0, /* cs for spi flash */ + ESP_MSPI_IO_HD, + ESP_MSPI_IO_WP, +#if SOC_SPI_MEM_SUPPORT_OPI_MODE + ESP_MSPI_IO_DQS, + ESP_MSPI_IO_D4, + ESP_MSPI_IO_D5, + ESP_MSPI_IO_D6, + ESP_MSPI_IO_D7, +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE +#if CONFIG_SPIRAM + ESP_MSPI_IO_CS1 /* cs for spi ram */ +#endif +} esp_mspi_io_t; + /** * @brief To setup Flash chip */ @@ -80,6 +101,15 @@ void spi_timing_psram_tuning(void); */ void esp_mspi_pin_init(void); +/** + * @brief Get the number of the GPIO corresponding to the given MSPI io + * + * @param[in] io MSPI io + * + * @return MSPI IO number + */ +uint8_t esp_mspi_get_io(esp_mspi_io_t io); + /** * @brief Set SPI1 registers to make ROM functions work * @note This function is used for setting SPI1 registers to the state that ROM SPI functions work diff --git a/tools/sdk/esp32s2/include/tcp_transport/include/esp_transport.h b/tools/sdk/esp32s2/include/tcp_transport/include/esp_transport.h index 5c7f2f77ed2..979bd7130c8 100644 --- a/tools/sdk/esp32s2/include/tcp_transport/include/esp_transport.h +++ b/tools/sdk/esp32s2/include/tcp_transport/include/esp_transport.h @@ -32,7 +32,7 @@ typedef struct esp_transport_keepalive { int keep_alive_count; /*!< Keep-alive packet retry send count */ } esp_transport_keep_alive_t; -typedef struct esp_transport_internal* esp_transport_list_handle_t; +typedef struct esp_transport_list_t* esp_transport_list_handle_t; typedef struct esp_transport_item_t* esp_transport_handle_t; typedef int (*connect_func)(esp_transport_handle_t t, const char *host, int port, int timeout_ms); @@ -45,6 +45,10 @@ typedef esp_transport_handle_t (*payload_transfer_func)(esp_transport_handle_t); typedef struct esp_tls_last_error* esp_tls_error_handle_t; +/** + * @brief Error types for TCP connection issues not covered in socket's errno + */ + /** * @brief Create transport list * @@ -340,6 +344,7 @@ esp_tls_error_handle_t esp_transport_get_error_handle(esp_transport_handle_t t); */ int esp_transport_get_errno(esp_transport_handle_t t); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/ulp/include/esp32s3/ulp_riscv_adc.h b/tools/sdk/esp32s2/include/ulp/include/esp32s3/ulp_riscv_adc.h new file mode 100644 index 00000000000..27f53efbfa0 --- /dev/null +++ b/tools/sdk/esp32s2/include/ulp/include/esp32s3/ulp_riscv_adc.h @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "hal/adc_types.h" +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + adc_channel_t channel; // ADC channel + adc_atten_t atten; // ADC channel attenuation + adc_bits_width_t width; // ADC bit width, only used for ADC unit 1 +} ulp_riscv_adc_cfg_t; // ULP Riscv ADC configuration parameters + +/** + * @brief Initialize and calibrate the ADC1 for use by ULP RISCV + * + * @param cfg Configuration parameters + * @return esp_err_t ESP_OK for successful. + */ +esp_err_t ulp_riscv_adc_init(const ulp_riscv_adc_cfg_t *cfg); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s2/include/wpa_supplicant/port/include/supplicant_opt.h b/tools/sdk/esp32s2/include/wpa_supplicant/port/include/supplicant_opt.h index 59b428d5462..da753327694 100644 --- a/tools/sdk/esp32s2/include/wpa_supplicant/port/include/supplicant_opt.h +++ b/tools/sdk/esp32s2/include/wpa_supplicant/port/include/supplicant_opt.h @@ -29,9 +29,6 @@ #define DEBUG_PRINT #endif -#if CONFIG_WPA_11KV_SUPPORT -#define ROAMING_SUPPORT 1 -#endif #if CONFIG_WPA_SCAN_CACHE #define SCAN_CACHE_SUPPORTED diff --git a/tools/sdk/esp32s2/include/xtensa/include/xt_instr_macros.h b/tools/sdk/esp32s2/include/xtensa/include/xt_instr_macros.h index e7931f4bf41..efcdbd4a78c 100644 --- a/tools/sdk/esp32s2/include/xtensa/include/xt_instr_macros.h +++ b/tools/sdk/esp32s2/include/xtensa/include/xt_instr_macros.h @@ -1,19 +1,13 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#include "xtensa/xtruntime.h" + #define RSR(reg, at) asm volatile ("rsr %0, %1" : "=r" (at) : "i" (reg)) #define WSR(reg, at) asm volatile ("wsr %0, %1" : : "r" (at), "i" (reg)) #define XSR(reg, at) asm volatile ("xsr %0, %1" : "+r" (at) : "i" (reg)) @@ -23,14 +17,27 @@ #define WITLB(at, as) asm volatile ("witlb %0, %1; \n isync \n " : : "r" (at), "r" (as)) #define WDTLB(at, as) asm volatile ("wdtlb %0, %1; \n dsync \n " : : "r" (at), "r" (as)) +#define EXTRA_SAVE_AREA_SIZE 32 +#define BASE_SAVE_AREA_SIZE 16 +#define SAVE_AREA_OFFSET (EXTRA_SAVE_AREA_SIZE + BASE_SAVE_AREA_SIZE) +#define BASE_AREA_SP_OFFSET 12 + /* The SET_STACK implements a setting a new stack pointer (sp or a1). * to do this the need reset PS_WOE, reset WINDOWSTART, update SP, and return PS_WOE. * + * In addition, if a windowOverflow8/12 happens the exception handler expects to be able to look at + * the previous frames stackpointer to find the extra save area. So this function will reserve space + * for this area as well as initialise the previous sp that points to it + * * Note: It has 2 implementations one for using in assembler files (*.S) and one for using in C. * * C code prototype for SET_STACK: * uint32_t ps_reg; * uint32_t w_base; + * + * uint32_t sp = (uint32_t)new_sp - SAVE_AREA_OFFSET; \ + *(uint32_t*)(sp - 12) = (uint32_t)new_sp; \ + * RSR(PS, ps_reg); * ps_reg &= ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK); * WSR(PS, ps_reg); @@ -46,6 +53,10 @@ */ #ifdef __ASSEMBLER__ .macro SET_STACK new_sp tmp1 tmp2 + addi tmp1, new_sp, -SAVE_AREA_OFFSET + addi tmp2, tmp1, -BASE_AREA_SP_OFFSET + s32i new_sp, tmp2, 0 + addi new_sp, tmp1, 0 rsr.ps \tmp1 movi \tmp2, ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK) and \tmp1, \tmp1, \tmp2 @@ -68,8 +79,11 @@ rsync .endm #else + #define SET_STACK(new_sp) \ do { \ + uint32_t sp = (uint32_t)new_sp - SAVE_AREA_OFFSET; \ + *(uint32_t*)(sp - BASE_AREA_SP_OFFSET) = (uint32_t)new_sp; \ uint32_t tmp1 = 0, tmp2 = 0; \ asm volatile ( \ "rsr.ps %1 \n"\ @@ -93,6 +107,6 @@ "or %1, %1, %2 \n"\ "wsr.ps %1 \n"\ "rsync \n"\ - : "+r"(new_sp), "+r"(tmp1), "+r"(tmp2)); \ + : "+r"(sp), "+r"(tmp1), "+r"(tmp2)); \ } while (0); #endif // __ASSEMBLER__ diff --git a/tools/sdk/esp32s2/include/xtensa/include/xtensa-debug-module.h b/tools/sdk/esp32s2/include/xtensa/include/xtensa-debug-module.h index d1aca40d5b7..17e5a2e3557 100644 --- a/tools/sdk/esp32s2/include/xtensa/include/xtensa-debug-module.h +++ b/tools/sdk/esp32s2/include/xtensa/include/xtensa-debug-module.h @@ -1,6 +1,8 @@ #ifndef XTENSA_DEBUG_MODULE_H #define XTENSA_DEBUG_MODULE_H +#include + /* ERI registers / OCD offsets and field definitions */ diff --git a/tools/sdk/esp32s2/ld/esp32s2.rom.api.ld b/tools/sdk/esp32s2/ld/esp32s2.rom.api.ld index afb0849271d..37d0970f2f5 100644 --- a/tools/sdk/esp32s2/ld/esp32s2.rom.api.ld +++ b/tools/sdk/esp32s2/ld/esp32s2.rom.api.ld @@ -16,6 +16,7 @@ PROVIDE ( esp_rom_gpio_connect_out_signal = gpio_matrix_out ); PROVIDE ( esp_rom_efuse_mac_address_crc8 = esp_crc8 ); PROVIDE ( esp_rom_efuse_get_flash_gpio_info = ets_efuse_get_spiconfig ); PROVIDE ( esp_rom_efuse_get_flash_wp_gpio = ets_efuse_get_wp_pad ); +PROVIDE ( esp_rom_efuse_get_opiconfig = ets_efuse_get_opiconfig ); PROVIDE ( esp_rom_efuse_is_secure_boot_enabled = ets_efuse_secure_boot_enabled ); PROVIDE ( esp_rom_uart_flush_tx = uart_tx_flush ); diff --git a/tools/sdk/esp32s2/ld/libcat_face_detect.a b/tools/sdk/esp32s2/ld/libcat_face_detect.a index 3e06b1dab00..0bd2ad1a948 100644 Binary files a/tools/sdk/esp32s2/ld/libcat_face_detect.a and b/tools/sdk/esp32s2/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32s2/ld/libcolor_detect.a b/tools/sdk/esp32s2/ld/libcolor_detect.a index 59c73d0f498..f6dd2ab81a3 100644 Binary files a/tools/sdk/esp32s2/ld/libcolor_detect.a and b/tools/sdk/esp32s2/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32s2/ld/libdl.a b/tools/sdk/esp32s2/ld/libdl.a index 69214ae6c66..4703d5d089a 100644 Binary files a/tools/sdk/esp32s2/ld/libdl.a and b/tools/sdk/esp32s2/ld/libdl.a differ diff --git a/tools/sdk/esp32s2/ld/libesp_tts_chinese.a b/tools/sdk/esp32s2/ld/libesp_tts_chinese.a index 8cbc2112cba..8a4aef401c0 100644 Binary files a/tools/sdk/esp32s2/ld/libesp_tts_chinese.a and b/tools/sdk/esp32s2/ld/libesp_tts_chinese.a differ diff --git a/tools/sdk/esp32s2/ld/libhuman_face_detect.a b/tools/sdk/esp32s2/ld/libhuman_face_detect.a index d7e1d7a0e19..444a9b6c647 100644 Binary files a/tools/sdk/esp32s2/ld/libhuman_face_detect.a and b/tools/sdk/esp32s2/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32s2/ld/libmfn.a b/tools/sdk/esp32s2/ld/libmfn.a index fda053f4ace..8473058fd0e 100644 Binary files a/tools/sdk/esp32s2/ld/libmfn.a and b/tools/sdk/esp32s2/ld/libmfn.a differ diff --git a/tools/sdk/esp32s2/ld/libvoice_set_xiaole.a b/tools/sdk/esp32s2/ld/libvoice_set_xiaole.a index 6fed53eed1d..74e266c2892 100644 Binary files a/tools/sdk/esp32s2/ld/libvoice_set_xiaole.a and b/tools/sdk/esp32s2/ld/libvoice_set_xiaole.a differ diff --git a/tools/sdk/esp32s2/ld/memory.ld b/tools/sdk/esp32s2/ld/memory.ld index 2d5a5d24d5d..6f0b54ae9a3 100644 --- a/tools/sdk/esp32s2/ld/memory.ld +++ b/tools/sdk/esp32s2/ld/memory.ld @@ -53,7 +53,7 @@ MEMORY /* (See iram0_2_seg for meaning of 0x20 offset in the above.) */ /* RTC fast memory (executable). Persists over deep sleep. */ - rtc_iram_seg(RWX) : org = 0x40070000, len = 0x2000 + rtc_iram_seg(RWX) : org = 0x40070000, len = 0x2000 - (0x10) /* RTC slow memory (data accessible). Persists over deep sleep. Start of RTC slow memory is reserved for ULP co-processor code + data, if enabled. diff --git a/tools/sdk/esp32s2/ld/sections.ld b/tools/sdk/esp32s2/ld/sections.ld index 2fb6c1f12e0..a3901477cc8 100644 --- a/tools/sdk/esp32s2/ld/sections.ld +++ b/tools/sdk/esp32s2/ld/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s2/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s2/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -372,8 +372,8 @@ SECTIONS *(.ext_ram.bss*) *(.bss .bss.*) - *(.ext_ram.bss .ext_ram.bss.*) *(.dynbss .dynsbss .gnu.linkonce.b .gnu.linkonce.b.* .gnu.linkonce.sb .gnu.linkonce.sb.* .gnu.linkonce.sb2 .gnu.linkonce.sb2.* .sbss .sbss.* .sbss2 .sbss2.* .scommon .share.mem) + *(.ext_ram.bss .ext_ram.bss.*) *(COMMON) _bt_bss_start = ABSOLUTE(.); *libbt.a:(.bss .bss.* COMMON) @@ -548,6 +548,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_text_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s2/lib/libapp_trace.a b/tools/sdk/esp32s2/lib/libapp_trace.a index 548bcdecc33..8a8a93f0ebf 100644 Binary files a/tools/sdk/esp32s2/lib/libapp_trace.a and b/tools/sdk/esp32s2/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32s2/lib/libapp_update.a b/tools/sdk/esp32s2/lib/libapp_update.a index 439bae701d4..889b998aebb 100644 Binary files a/tools/sdk/esp32s2/lib/libapp_update.a and b/tools/sdk/esp32s2/lib/libapp_update.a differ diff --git a/tools/sdk/esp32s2/lib/libarduino_tinyusb.a b/tools/sdk/esp32s2/lib/libarduino_tinyusb.a index 5863e728e35..01e499d7613 100644 Binary files a/tools/sdk/esp32s2/lib/libarduino_tinyusb.a and b/tools/sdk/esp32s2/lib/libarduino_tinyusb.a differ diff --git a/tools/sdk/esp32s2/lib/libasio.a b/tools/sdk/esp32s2/lib/libasio.a index c5e76ba90c1..c20ac0cd948 100644 Binary files a/tools/sdk/esp32s2/lib/libasio.a and b/tools/sdk/esp32s2/lib/libasio.a differ diff --git a/tools/sdk/esp32s2/lib/libbootloader_support.a b/tools/sdk/esp32s2/lib/libbootloader_support.a index 6f28f92ba20..5699ca0dd50 100644 Binary files a/tools/sdk/esp32s2/lib/libbootloader_support.a and b/tools/sdk/esp32s2/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32s2/lib/libcbor.a b/tools/sdk/esp32s2/lib/libcbor.a index 9095610f154..950ab8f44a2 100644 Binary files a/tools/sdk/esp32s2/lib/libcbor.a and b/tools/sdk/esp32s2/lib/libcbor.a differ diff --git a/tools/sdk/esp32s2/lib/libcmock.a b/tools/sdk/esp32s2/lib/libcmock.a index b1f38e29f57..f1069f61586 100644 Binary files a/tools/sdk/esp32s2/lib/libcmock.a and b/tools/sdk/esp32s2/lib/libcmock.a differ diff --git a/tools/sdk/esp32s2/lib/libcoap.a b/tools/sdk/esp32s2/lib/libcoap.a index 67e6c62f1a9..b75b974115d 100644 Binary files a/tools/sdk/esp32s2/lib/libcoap.a and b/tools/sdk/esp32s2/lib/libcoap.a differ diff --git a/tools/sdk/esp32s2/lib/libcoexist.a b/tools/sdk/esp32s2/lib/libcoexist.a index f92321aede7..3e097be5361 100644 Binary files a/tools/sdk/esp32s2/lib/libcoexist.a and b/tools/sdk/esp32s2/lib/libcoexist.a differ diff --git a/tools/sdk/esp32s2/lib/libconsole.a b/tools/sdk/esp32s2/lib/libconsole.a index b0c34afd7f7..f60da9e2737 100644 Binary files a/tools/sdk/esp32s2/lib/libconsole.a and b/tools/sdk/esp32s2/lib/libconsole.a differ diff --git a/tools/sdk/esp32s2/lib/libcore.a b/tools/sdk/esp32s2/lib/libcore.a index 11b76411a0a..f2158fca976 100644 Binary files a/tools/sdk/esp32s2/lib/libcore.a and b/tools/sdk/esp32s2/lib/libcore.a differ diff --git a/tools/sdk/esp32s2/lib/libcxx.a b/tools/sdk/esp32s2/lib/libcxx.a index 604919126a7..9e64029eadb 100644 Binary files a/tools/sdk/esp32s2/lib/libcxx.a and b/tools/sdk/esp32s2/lib/libcxx.a differ diff --git a/tools/sdk/esp32s2/lib/libdriver.a b/tools/sdk/esp32s2/lib/libdriver.a index 87934de5c6e..1a5e1d1a070 100644 Binary files a/tools/sdk/esp32s2/lib/libdriver.a and b/tools/sdk/esp32s2/lib/libdriver.a differ diff --git a/tools/sdk/esp32s2/lib/libefuse.a b/tools/sdk/esp32s2/lib/libefuse.a index efe09e1af9c..2da416e37f0 100644 Binary files a/tools/sdk/esp32s2/lib/libefuse.a and b/tools/sdk/esp32s2/lib/libefuse.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-dsp.a b/tools/sdk/esp32s2/lib/libesp-dsp.a index 3a705e01eeb..0f711517e4b 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-dsp.a and b/tools/sdk/esp32s2/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-sr.a b/tools/sdk/esp32s2/lib/libesp-sr.a deleted file mode 100644 index 5cf1c7beee2..00000000000 Binary files a/tools/sdk/esp32s2/lib/libesp-sr.a and /dev/null differ diff --git a/tools/sdk/esp32s2/lib/libesp-tls.a b/tools/sdk/esp32s2/lib/libesp-tls.a index 9361fbf2fff..1ce1e3b554e 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-tls.a and b/tools/sdk/esp32s2/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32s2/lib/libesp32-camera.a b/tools/sdk/esp32s2/lib/libesp32-camera.a index e71d3f3e0a4..6703be0d112 100644 Binary files a/tools/sdk/esp32s2/lib/libesp32-camera.a and b/tools/sdk/esp32s2/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_adc_cal.a b/tools/sdk/esp32s2/lib/libesp_adc_cal.a index 935cf492ece..ed9cbedbf11 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_adc_cal.a and b/tools/sdk/esp32s2/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_common.a b/tools/sdk/esp32s2/lib/libesp_common.a index fa784fc628f..ed3c4f94c1b 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_common.a and b/tools/sdk/esp32s2/lib/libesp_common.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_eth.a b/tools/sdk/esp32s2/lib/libesp_eth.a index 31c7d3d6d91..37f0d9c0fb9 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_eth.a and b/tools/sdk/esp32s2/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_event.a b/tools/sdk/esp32s2/lib/libesp_event.a index a931cc14215..62c9ee26b07 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_event.a and b/tools/sdk/esp32s2/lib/libesp_event.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_gdbstub.a b/tools/sdk/esp32s2/lib/libesp_gdbstub.a index 9176b39b006..5c4261384cc 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_gdbstub.a and b/tools/sdk/esp32s2/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_hid.a b/tools/sdk/esp32s2/lib/libesp_hid.a index e8b0d1d6610..480d644e859 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_hid.a and b/tools/sdk/esp32s2/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_http_client.a b/tools/sdk/esp32s2/lib/libesp_http_client.a index 6c59ce503f8..c0e94be57c7 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_http_client.a and b/tools/sdk/esp32s2/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_http_server.a b/tools/sdk/esp32s2/lib/libesp_http_server.a index dba324250b2..1ceeb27baaf 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_http_server.a and b/tools/sdk/esp32s2/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_https_ota.a b/tools/sdk/esp32s2/lib/libesp_https_ota.a index ecc764d31ab..ca9fe326157 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_https_ota.a and b/tools/sdk/esp32s2/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_https_server.a b/tools/sdk/esp32s2/lib/libesp_https_server.a index abc475bd9d9..f0227b459d0 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_https_server.a and b/tools/sdk/esp32s2/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_hw_support.a b/tools/sdk/esp32s2/lib/libesp_hw_support.a index 0c4c4559539..c5bf9e59282 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_hw_support.a and b/tools/sdk/esp32s2/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_ipc.a b/tools/sdk/esp32s2/lib/libesp_ipc.a index e403a069a4a..65a02f0174e 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_ipc.a and b/tools/sdk/esp32s2/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_lcd.a b/tools/sdk/esp32s2/lib/libesp_lcd.a index 8ed977b3a79..05806487f1f 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_lcd.a and b/tools/sdk/esp32s2/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_littlefs.a b/tools/sdk/esp32s2/lib/libesp_littlefs.a index 992fb67ea50..f658ee8537c 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_littlefs.a and b/tools/sdk/esp32s2/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_local_ctrl.a b/tools/sdk/esp32s2/lib/libesp_local_ctrl.a index 72cca641ddf..819669bd8f3 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_local_ctrl.a and b/tools/sdk/esp32s2/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_netif.a b/tools/sdk/esp32s2/lib/libesp_netif.a index 6e8172d6915..2ab2a78f44c 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_netif.a and b/tools/sdk/esp32s2/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_phy.a b/tools/sdk/esp32s2/lib/libesp_phy.a index 477d83f53fc..c39967bdf3d 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_phy.a and b/tools/sdk/esp32s2/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_pm.a b/tools/sdk/esp32s2/lib/libesp_pm.a index 75fd40a0276..7dcf525bf0a 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_pm.a and b/tools/sdk/esp32s2/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_rainmaker.a b/tools/sdk/esp32s2/lib/libesp_rainmaker.a index 2a5417501af..a507d0ad5bd 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_rainmaker.a and b/tools/sdk/esp32s2/lib/libesp_rainmaker.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_ringbuf.a b/tools/sdk/esp32s2/lib/libesp_ringbuf.a index 541b3639291..7b258d9617f 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_ringbuf.a and b/tools/sdk/esp32s2/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_rom.a b/tools/sdk/esp32s2/lib/libesp_rom.a index 21d8a37ae14..070c403908c 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_rom.a and b/tools/sdk/esp32s2/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_schedule.a b/tools/sdk/esp32s2/lib/libesp_schedule.a index 4eaa10c3156..5deb7ee03a5 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_schedule.a and b/tools/sdk/esp32s2/lib/libesp_schedule.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a b/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a index 61f5c577297..72894ead6e7 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_system.a b/tools/sdk/esp32s2/lib/libesp_system.a index 60d65dd7f78..2bc580b808a 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_system.a and b/tools/sdk/esp32s2/lib/libesp_system.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_timer.a b/tools/sdk/esp32s2/lib/libesp_timer.a index a1a756b1da3..3e6f6383f33 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_timer.a and b/tools/sdk/esp32s2/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_websocket_client.a b/tools/sdk/esp32s2/lib/libesp_websocket_client.a index 43f85000e2c..03959d18a15 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_websocket_client.a and b/tools/sdk/esp32s2/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_wifi.a b/tools/sdk/esp32s2/lib/libesp_wifi.a index 51eefa9b177..45a670214fc 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_wifi.a and b/tools/sdk/esp32s2/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32s2/lib/libespcoredump.a b/tools/sdk/esp32s2/lib/libespcoredump.a index 2186784efd9..89ed4a88ab0 100644 Binary files a/tools/sdk/esp32s2/lib/libespcoredump.a and b/tools/sdk/esp32s2/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32s2/lib/libespnow.a b/tools/sdk/esp32s2/lib/libespnow.a index 3d2349671fe..8dd1715f7c3 100644 Binary files a/tools/sdk/esp32s2/lib/libespnow.a and b/tools/sdk/esp32s2/lib/libespnow.a differ diff --git a/tools/sdk/esp32s2/lib/libexpat.a b/tools/sdk/esp32s2/lib/libexpat.a index 3b32cf684b1..239fe5b2a42 100644 Binary files a/tools/sdk/esp32s2/lib/libexpat.a and b/tools/sdk/esp32s2/lib/libexpat.a differ diff --git a/tools/sdk/esp32s2/lib/libfatfs.a b/tools/sdk/esp32s2/lib/libfatfs.a index 119a218b632..0e3a95e8335 100644 Binary files a/tools/sdk/esp32s2/lib/libfatfs.a and b/tools/sdk/esp32s2/lib/libfatfs.a differ diff --git a/tools/sdk/esp32s2/lib/libfb_gfx.a b/tools/sdk/esp32s2/lib/libfb_gfx.a index bdfc8eb32bc..a440b4478af 100644 Binary files a/tools/sdk/esp32s2/lib/libfb_gfx.a and b/tools/sdk/esp32s2/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32s2/lib/libfreemodbus.a b/tools/sdk/esp32s2/lib/libfreemodbus.a index b63c2c063c8..faefdc3f73a 100644 Binary files a/tools/sdk/esp32s2/lib/libfreemodbus.a and b/tools/sdk/esp32s2/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32s2/lib/libfreertos.a b/tools/sdk/esp32s2/lib/libfreertos.a index c27a9acd834..789b418f4ce 100644 Binary files a/tools/sdk/esp32s2/lib/libfreertos.a and b/tools/sdk/esp32s2/lib/libfreertos.a differ diff --git a/tools/sdk/esp32s2/lib/libgpio_button.a b/tools/sdk/esp32s2/lib/libgpio_button.a index c17461e80dd..bddfead5944 100644 Binary files a/tools/sdk/esp32s2/lib/libgpio_button.a and b/tools/sdk/esp32s2/lib/libgpio_button.a differ diff --git a/tools/sdk/esp32s2/lib/libhal.a b/tools/sdk/esp32s2/lib/libhal.a index 43151dade21..fc6ffb188e9 100644 Binary files a/tools/sdk/esp32s2/lib/libhal.a and b/tools/sdk/esp32s2/lib/libhal.a differ diff --git a/tools/sdk/esp32s2/lib/libheap.a b/tools/sdk/esp32s2/lib/libheap.a index fe935ba0441..36cb97993b3 100644 Binary files a/tools/sdk/esp32s2/lib/libheap.a and b/tools/sdk/esp32s2/lib/libheap.a differ diff --git a/tools/sdk/esp32s2/lib/libjsmn.a b/tools/sdk/esp32s2/lib/libjsmn.a index e42557d5a6f..998faad966d 100644 Binary files a/tools/sdk/esp32s2/lib/libjsmn.a and b/tools/sdk/esp32s2/lib/libjsmn.a differ diff --git a/tools/sdk/esp32s2/lib/libjson.a b/tools/sdk/esp32s2/lib/libjson.a index c61f7bda4c1..15c4476cb59 100644 Binary files a/tools/sdk/esp32s2/lib/libjson.a and b/tools/sdk/esp32s2/lib/libjson.a differ diff --git a/tools/sdk/esp32s2/lib/libjson_generator.a b/tools/sdk/esp32s2/lib/libjson_generator.a index 8bf6a31b3ac..b4bce72a33b 100644 Binary files a/tools/sdk/esp32s2/lib/libjson_generator.a and b/tools/sdk/esp32s2/lib/libjson_generator.a differ diff --git a/tools/sdk/esp32s2/lib/libjson_parser.a b/tools/sdk/esp32s2/lib/libjson_parser.a index 81c6a217e78..c7af283fb15 100644 Binary files a/tools/sdk/esp32s2/lib/libjson_parser.a and b/tools/sdk/esp32s2/lib/libjson_parser.a differ diff --git a/tools/sdk/esp32s2/lib/liblibsodium.a b/tools/sdk/esp32s2/lib/liblibsodium.a index e1d5acf7405..0e4864f52ae 100644 Binary files a/tools/sdk/esp32s2/lib/liblibsodium.a and b/tools/sdk/esp32s2/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32s2/lib/liblog.a b/tools/sdk/esp32s2/lib/liblog.a index 88a3f103966..4a6a7891b10 100644 Binary files a/tools/sdk/esp32s2/lib/liblog.a and b/tools/sdk/esp32s2/lib/liblog.a differ diff --git a/tools/sdk/esp32s2/lib/liblwip.a b/tools/sdk/esp32s2/lib/liblwip.a index 4c775412f24..d11d38cb038 100644 Binary files a/tools/sdk/esp32s2/lib/liblwip.a and b/tools/sdk/esp32s2/lib/liblwip.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedcrypto.a b/tools/sdk/esp32s2/lib/libmbedcrypto.a index 86a21339d78..9205eefbe6b 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedcrypto.a and b/tools/sdk/esp32s2/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedtls.a b/tools/sdk/esp32s2/lib/libmbedtls.a index 781a1545572..e4499bea077 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedtls.a and b/tools/sdk/esp32s2/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedtls_2.a b/tools/sdk/esp32s2/lib/libmbedtls_2.a index c0b882a73ae..de924aaf5ec 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedtls_2.a and b/tools/sdk/esp32s2/lib/libmbedtls_2.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedx509.a b/tools/sdk/esp32s2/lib/libmbedx509.a index effdb87e736..3ba706715ad 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedx509.a and b/tools/sdk/esp32s2/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32s2/lib/libmdns.a b/tools/sdk/esp32s2/lib/libmdns.a index c327c99ee55..be050843f71 100644 Binary files a/tools/sdk/esp32s2/lib/libmdns.a and b/tools/sdk/esp32s2/lib/libmdns.a differ diff --git a/tools/sdk/esp32s2/lib/libmesh.a b/tools/sdk/esp32s2/lib/libmesh.a index 195c8a7350e..ea112202b5a 100644 Binary files a/tools/sdk/esp32s2/lib/libmesh.a and b/tools/sdk/esp32s2/lib/libmesh.a differ diff --git a/tools/sdk/esp32s2/lib/libmqtt.a b/tools/sdk/esp32s2/lib/libmqtt.a index f425d38c3ac..b7cd8d51c39 100644 Binary files a/tools/sdk/esp32s2/lib/libmqtt.a and b/tools/sdk/esp32s2/lib/libmqtt.a differ diff --git a/tools/sdk/esp32s2/lib/libnet80211.a b/tools/sdk/esp32s2/lib/libnet80211.a index f284aff7ac9..93afd56962a 100644 Binary files a/tools/sdk/esp32s2/lib/libnet80211.a and b/tools/sdk/esp32s2/lib/libnet80211.a differ diff --git a/tools/sdk/esp32s2/lib/libnewlib.a b/tools/sdk/esp32s2/lib/libnewlib.a index 34c96ef84c7..a194825cc85 100644 Binary files a/tools/sdk/esp32s2/lib/libnewlib.a and b/tools/sdk/esp32s2/lib/libnewlib.a differ diff --git a/tools/sdk/esp32s2/lib/libnghttp.a b/tools/sdk/esp32s2/lib/libnghttp.a index 067a0660ce1..8ea04df26cf 100644 Binary files a/tools/sdk/esp32s2/lib/libnghttp.a and b/tools/sdk/esp32s2/lib/libnghttp.a differ diff --git a/tools/sdk/esp32s2/lib/libnvs_flash.a b/tools/sdk/esp32s2/lib/libnvs_flash.a index 5629446aafd..06c41a29d0f 100644 Binary files a/tools/sdk/esp32s2/lib/libnvs_flash.a and b/tools/sdk/esp32s2/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32s2/lib/libopenssl.a b/tools/sdk/esp32s2/lib/libopenssl.a index 5a700852570..4800b5b3192 100644 Binary files a/tools/sdk/esp32s2/lib/libopenssl.a and b/tools/sdk/esp32s2/lib/libopenssl.a differ diff --git a/tools/sdk/esp32s2/lib/libperfmon.a b/tools/sdk/esp32s2/lib/libperfmon.a index add4aca6748..d18b95f0f97 100644 Binary files a/tools/sdk/esp32s2/lib/libperfmon.a and b/tools/sdk/esp32s2/lib/libperfmon.a differ diff --git a/tools/sdk/esp32s2/lib/libpp.a b/tools/sdk/esp32s2/lib/libpp.a index ac05882738c..ded11007341 100644 Binary files a/tools/sdk/esp32s2/lib/libpp.a and b/tools/sdk/esp32s2/lib/libpp.a differ diff --git a/tools/sdk/esp32s2/lib/libprotobuf-c.a b/tools/sdk/esp32s2/lib/libprotobuf-c.a index fde5a9af07b..e110babc6bf 100644 Binary files a/tools/sdk/esp32s2/lib/libprotobuf-c.a and b/tools/sdk/esp32s2/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32s2/lib/libprotocomm.a b/tools/sdk/esp32s2/lib/libprotocomm.a index 37b11af0952..b0571b63ccb 100644 Binary files a/tools/sdk/esp32s2/lib/libprotocomm.a and b/tools/sdk/esp32s2/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32s2/lib/libpthread.a b/tools/sdk/esp32s2/lib/libpthread.a index 5da559dc96e..0d3f425da31 100644 Binary files a/tools/sdk/esp32s2/lib/libpthread.a and b/tools/sdk/esp32s2/lib/libpthread.a differ diff --git a/tools/sdk/esp32s2/lib/libqrcode.a b/tools/sdk/esp32s2/lib/libqrcode.a index 2195a25b572..4160dc73763 100644 Binary files a/tools/sdk/esp32s2/lib/libqrcode.a and b/tools/sdk/esp32s2/lib/libqrcode.a differ diff --git a/tools/sdk/esp32s2/lib/librmaker_common.a b/tools/sdk/esp32s2/lib/librmaker_common.a index c8665535b8a..e31ebf2aaab 100644 Binary files a/tools/sdk/esp32s2/lib/librmaker_common.a and b/tools/sdk/esp32s2/lib/librmaker_common.a differ diff --git a/tools/sdk/esp32s2/lib/libsdmmc.a b/tools/sdk/esp32s2/lib/libsdmmc.a index 243b1093dcc..e95e0186ed5 100644 Binary files a/tools/sdk/esp32s2/lib/libsdmmc.a and b/tools/sdk/esp32s2/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32s2/lib/libsmartconfig.a b/tools/sdk/esp32s2/lib/libsmartconfig.a index 0f1bd4ea077..f8519690235 100644 Binary files a/tools/sdk/esp32s2/lib/libsmartconfig.a and b/tools/sdk/esp32s2/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32s2/lib/libsoc.a b/tools/sdk/esp32s2/lib/libsoc.a index 87c39ca8c98..3860bb66a02 100644 Binary files a/tools/sdk/esp32s2/lib/libsoc.a and b/tools/sdk/esp32s2/lib/libsoc.a differ diff --git a/tools/sdk/esp32s2/lib/libspiffs.a b/tools/sdk/esp32s2/lib/libspiffs.a index 90c5953db83..08079418fb3 100644 Binary files a/tools/sdk/esp32s2/lib/libspiffs.a and b/tools/sdk/esp32s2/lib/libspiffs.a differ diff --git a/tools/sdk/esp32s2/lib/libtcp_transport.a b/tools/sdk/esp32s2/lib/libtcp_transport.a index 21d13d082fc..b15497270eb 100644 Binary files a/tools/sdk/esp32s2/lib/libtcp_transport.a and b/tools/sdk/esp32s2/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32s2/lib/libtcpip_adapter.a b/tools/sdk/esp32s2/lib/libtcpip_adapter.a index 5e63b4ae696..caa6023c840 100644 Binary files a/tools/sdk/esp32s2/lib/libtcpip_adapter.a and b/tools/sdk/esp32s2/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32s2/lib/libtouch_element.a b/tools/sdk/esp32s2/lib/libtouch_element.a index 0e571505277..8e38c82f79a 100644 Binary files a/tools/sdk/esp32s2/lib/libtouch_element.a and b/tools/sdk/esp32s2/lib/libtouch_element.a differ diff --git a/tools/sdk/esp32s2/lib/libulp.a b/tools/sdk/esp32s2/lib/libulp.a index 44e07e12307..59d47dde539 100644 Binary files a/tools/sdk/esp32s2/lib/libulp.a and b/tools/sdk/esp32s2/lib/libulp.a differ diff --git a/tools/sdk/esp32s2/lib/libunity.a b/tools/sdk/esp32s2/lib/libunity.a index 67a5da0ff83..6a667a71e8e 100644 Binary files a/tools/sdk/esp32s2/lib/libunity.a and b/tools/sdk/esp32s2/lib/libunity.a differ diff --git a/tools/sdk/esp32s2/lib/libusb.a b/tools/sdk/esp32s2/lib/libusb.a index 4ad4aff6f5f..5ef889fb3c3 100644 Binary files a/tools/sdk/esp32s2/lib/libusb.a and b/tools/sdk/esp32s2/lib/libusb.a differ diff --git a/tools/sdk/esp32s2/lib/libvfs.a b/tools/sdk/esp32s2/lib/libvfs.a index f0b7a99532d..c2f2fce83ae 100644 Binary files a/tools/sdk/esp32s2/lib/libvfs.a and b/tools/sdk/esp32s2/lib/libvfs.a differ diff --git a/tools/sdk/esp32s2/lib/libwapi.a b/tools/sdk/esp32s2/lib/libwapi.a index cfa3cf39d7e..79ebe9d9ffd 100644 Binary files a/tools/sdk/esp32s2/lib/libwapi.a and b/tools/sdk/esp32s2/lib/libwapi.a differ diff --git a/tools/sdk/esp32s2/lib/libwear_levelling.a b/tools/sdk/esp32s2/lib/libwear_levelling.a index 340541e376c..e6e332af9f4 100644 Binary files a/tools/sdk/esp32s2/lib/libwear_levelling.a and b/tools/sdk/esp32s2/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32s2/lib/libwifi_provisioning.a b/tools/sdk/esp32s2/lib/libwifi_provisioning.a index b54dbd06275..3e49eb731a4 100644 Binary files a/tools/sdk/esp32s2/lib/libwifi_provisioning.a and b/tools/sdk/esp32s2/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32s2/lib/libwpa_supplicant.a b/tools/sdk/esp32s2/lib/libwpa_supplicant.a index c11b3885b3e..b69cbfef102 100644 Binary files a/tools/sdk/esp32s2/lib/libwpa_supplicant.a and b/tools/sdk/esp32s2/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32s2/lib/libws2812_led.a b/tools/sdk/esp32s2/lib/libws2812_led.a index ecc9cc216a7..ac338a1585d 100644 Binary files a/tools/sdk/esp32s2/lib/libws2812_led.a and b/tools/sdk/esp32s2/lib/libws2812_led.a differ diff --git a/tools/sdk/esp32s2/lib/libxtensa.a b/tools/sdk/esp32s2/lib/libxtensa.a index 733c7fc65a9..8ac04cfb448 100644 Binary files a/tools/sdk/esp32s2/lib/libxtensa.a and b/tools/sdk/esp32s2/lib/libxtensa.a differ diff --git a/tools/sdk/esp32s2/qio_qspi/include/sdkconfig.h b/tools/sdk/esp32s2/qio_qspi/include/sdkconfig.h index 5d4eccdc506..8e7de120d3f 100644 --- a/tools/sdk/esp32s2/qio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s2/qio_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s2" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -181,6 +183,8 @@ #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 @@ -531,6 +535,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -633,5 +638,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s2/qio_qspi/libspi_flash.a b/tools/sdk/esp32s2/qio_qspi/libspi_flash.a index e6714dda30e..94385332545 100644 Binary files a/tools/sdk/esp32s2/qio_qspi/libspi_flash.a and b/tools/sdk/esp32s2/qio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s2/qout_qspi/include/sdkconfig.h b/tools/sdk/esp32s2/qout_qspi/include/sdkconfig.h index 63c71eb5a90..dd6beadd187 100644 --- a/tools/sdk/esp32s2/qout_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s2/qout_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s2" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE0 1 @@ -181,6 +183,8 @@ #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE 32 #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 @@ -531,6 +535,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -633,5 +638,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s2/qout_qspi/libspi_flash.a b/tools/sdk/esp32s2/qout_qspi/libspi_flash.a index bb58b208da8..b00771e6bec 100644 Binary files a/tools/sdk/esp32s2/qout_qspi/libspi_flash.a and b/tools/sdk/esp32s2/qout_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s2/sdkconfig b/tools/sdk/esp32s2/sdkconfig index 1434aee92f1..ed7ae9a3b5c 100644 --- a/tools/sdk/esp32s2/sdkconfig +++ b/tools/sdk/esp32s2/sdkconfig @@ -170,10 +170,11 @@ CONFIG_ESP_RMAKER_USE_CERT_BUNDLE=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD=0 # CONFIG_ESP_RMAKER_SKIP_COMMON_NAME_CHECK is not set -# CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK is not set +CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y # CONFIG_ESP_RMAKER_SKIP_PROJECT_NAME_CHECK is not set CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE=1024 CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD=90 +# CONFIG_ESP_RMAKER_OTA_DISABLE_AUTO_REBOOT is not set # end of ESP RainMaker OTA Config # @@ -200,6 +201,7 @@ CONFIG_ESP_RMAKER_CMD_RESP_ENABLE=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32s2" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y CONFIG_ARDUINO_RUN_CORE0=y @@ -480,6 +482,7 @@ CONFIG_DEFAULT_PSRAM_CS_IO=26 # CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set # CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set CONFIG_SPIRAM_SPEED_80M=y # CONFIG_SPIRAM_SPEED_40M is not set # CONFIG_SPIRAM_SPEED_26M is not set @@ -609,8 +612,9 @@ CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES=2 # CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y # CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set -# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set -# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set # end of Sleep Config # @@ -661,6 +665,13 @@ CONFIG_ESP_PHY_MAX_TX_POWER=20 # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -751,6 +762,7 @@ CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -1512,11 +1524,13 @@ CONFIG_BF3005_SUPPORT=y CONFIG_BF20A6_SUPPORT=y # CONFIG_SC101IOT_SUPPORT is not set CONFIG_SC030IOT_SUPPORT=y +# CONFIG_SC031GS_SUPPORT is not set # CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set CONFIG_SCCB_HARDWARE_I2C_PORT1=y CONFIG_SCCB_CLK_FREQ=100000 # CONFIG_GC_SENSOR_WINDOWING_MODE is not set CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y +CONFIG_CAMERA_TASK_STACK_SIZE=2048 CONFIG_CAMERA_CORE0=y # CONFIG_CAMERA_CORE1 is not set # CONFIG_CAMERA_NO_AFFINITY is not set diff --git a/tools/sdk/esp32s3/bin/bootloader_dio_80m.bin b/tools/sdk/esp32s3/bin/bootloader_dio_80m.bin index 674b436d571..803fbd51c70 100644 Binary files a/tools/sdk/esp32s3/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32s3/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32s3/bin/bootloader_dio_80m.elf b/tools/sdk/esp32s3/bin/bootloader_dio_80m.elf new file mode 100755 index 00000000000..1227dbed74e Binary files /dev/null and b/tools/sdk/esp32s3/bin/bootloader_dio_80m.elf differ diff --git a/tools/sdk/esp32s3/bin/bootloader_opi_80m.bin b/tools/sdk/esp32s3/bin/bootloader_opi_80m.bin index 62b9eb9d9fb..d522fa4d1db 100644 Binary files a/tools/sdk/esp32s3/bin/bootloader_opi_80m.bin and b/tools/sdk/esp32s3/bin/bootloader_opi_80m.bin differ diff --git a/tools/sdk/esp32s3/bin/bootloader_opi_80m.elf b/tools/sdk/esp32s3/bin/bootloader_opi_80m.elf new file mode 100755 index 00000000000..3a5f7799bdc Binary files /dev/null and b/tools/sdk/esp32s3/bin/bootloader_opi_80m.elf differ diff --git a/tools/sdk/esp32s3/bin/bootloader_qio_120m.bin b/tools/sdk/esp32s3/bin/bootloader_qio_120m.bin index b434dc8f43a..73c09dfdbb5 100644 Binary files a/tools/sdk/esp32s3/bin/bootloader_qio_120m.bin and b/tools/sdk/esp32s3/bin/bootloader_qio_120m.bin differ diff --git a/tools/sdk/esp32s3/bin/bootloader_qio_120m.elf b/tools/sdk/esp32s3/bin/bootloader_qio_120m.elf new file mode 100755 index 00000000000..1af69b0ac83 Binary files /dev/null and b/tools/sdk/esp32s3/bin/bootloader_qio_120m.elf differ diff --git a/tools/sdk/esp32s3/bin/bootloader_qio_80m.bin b/tools/sdk/esp32s3/bin/bootloader_qio_80m.bin index b434dc8f43a..73c09dfdbb5 100644 Binary files a/tools/sdk/esp32s3/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32s3/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32s3/bin/bootloader_qio_80m.elf b/tools/sdk/esp32s3/bin/bootloader_qio_80m.elf new file mode 100755 index 00000000000..1af69b0ac83 Binary files /dev/null and b/tools/sdk/esp32s3/bin/bootloader_qio_80m.elf differ diff --git a/tools/sdk/esp32s3/dio_opi/include/sdkconfig.h b/tools/sdk/esp32s3/dio_opi/include/sdkconfig.h index 41ae19c9759..6ada221872a 100644 --- a/tools/sdk/esp32s3/dio_opi/include/sdkconfig.h +++ b/tools/sdk/esp32s3/dio_opi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -552,7 +554,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -624,6 +626,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -726,6 +729,9 @@ #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 @@ -1083,6 +1089,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -1213,5 +1220,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s3/dio_opi/libbootloader_support.a b/tools/sdk/esp32s3/dio_opi/libbootloader_support.a index 01b4403624d..1e22e6881c8 100644 Binary files a/tools/sdk/esp32s3/dio_opi/libbootloader_support.a and b/tools/sdk/esp32s3/dio_opi/libbootloader_support.a differ diff --git a/tools/sdk/esp32s3/dio_opi/libesp_hw_support.a b/tools/sdk/esp32s3/dio_opi/libesp_hw_support.a index bbb57865983..559b13977d8 100644 Binary files a/tools/sdk/esp32s3/dio_opi/libesp_hw_support.a and b/tools/sdk/esp32s3/dio_opi/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s3/dio_opi/libesp_system.a b/tools/sdk/esp32s3/dio_opi/libesp_system.a index 1d745a30d1b..fbbf64d4ad4 100644 Binary files a/tools/sdk/esp32s3/dio_opi/libesp_system.a and b/tools/sdk/esp32s3/dio_opi/libesp_system.a differ diff --git a/tools/sdk/esp32s3/dio_opi/libfreertos.a b/tools/sdk/esp32s3/dio_opi/libfreertos.a index 7fd9af5d45f..23cb239e1e0 100644 Binary files a/tools/sdk/esp32s3/dio_opi/libfreertos.a and b/tools/sdk/esp32s3/dio_opi/libfreertos.a differ diff --git a/tools/sdk/esp32s3/dio_opi/libspi_flash.a b/tools/sdk/esp32s3/dio_opi/libspi_flash.a index 670194c01b8..ecd8f2b7b76 100644 Binary files a/tools/sdk/esp32s3/dio_opi/libspi_flash.a and b/tools/sdk/esp32s3/dio_opi/libspi_flash.a differ diff --git a/tools/sdk/esp32s3/dio_opi/sections.ld b/tools/sdk/esp32s3/dio_opi/sections.ld index 49fd1b19dda..b7d7e210c62 100644 --- a/tools/sdk/esp32s3/dio_opi/sections.ld +++ b/tools/sdk/esp32s3/dio_opi/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -409,7 +409,7 @@ SECTIONS *(.wifislprxiram .wifislprxiram.*) *libesp_event.a:default_event_loop.*(.literal.esp_event_handler_instance_register .literal.esp_event_handler_instance_unregister .literal.esp_event_handler_register .literal.esp_event_handler_unregister .literal.esp_event_loop_create_default .literal.esp_event_loop_delete_default .literal.esp_event_post .literal.esp_event_send_to_default_loop .text .text.esp_event_handler_instance_register .text.esp_event_handler_instance_unregister .text.esp_event_handler_register .text.esp_event_handler_unregister .text.esp_event_loop_create_default .text.esp_event_loop_delete_default .text.esp_event_post .text.esp_event_send_to_default_loop) *libesp_event.a:esp_event.*(.literal.base_node_add_handler .literal.esp_event_handler_instance_register_with .literal.esp_event_handler_instance_unregister_with .literal.esp_event_handler_register_with .literal.esp_event_handler_register_with_internal .literal.esp_event_handler_unregister_with .literal.esp_event_handler_unregister_with_internal .literal.esp_event_loop_create .literal.esp_event_loop_delete .literal.esp_event_loop_run .literal.esp_event_loop_run_task .literal.esp_event_post_to .literal.handler_instances_add .literal.handler_instances_remove .literal.handler_instances_remove_all$isra$1 .literal.loop_node_add_handler .text .text.base_node_add_handler .text.esp_event_dump .text.esp_event_handler_instance_register_with .text.esp_event_handler_instance_unregister_with .text.esp_event_handler_register_with .text.esp_event_handler_register_with_internal .text.esp_event_handler_unregister_with .text.esp_event_handler_unregister_with_internal .text.esp_event_loop_create .text.esp_event_loop_delete .text.esp_event_loop_run .text.esp_event_loop_run_task .text.esp_event_post_to .text.handler_instances_add .text.handler_instances_remove .text.handler_instances_remove_all$isra$1 .text.loop_node_add_handler) - *libesp_hw_support.a:rtc_init.*(.literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.rtc_init .text.rtc_vddsdio_get_config) + *libesp_hw_support.a:rtc_init.*(.literal.get_rtc_dbias_by_efuse$constprop$3 .literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.get_rtc_dbias_by_efuse$constprop$3 .text.rtc_init .text.rtc_vddsdio_get_config) *libesp_system.a:esp_system.*(.literal.esp_get_free_heap_size .literal.esp_get_free_internal_heap_size .literal.esp_get_idf_version .literal.esp_get_minimum_free_heap_size .literal.esp_register_shutdown_handler .literal.esp_unregister_shutdown_handler .text .text.esp_get_free_heap_size .text.esp_get_free_internal_heap_size .text.esp_get_idf_version .text.esp_get_minimum_free_heap_size .text.esp_register_shutdown_handler .text.esp_unregister_shutdown_handler) *libfreertos.a:port.*(.literal.esp_startup_start_app .text.esp_startup_start_app) *libfreertos.a:port.*(.literal.esp_startup_start_app_other_cores .text.esp_startup_start_app_other_cores) @@ -476,8 +476,8 @@ SECTIONS { _flash_rodata_start = ABSOLUTE(.); - *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) *(.rodata_wlog_error .rodata_wlog_error.*) + *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ *(.gnu.linkonce.r.*) @@ -583,6 +583,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s3/dio_qspi/include/sdkconfig.h b/tools/sdk/esp32s3/dio_qspi/include/sdkconfig.h index d2d8c5459e5..e47364d21c1 100644 --- a/tools/sdk/esp32s3/dio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s3/dio_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -552,7 +554,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -624,6 +626,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -724,6 +727,9 @@ #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 @@ -1081,6 +1087,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -1211,5 +1218,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s3/dio_qspi/libbootloader_support.a b/tools/sdk/esp32s3/dio_qspi/libbootloader_support.a index 01b4403624d..1e22e6881c8 100644 Binary files a/tools/sdk/esp32s3/dio_qspi/libbootloader_support.a and b/tools/sdk/esp32s3/dio_qspi/libbootloader_support.a differ diff --git a/tools/sdk/esp32s3/dio_qspi/libesp_hw_support.a b/tools/sdk/esp32s3/dio_qspi/libesp_hw_support.a index 35156aaf6d8..537d2ff9f80 100644 Binary files a/tools/sdk/esp32s3/dio_qspi/libesp_hw_support.a and b/tools/sdk/esp32s3/dio_qspi/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s3/dio_qspi/libesp_system.a b/tools/sdk/esp32s3/dio_qspi/libesp_system.a index c5a4399330e..1bc198de0d0 100644 Binary files a/tools/sdk/esp32s3/dio_qspi/libesp_system.a and b/tools/sdk/esp32s3/dio_qspi/libesp_system.a differ diff --git a/tools/sdk/esp32s3/dio_qspi/libfreertos.a b/tools/sdk/esp32s3/dio_qspi/libfreertos.a index 7fd9af5d45f..23cb239e1e0 100644 Binary files a/tools/sdk/esp32s3/dio_qspi/libfreertos.a and b/tools/sdk/esp32s3/dio_qspi/libfreertos.a differ diff --git a/tools/sdk/esp32s3/dio_qspi/libspi_flash.a b/tools/sdk/esp32s3/dio_qspi/libspi_flash.a index 67f95358e67..40d1bb97696 100644 Binary files a/tools/sdk/esp32s3/dio_qspi/libspi_flash.a and b/tools/sdk/esp32s3/dio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s3/dio_qspi/sections.ld b/tools/sdk/esp32s3/dio_qspi/sections.ld index fda5831163a..6efac6846cc 100644 --- a/tools/sdk/esp32s3/dio_qspi/sections.ld +++ b/tools/sdk/esp32s3/dio_qspi/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -409,7 +409,7 @@ SECTIONS *(.wifislprxiram .wifislprxiram.*) *libesp_event.a:default_event_loop.*(.literal.esp_event_handler_instance_register .literal.esp_event_handler_instance_unregister .literal.esp_event_handler_register .literal.esp_event_handler_unregister .literal.esp_event_loop_create_default .literal.esp_event_loop_delete_default .literal.esp_event_post .literal.esp_event_send_to_default_loop .text .text.esp_event_handler_instance_register .text.esp_event_handler_instance_unregister .text.esp_event_handler_register .text.esp_event_handler_unregister .text.esp_event_loop_create_default .text.esp_event_loop_delete_default .text.esp_event_post .text.esp_event_send_to_default_loop) *libesp_event.a:esp_event.*(.literal.base_node_add_handler .literal.esp_event_handler_instance_register_with .literal.esp_event_handler_instance_unregister_with .literal.esp_event_handler_register_with .literal.esp_event_handler_register_with_internal .literal.esp_event_handler_unregister_with .literal.esp_event_handler_unregister_with_internal .literal.esp_event_loop_create .literal.esp_event_loop_delete .literal.esp_event_loop_run .literal.esp_event_loop_run_task .literal.esp_event_post_to .literal.handler_instances_add .literal.handler_instances_remove .literal.handler_instances_remove_all$isra$1 .literal.loop_node_add_handler .text .text.base_node_add_handler .text.esp_event_dump .text.esp_event_handler_instance_register_with .text.esp_event_handler_instance_unregister_with .text.esp_event_handler_register_with .text.esp_event_handler_register_with_internal .text.esp_event_handler_unregister_with .text.esp_event_handler_unregister_with_internal .text.esp_event_loop_create .text.esp_event_loop_delete .text.esp_event_loop_run .text.esp_event_loop_run_task .text.esp_event_post_to .text.handler_instances_add .text.handler_instances_remove .text.handler_instances_remove_all$isra$1 .text.loop_node_add_handler) - *libesp_hw_support.a:rtc_init.*(.literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.rtc_init .text.rtc_vddsdio_get_config) + *libesp_hw_support.a:rtc_init.*(.literal.get_rtc_dbias_by_efuse$constprop$3 .literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.get_rtc_dbias_by_efuse$constprop$3 .text.rtc_init .text.rtc_vddsdio_get_config) *libesp_system.a:esp_system.*(.literal.esp_get_free_heap_size .literal.esp_get_free_internal_heap_size .literal.esp_get_idf_version .literal.esp_get_minimum_free_heap_size .literal.esp_register_shutdown_handler .literal.esp_unregister_shutdown_handler .text .text.esp_get_free_heap_size .text.esp_get_free_internal_heap_size .text.esp_get_idf_version .text.esp_get_minimum_free_heap_size .text.esp_register_shutdown_handler .text.esp_unregister_shutdown_handler) *libfreertos.a:port.*(.literal.esp_startup_start_app .text.esp_startup_start_app) *libfreertos.a:port.*(.literal.esp_startup_start_app_other_cores .text.esp_startup_start_app_other_cores) @@ -476,8 +476,8 @@ SECTIONS { _flash_rodata_start = ABSOLUTE(.); - *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) *(.rodata_wlog_error .rodata_wlog_error.*) + *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:spiram_psram.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ *(.gnu.linkonce.r.*) @@ -583,6 +583,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/class/video/video.h b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/class/video/video.h index 84474654663..e8227ea6069 100644 --- a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/class/video/video.h +++ b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/class/video/video.h @@ -302,6 +302,45 @@ typedef struct TU_ATTR_PACKED { uint8_t bCopyProtect; } tusb_desc_cs_video_fmt_uncompressed_t; +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFormatIndex; + uint8_t bNumFrameDescriptors; + uint8_t bmFlags; + uint8_t bDefaultFrameIndex; + uint8_t bAspectRatioX; + uint8_t bAspectRatioY; + uint8_t bmInterlaceFlags; + uint8_t bCopyProtect; +} tusb_desc_cs_video_fmt_mjpeg_t; + +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFormatIndex; + uint32_t dwMaxVideoFrameBufferSize; /* deprecated */ + uint8_t bFormatType; +} tusb_desc_cs_video_fmt_dv_t; + +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFormatIndex; + uint8_t bNumFrameDescriptors; + uint8_t guidFormat[16]; + uint8_t bBitsPerPixel; + uint8_t bDefaultFrameIndex; + uint8_t bAspectRatioX; + uint8_t bAspectRatioY; + uint8_t bmInterlaceFlags; + uint8_t bCopyProtect; + uint8_t bVaribaleSize; +} tusb_desc_cs_video_fmt_frame_based_t; + typedef struct TU_ATTR_PACKED { uint8_t bLength; uint8_t bDescriptorType; @@ -318,6 +357,24 @@ typedef struct TU_ATTR_PACKED { uint32_t dwFrameInterval[]; } tusb_desc_cs_video_frm_uncompressed_t; +typedef tusb_desc_cs_video_frm_uncompressed_t tusb_desc_cs_video_frm_mjpeg_t; + +typedef struct TU_ATTR_PACKED { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubType; + uint8_t bFrameIndex; + uint8_t bmCapabilities; + uint16_t wWidth; + uint16_t wHeight; + uint32_t dwMinBitRate; + uint32_t dwMaxBitRate; + uint32_t dwDefaultFrameInterval; + uint8_t bFrameIntervalType; + uint32_t dwBytesPerLine; + uint32_t dwFrameInterval[]; +} tusb_desc_cs_video_frm_frame_based_t; + //--------------------------------------------------------------------+ // Requests //--------------------------------------------------------------------+ @@ -378,8 +435,11 @@ TU_VERIFY_STATIC( sizeof(video_probe_and_commit_control_t) == 48, "size is not c #define TUD_VIDEO_DESC_CS_VS_IN_LEN 13 #define TUD_VIDEO_DESC_CS_VS_OUT_LEN 9 #define TUD_VIDEO_DESC_CS_VS_FMT_UNCOMPR_LEN 27 +#define TUD_VIDEO_DESC_CS_VS_FMT_MJPEG_LEN 11 #define TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT_LEN 38 #define TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_DISC_LEN 26 +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT_LEN 38 +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC_LEN 26 #define TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN 6 /* 2.2 compression formats */ @@ -462,6 +522,25 @@ TU_VERIFY_STATIC( sizeof(video_probe_and_commit_control_t) == 48, "size is not c _frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \ U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), (TU_ARGS_NUM(__VA_ARGS__)), __VA_ARGS__ +/* Motion-JPEG 3.1.1 Table 3-1 */ +#define TUD_VIDEO_DESC_CS_VS_FMT_MJPEG(_fmtidx, _numfrmdesc, _fixed_sz, _frmidx, _asrx, _asry, _interlace, _cp) \ + TUD_VIDEO_DESC_CS_VS_FMT_MJPEG_LEN, TUSB_DESC_CS_INTERFACE, VIDEO_CS_ITF_VS_FORMAT_MJPEG, \ + _fmtidx, _numfrmdesc, _fixed_sz, _frmidx, _asrx, _asry, _interlace, _cp + +/* Motion-JPEG 3.1.1 Table 3-2 and 3-3 */ +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT(_frmidx, _cap, _width, _height, _minbr, _maxbr, _maxfrmbufsz, _frminterval, _minfrminterval, _maxfrminterval, _frmintervalstep) \ + TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT_LEN, TUSB_DESC_CS_INTERFACE, VIDEO_CS_ITF_VS_FRAME_MJPEG, \ + _frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \ + U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), 0, \ + U32_TO_U8S_LE(_minfrminterval), U32_TO_U8S_LE(_maxfrminterval), U32_TO_U8S_LE(_frmintervalstep) + +/* Motion-JPEG 3.1.1 Table 3-2 and 3-4 */ +#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC(_frmidx, _cap, _width, _height, _minbr, _maxbr, _maxfrmbufsz, _frminterval, ...) \ + TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC_LEN + (TU_ARGS_NUM(__VA_ARGS__)) * 4, \ + TUSB_DESC_CS_INTERFACE, VIDEO_CS_VS_INTERFACE_FRAME_MJPEG, \ + _frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \ + U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), (TU_ARGS_NUM(__VA_ARGS__)), __VA_ARGS__ + /* 3.9.2.6 */ #define TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING(_color, _trns, _mat) \ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN, \ diff --git a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h index baa82fc14dc..86c68baf80a 100644 --- a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h +++ b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_mcu.h @@ -111,6 +111,11 @@ #define TUP_DCD_ENDPOINT_MAX 8 #define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER +#elif TU_CHECK_MCU(OPT_MCU_PIC32MX, OPT_MCU_PIC32MM, OPT_MCU_PIC32MK) || \ + TU_CHECK_MCU(OPT_MCU_PIC24, OPT_MCU_DSPIC33) + #define TUP_DCD_ENDPOINT_MAX 16 + #define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER + //------------- ST -------------// #elif TU_CHECK_MCU(OPT_MCU_STM32F0) #define TUP_DCD_ENDPOINT_MAX 8 @@ -184,6 +189,11 @@ #elif TU_CHECK_MCU(OPT_MCU_STM32WB) #define TUP_DCD_ENDPOINT_MAX 8 +#elif TU_CHECK_MCU(OPT_MCU_STM32U5) + #define TUP_USBIP_DWC2 + #define TUP_USBIP_DWC2_STM32 + #define TUP_DCD_ENDPOINT_MAX 6 + //------------- Sony -------------// #elif TU_CHECK_MCU(OPT_MCU_CXD56) #define TUP_DCD_ENDPOINT_MAX 7 diff --git a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h index 1f2a38d4c7e..e11f08dd171 100644 --- a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h +++ b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/common/tusb_types.h @@ -513,6 +513,20 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_edpt_packet_size(tusb_desc_endpo return tu_le16toh(desc_ep->wMaxPacketSize) & TU_GENMASK(10, 0); } +#if CFG_TUSB_DEBUG +TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_dir_str(tusb_dir_t dir) +{ + static const char *str[] = {"out", "in"}; + return str[dir]; +} + +TU_ATTR_ALWAYS_INLINE static inline const char *tu_edpt_type_str(tusb_xfer_type_t t) +{ + static const char *str[] = {"control", "isochronous", "bulk", "interrupt"}; + return str[t]; +} +#endif + //--------------------------------------------------------------------+ // Descriptor helper //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h index 1187e0d6e08..ea786362ef1 100644 --- a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h +++ b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_stm32.h @@ -64,6 +64,10 @@ // NOTE: H7 with only 1 USB port: H72x / H73x / H7Ax / H7Bx // USB_OTG_FS_PERIPH_BASE and OTG_FS_IRQn not defined + #if (! defined USB2_OTG_FS) + #define USB_OTG_FS_PERIPH_BASE USB1_OTG_HS_PERIPH_BASE + #define OTG_FS_IRQn OTG_HS_IRQn + #endif #elif CFG_TUSB_MCU == OPT_MCU_STM32F7 #include "stm32f7xx.h" @@ -78,6 +82,12 @@ #define EP_MAX_FS 6 #define EP_FIFO_SIZE_FS 1280 +#elif CFG_TUSB_MCU == OPT_MCU_STM32U5 + #include "stm32u5xx.h" + #define USB_OTG_FS_PERIPH_BASE USB_OTG_FS_BASE + #define EP_MAX_FS 6 + #define EP_FIFO_SIZE_FS 1280 + #else #error "Unsupported MCUs" #endif diff --git a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/tusb_option.h b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/tusb_option.h index e0447b10c5e..f95ae62734e 100644 --- a/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/tusb_option.h +++ b/tools/sdk/esp32s3/include/arduino_tinyusb/tinyusb/src/tusb_option.h @@ -33,7 +33,7 @@ typedef int make_iso_compilers_happy; #include "common/tusb_compiler.h" #define TUSB_VERSION_MAJOR 0 -#define TUSB_VERSION_MINOR 13 +#define TUSB_VERSION_MINOR 14 #define TUSB_VERSION_REVISION 0 #define TUSB_VERSION_STRING TU_STRING(TUSB_VERSION_MAJOR) "." TU_STRING(TUSB_VERSION_MINOR) "." TU_STRING(TUSB_VERSION_REVISION) @@ -84,6 +84,7 @@ typedef int make_iso_compilers_happy; #define OPT_MCU_STM32G0 310 ///< ST G0 #define OPT_MCU_STM32G4 311 ///< ST G4 #define OPT_MCU_STM32WB 312 ///< ST WB +#define OPT_MCU_STM32U5 313 ///< ST U5 // Sony #define OPT_MCU_CXD56 400 ///< SONY CXD56 @@ -146,6 +147,11 @@ typedef int make_iso_compilers_happy; // PIC #define OPT_MCU_PIC32MZ 1900 ///< MicroChip PIC32MZ family +#define OPT_MCU_PIC32MM 1901 ///< MicroChip PIC32MM family +#define OPT_MCU_PIC32MX 1902 ///< MicroChip PIC32MX family +#define OPT_MCU_PIC32MK 1903 ///< MicroChip PIC32MK family +#define OPT_MCU_PIC24 1910 ///< MicroChip PIC24 family +#define OPT_MCU_DSPIC33 1911 ///< MicroChip DSPIC33 family // BridgeTek #define OPT_MCU_FT90X 2000 ///< BridgeTek FT90x diff --git a/tools/sdk/esp32s3/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32s3/include/bootloader_support/include/bootloader_common.h index 2f4e9062200..1a641be10ec 100644 --- a/tools/sdk/esp32s3/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32s3/include/bootloader_support/include/bootloader_common.h @@ -26,7 +26,7 @@ extern "C" { #endif -/// Type of hold a GPIO in low state +// Type of hold a GPIO in low state typedef enum { GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */ GPIO_SHORT_HOLD = -1, /*!< The short hold GPIO */ diff --git a/tools/sdk/esp32s3/include/bt/common/api/include/api/esp_blufi_api.h b/tools/sdk/esp32s3/include/bt/common/api/include/api/esp_blufi_api.h index 7c99f658206..63109b20f12 100644 --- a/tools/sdk/esp32s3/include/bt/common/api/include/api/esp_blufi_api.h +++ b/tools/sdk/esp32s3/include/bt/common/api/include/api/esp_blufi_api.h @@ -114,9 +114,9 @@ typedef struct { } esp_blufi_ap_record_t; /// Bluetooth address length -#define ESP_BD_ADDR_LEN 6 +#define ESP_BLUFI_BD_ADDR_LEN 6 /// Bluetooth device address -typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN]; +typedef uint8_t esp_blufi_bd_addr_t[ESP_BLUFI_BD_ADDR_LEN]; /** * @brief BLUFI callback parameters union @@ -147,7 +147,7 @@ typedef union { * @brief ESP_BLUFI_EVENT_CONNECT */ struct blufi_connect_evt_param { - esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ + esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ uint8_t server_if; /*!< server interface */ uint16_t conn_id; /*!< Connection id */ } connect; /*!< Blufi callback param of ESP_BLUFI_EVENT_CONNECT */ @@ -156,7 +156,7 @@ typedef union { * @brief ESP_BLUFI_EVENT_DISCONNECT */ struct blufi_disconnect_evt_param { - esp_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ + esp_blufi_bd_addr_t remote_bda; /*!< Blufi Remote bluetooth device address */ } disconnect; /*!< Blufi callback param of ESP_BLUFI_EVENT_DISCONNECT */ /* ESP_BLUFI_EVENT_REQ_WIFI_CONNECT */ /* No callback param */ diff --git a/tools/sdk/esp32s3/include/bt/common/osi/include/osi/fixed_pkt_queue.h b/tools/sdk/esp32s3/include/bt/common/osi/include/osi/fixed_pkt_queue.h new file mode 100644 index 00000000000..f4235ca5d99 --- /dev/null +++ b/tools/sdk/esp32s3/include/bt/common/osi/include/osi/fixed_pkt_queue.h @@ -0,0 +1,79 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _FIXED_PKT_QUEUE_H_ +#define _FIXED_PKT_QUEUE_H_ + + +#include "osi/pkt_queue.h" +#include "osi/semaphore.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef FIXED_PKT_QUEUE_SIZE_MAX +#define FIXED_PKT_QUEUE_SIZE_MAX 254 +#endif + +#define FIXED_PKT_QUEUE_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT + +struct fixed_pkt_queue_t; + +typedef struct fixed_pkt_queue_t fixed_pkt_queue_t; + +typedef void (*fixed_pkt_queue_free_cb)(pkt_linked_item_t *data); +typedef void (*fixed_pkt_queue_cb)(fixed_pkt_queue_t *queue); + +// Creates a new fixed queue with the given |capacity|. If more elements than +// |capacity| are added to the queue, the caller is blocked until space is +// made available in the queue. Returns NULL on failure. The caller must free +// the returned queue with |fixed_pkt_queue_free|. +fixed_pkt_queue_t *fixed_pkt_queue_new(size_t capacity); + +// Freeing a queue that is currently in use (i.e. has waiters +// blocked on it) results in undefined behaviour. +void fixed_pkt_queue_free(fixed_pkt_queue_t *queue, fixed_pkt_queue_free_cb free_cb); + +// Returns a value indicating whether the given |queue| is empty. If |queue| +// is NULL, the return value is true. +bool fixed_pkt_queue_is_empty(fixed_pkt_queue_t *queue); + +// Returns the length of the |queue|. If |queue| is NULL, the return value +// is 0. +size_t fixed_pkt_queue_length(fixed_pkt_queue_t *queue); + +// Returns the maximum number of elements this queue may hold. |queue| may +// not be NULL. +size_t fixed_pkt_queue_capacity(fixed_pkt_queue_t *queue); + +// Enqueues the given |data| into the |queue|. The caller will be blocked or immediately return or wait for timeout according to the parameter timeout. +// If enqueue failed, it will return false, otherwise return true +bool fixed_pkt_queue_enqueue(fixed_pkt_queue_t *queue, pkt_linked_item_t *linked_pkt, uint32_t timeout); + +// Dequeues the next element from |queue|. If the queue is currently empty, +// this function will block the caller until an item is enqueued or immediately return or wait for timeout according to the parameter timeout. +// If dequeue failed, it will return NULL, otherwise return a point. +pkt_linked_item_t *fixed_pkt_queue_dequeue(fixed_pkt_queue_t *queue, uint32_t timeout); + +// Returns the first element from |queue|, if present, without dequeuing it. +// This function will never block the caller. Returns NULL if there are no +// elements in the queue or |queue| is NULL. +pkt_linked_item_t *fixed_pkt_queue_try_peek_first(fixed_pkt_queue_t *queue); + +// Registers |queue| with |reactor| for dequeue operations. When there is an element +// in the queue, ready_cb will be called. The |context| parameter is passed, untouched, +// to the callback routine. Neither |queue|, nor |reactor|, nor |read_cb| may be NULL. +// |context| may be NULL. +void fixed_pkt_queue_register_dequeue(fixed_pkt_queue_t *queue, fixed_pkt_queue_cb ready_cb); + +// Unregisters the dequeue ready callback for |queue| from whichever reactor +// it is registered with, if any. This function is idempotent. +void fixed_pkt_queue_unregister_dequeue(fixed_pkt_queue_t *queue); + +void fixed_pkt_queue_process(fixed_pkt_queue_t *queue); + +#endif diff --git a/tools/sdk/esp32s3/include/bt/common/osi/include/osi/pkt_queue.h b/tools/sdk/esp32s3/include/bt/common/osi/include/osi/pkt_queue.h new file mode 100644 index 00000000000..96277c3e182 --- /dev/null +++ b/tools/sdk/esp32s3/include/bt/common/osi/include/osi/pkt_queue.h @@ -0,0 +1,88 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _PKT_LIST_H_ +#define _PKT_LIST_H_ + +#include "sys/queue.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct pkt_queue; + +typedef struct pkt_linked_item { + STAILQ_ENTRY(pkt_linked_item) next; + uint8_t data[]; +} pkt_linked_item_t; + +#define BT_PKT_LINKED_HDR_SIZE (sizeof (pkt_linked_item_t)) + +typedef void (*pkt_queue_free_cb)(pkt_linked_item_t *item); + +/* + * brief: create a pkt_queue instance. pkt_queue is a wrapper class of a FIFO implemented by single linked list. + * The enqueue and dequeue operations of the FIFO are protected against race conditions of multiple tasks + * return: NULL if not enough memory, otherwise a valid pointer + */ +struct pkt_queue *pkt_queue_create(void); + +/* + * brief: enqueue one item to the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * param item: the item to be enqueued to the FIFO + * return: true if enqueued successfully, false when the arguments passed in are invalid + */ +bool pkt_queue_enqueue(struct pkt_queue *queue, pkt_linked_item_t *item); + +/* + * brief: dequeue one item for the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * return: pointer of type pkt_linked_item_t dequeued, NULL if the queue is empty or upon exception + */ +pkt_linked_item_t *pkt_queue_dequeue(struct pkt_queue *queue); + +/* + * brief: get the pointer of the first item from the FIFO but not get it dequeued + * param queue: pkt_queue instance created using pkt_queue_create + * return: pointer of the first item in the FIFO, NULL if the FIFO is empty + */ +pkt_linked_item_t *pkt_queue_try_peek_first(struct pkt_queue *queue); + +/* + * brief: retrieve the number of items existing in the FIFO + * param queue: pkt_queue instance created using pkt_queue_create + * return: total number of items in the FIFO + */ +size_t pkt_queue_length(const struct pkt_queue *queue); + +/* + * brief: retrieve the status whether the FIFO is empty + * param queue: pkt_queue instance created using pkt_queue_create + * return: false if the FIFO is not empty, otherwise true + */ +bool pkt_queue_is_empty(const struct pkt_queue *queue); + +/* + * brief: delete the item in the FIFO one by one + * param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default + */ +void pkt_queue_flush(struct pkt_queue *queue, pkt_queue_free_cb free_cb); + +/* + * brief: delete the items in the FIFO and then destroy the pkt_queue instance. + * param free_cb: destructor function for each item in the FIFO, if set to NULL, will use osi_free_func by default + */ +void pkt_queue_destroy(struct pkt_queue *queue, pkt_queue_free_cb free_cb); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tools/sdk/esp32s3/include/bt/common/osi/include/osi/thread.h b/tools/sdk/esp32s3/include/bt/common/osi/include/osi/thread.h index fdabed1cf68..c9be3375ddc 100644 --- a/tools/sdk/esp32s3/include/bt/common/osi/include/osi/thread.h +++ b/tools/sdk/esp32s3/include/bt/common/osi/include/osi/thread.h @@ -28,6 +28,7 @@ #define OSI_THREAD_MAX_TIMEOUT OSI_SEM_MAX_TIMEOUT struct osi_thread; +struct osi_event; typedef struct osi_thread osi_thread_t; @@ -48,7 +49,7 @@ typedef enum { * param work_queue_num: speicify queue number, the queue[0] has highest priority, and the priority is decrease by index * return : if create successfully, return thread handler; otherwise return NULL. */ -osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num); +osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priority, osi_thread_core_t core, uint8_t work_queue_num, const size_t work_queue_len[]); /* * brief: Destroy a thread or task @@ -88,4 +89,42 @@ const char *osi_thread_name(osi_thread_t *thread); */ int osi_thread_queue_wait_size(osi_thread_t *thread, int wq_idx); +/* + * brief: Create an osi_event struct and register the handler function and its argument + * An osi_event is a kind of work that can be posted to the workqueue of osi_thread to process, + * but the work can have at most one instance the thread workqueue before it is processed. This + * allows the "single post, multiple data processing" jobs. + * param func: the handler to process the job + * param context: the argument to be passed to the handler function when the job is being processed + * return: NULL if no memory, otherwise a valid struct pointer + */ +struct osi_event *osi_event_create(osi_thread_func_t func, void *context); + +/* + * brief: Bind an osi_event to a specific work queue for an osi_thread. + * After binding is completed, a function call of API osi_thread_post_event will send a work + * to the workqueue of the thread, with specified queue index. + * param func: event: the pointer to osi_event that is created using osi_event_create + * param thread: the pointer to osi_thread that is created using osi_thread_create + * param queue_idx: the index of the workqueue of the specified osi_thread, with range starting from 0 to work_queue_num - 1 + * return: true if osi_event binds to the thread's workqueue successfully, otherwise false + */ +bool osi_event_bind(struct osi_event* event, osi_thread_t *thread, int queue_idx); + +/* + * brief: Destroy the osi_event struct created by osi_event_create and free the allocated memory + * param event: the pointer to osi_event + */ +void osi_event_delete(struct osi_event* event); + +/* + * brief: try sending a work to the binded thread's workqueue, so that it can be handled by the worker thread + * param event: pointer to osi_event, created by osi_event_create + * param timeout: post timeout, OSI_THREAD_MAX_TIMEOUT means blocking forever, 0 means never blocking, others means block millisecond + * return: true if the message is enqueued to the thread workqueue, otherwise failed + * note: if the return value of function is false, it is the case that the workqueue of the thread is full, and users + * are expected to post the event sometime later to get the work handled. + */ +bool osi_thread_post_event(struct osi_event *event, uint32_t timeout); + #endif /* __THREAD_H__ */ diff --git a/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/mesh.h b/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/mesh.h index 33155aa555c..cb6efd0dc03 100644 --- a/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/mesh.h +++ b/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/mesh.h @@ -20,7 +20,7 @@ extern "C" { #define BLE_MESH_KEY_ANY 0xffff #define BLE_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000) -#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) <= 0xff00) +#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00) #define BLE_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000) #define BLE_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfffb) diff --git a/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/net.h b/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/net.h index 8a1b9b343a3..f982c41cee4 100644 --- a/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/net.h +++ b/tools/sdk/esp32s3/include/bt/esp_ble_mesh/mesh_core/net.h @@ -95,7 +95,6 @@ struct bt_mesh_friend { uint8_t fsn:1, send_last:1, pending_req:1, - sec_update:1, pending_buf:1, valid:1, established:1; diff --git a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h index f81ad21800e..0f0a1935d31 100644 --- a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h +++ b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h @@ -25,8 +25,8 @@ extern "C" { #endif -/**@{ - * BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag +/** + * @brief BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag */ #define ESP_BLE_ADV_FLAG_LIMIT_DISC (0x01 << 0) #define ESP_BLE_ADV_FLAG_GEN_DISC (0x01 << 1) @@ -34,104 +34,102 @@ extern "C" { #define ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT (0x01 << 3) #define ESP_BLE_ADV_FLAG_DMT_HOST_SPT (0x01 << 4) #define ESP_BLE_ADV_FLAG_NON_LIMIT_DISC (0x00 ) -/** - * @} - */ -/* relate to BTM_LE_KEY_xxx in stack/btm_api.h */ -#define ESP_LE_KEY_NONE 0 /* relate to BTM_LE_KEY_NONE in stack/btm_api.h */ -#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ /* relate to BTM_LE_KEY_PENC in stack/btm_api.h */ -#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ /* relate to BTM_LE_KEY_PID in stack/btm_api.h */ -#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ /* relate to BTM_LE_KEY_PCSRK in stack/btm_api.h */ -#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ /* relate to BTM_LE_KEY_PLK in stack/btm_api.h */ -#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /* relate to BTM_LE_KEY_LLK in stack/btm_api.h */ -#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ /* relate to BTM_LE_KEY_LENC in stack/btm_api.h */ -#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ /* relate to BTM_LE_KEY_LID in stack/btm_api.h */ -#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ /* relate to BTM_LE_KEY_LCSRK in stack/btm_api.h */ + +/// relate to BTM_LE_KEY_xxx in stack/btm_api.h +#define ESP_LE_KEY_NONE 0 /*!< No encryption key */ +#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ +#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ +#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ +#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ +#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /*!< peer link key*/ +#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ +#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ +#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ typedef uint8_t esp_ble_key_type_t; -/* relate to BTM_LE_AUTH_xxx in stack/btm_api.h */ -#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)/*!< 0101*/ -#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */ -#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM_BOND in stack/btm_api.h */ +/// relate to BTM_LE_AUTH_xxx in stack/btm_api.h +#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0 no bondingv*/ +#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 device in the bonding with peer */ +#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 man in the middle attack */ +#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM) /*!< 0101 banding with man in the middle attack */ +#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 secure connection */ +#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 secure connection with band*/ +#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 secure conn with MITM */ +#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 SC with MITM and Bonding*/ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit pattern */ -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 -#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 - -#define ESP_BLE_OOB_DISABLE 0 -#define ESP_BLE_OOB_ENABLE 1 - -/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */ -#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */ -#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */ -#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */ -#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */ -#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in stack/btm_api.h */ - -#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /* relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /* relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /* relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /* relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /* relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /* relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /* relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /* relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /* relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /* relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /* relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /* relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /* relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /* relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /* relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /* relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /* relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /* relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /* relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /* relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /* relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /* relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /* relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /* relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /* relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /* relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /* relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /* relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /* relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /* relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /* relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /* relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /* relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /* relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /* relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /* relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /* relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /* relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ -#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ +#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 /*!< authentication disable*/ +#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 /*!< authentication enable*/ + +#define ESP_BLE_OOB_DISABLE 0 /*!< disbale the out of bond*/ +#define ESP_BLE_OOB_ENABLE 1 /*!< enable the out of bond*/ + +/// relate to BTM_IO_CAP_xxx in stack/btm_api.h +#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ +#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ +#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ +#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ +#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ + +#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /*!< relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /*!< relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /*!< relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /*!< relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /*!< relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /*!< relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /*!< relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /*!< relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /*!< relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /*!< relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /*!< relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /*!< relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /*!< relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */ +#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */ typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */ @@ -147,15 +145,15 @@ typedef enum { ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */ ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */ #endif // #if (BLE_42_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */ - ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */ - ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */ - ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /* passkey notification event */ - ESP_GAP_BLE_PASSKEY_REQ_EVT, /* passkey request event */ - ESP_GAP_BLE_OOB_REQ_EVT, /* OOB request event */ - ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */ - ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */ - ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */ + ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */ + ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */ + ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */ + ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /*!< passkey notification event */ + ESP_GAP_BLE_PASSKEY_REQ_EVT, /*!< passkey request event */ + ESP_GAP_BLE_OOB_REQ_EVT, /*!< OOB request event */ + ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */ + ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */ + ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */ #if (BLE_42_FEATURE_SUPPORT == TRUE) ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */ ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */ @@ -174,45 +172,45 @@ typedef enum { #endif //#if (BLE_42_FEATURE_SUPPORT == TRUE) ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */ #if (BLE_50_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, - ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, - ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, - ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, - ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, - ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, - ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, - ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, - ESP_GAP_BLE_EXT_ADV_REPORT_EVT, - ESP_GAP_BLE_SCAN_TIMEOUT_EVT, - ESP_GAP_BLE_ADV_TERMINATED_EVT, - ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, - ESP_GAP_BLE_CHANNEL_SELETE_ALGORITHM_EVT, - ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, - ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, + ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */ + ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */ + ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */ + ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, /*!< when extended set random address complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when extended advertising parameter complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, /*!< when extended advertising data complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< when extended scan response data complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, /*!< when extended advertising start complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, /*!< when extended advertising stop complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, /*!< when extended advertising set remove complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, /*!< when extended advertising set clear complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when periodic advertising parameter complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, /*!< when periodic advertising data complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, /*!< when periodic advertising start complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, /*!< when periodic advertising stop complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, /*!< when periodic advertising create sync complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, /*!< when extended advertising sync cancel complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, /*!< when extended advertising sync terminate complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, /*!< when extended advertising add device complete , the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, /*!< when extended advertising remove device complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, /*!< when extended advertising clear device, the event comes */ + ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, /*!< when extended scan parameter complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, /*!< when extended scan start complete, the event comes */ + ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, /*!< when extended scan stop complete, the event comes */ + ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, /*!< when extended prefer connection parameter set complete, the event comes */ + ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, /*!< when ble phy update complete, the event comes */ + ESP_GAP_BLE_EXT_ADV_REPORT_EVT, /*!< when extended advertising report complete, the event comes */ + ESP_GAP_BLE_SCAN_TIMEOUT_EVT, /*!< when scan timeout complete, the event comes */ + ESP_GAP_BLE_ADV_TERMINATED_EVT, /*!< when advertising terminate data complete, the event comes */ + ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, /*!< when scan req received complete, the event comes */ + ESP_GAP_BLE_CHANNEL_SELETE_ALGORITHM_EVT, /*!< when channel select algorithm complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */ + ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */ #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) - ESP_GAP_BLE_EVT_MAX, + ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */ } esp_gap_ble_cb_event_t; -#define ESP_GAP_BLE_CHANNELS_LEN 5 +#define ESP_GAP_BLE_CHANNELS_LEN 5 /*!< channel length*/ typedef uint8_t esp_gap_ble_channels[ESP_GAP_BLE_CHANNELS_LEN]; /// This is the old name, just for backwards compatibility @@ -296,46 +294,47 @@ typedef enum { /* relate to BTA_DM_BLE_SEC_xxx in bta/bta_api.h */ typedef enum { - ESP_BLE_SEC_ENCRYPT = 1, /* relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already - bonded, the stack will used LTK to encrypt with the remote device directly. + ESP_BLE_SEC_ENCRYPT = 1, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already + bonded, the stack will used Long Term Key (LTK) to encrypt with the remote device directly. Else if the device hasn't bonded, the stack will used the default authentication request used the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_NO_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used NO MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ - ESP_BLE_SEC_ENCRYPT_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has already - bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK - to encrypt with the remote device directly, else Re-pair with the remote device. - Else if the device hasn't bonded, the stack will used MITM authentication request in the current link instead of - used the authreq in the esp_ble_gap_set_security_param function set by the user. */ + ESP_BLE_SEC_ENCRYPT_NO_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has been already + bonded, the stack will check the LTK (Long Term Key) Whether the authentication request has been met, and if met, use the LTK + to encrypt with the remote device directly, else re-pair with the remote device. + Else if the device hasn't been bonded, the stack will use NO MITM authentication request in the current link instead of + using the authreq in the esp_ble_gap_set_security_param function set by the user. */ + ESP_BLE_SEC_ENCRYPT_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has been already + bonded, the stack will check the LTK (Long Term Key) whether the authentication request has been met, and if met, use the LTK + to encrypt with the remote device directly, else re-pair with the remote device. + Else if the device hasn't been bonded, the stack will use MITM authentication request in the current link instead of + using the authreq in the esp_ble_gap_set_security_param function set by the user. */ }esp_ble_sec_act_t; typedef enum { ESP_BLE_SM_PASSKEY = 0, - /* Authentication requirements of local device */ + /*!< Authentication requirements of local device */ ESP_BLE_SM_AUTHEN_REQ_MODE, - /* The IO capability of local device */ + /*!< The IO capability of local device */ ESP_BLE_SM_IOCAP_MODE, - /* Initiator Key Distribution/Generation */ + /*!< Initiator Key Distribution/Generation */ ESP_BLE_SM_SET_INIT_KEY, - /* Responder Key Distribution/Generation */ + /*!< Responder Key Distribution/Generation */ ESP_BLE_SM_SET_RSP_KEY, - /* Maximum Encryption key size to support */ + /*!< Maximum Encryption key size to support */ ESP_BLE_SM_MAX_KEY_SIZE, - /* Minimum Encryption key size requirement from Peer */ + /*!< Minimum Encryption key size requirement from Peer */ ESP_BLE_SM_MIN_KEY_SIZE, - /* Set static Passkey */ + /*!< Set static Passkey */ ESP_BLE_SM_SET_STATIC_PASSKEY, - /* Reset static Passkey */ + /*!< Reset static Passkey */ ESP_BLE_SM_CLEAR_STATIC_PASSKEY, - /* Accept only specified SMP Authentication requirement */ + /*!< Accept only specified SMP Authentication requirement */ ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH, - /* Enable/Disable OOB support */ + /*!< Enable/Disable OOB support */ ESP_BLE_SM_OOB_SUPPORT, - /* Appl encryption key size */ + /*!< Appl encryption key size */ ESP_BLE_APP_ENC_KEY_SIZE, + /*!< authentication max param */ ESP_BLE_SM_MAX_PARAM, } esp_ble_sm_param_t; @@ -681,90 +680,97 @@ typedef uint8_t esp_duplicate_info_t[ESP_BD_ADDR_LEN]; #endif //#if (BLE_42_FEATURE_SUPPORT == TRUE) #if (BLE_50_FEATURE_SUPPORT == TRUE) -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) // Non-Connectable and Non-Scannable Undirected advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) // Connectable advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) // Scannable advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) // Directed advertising -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) // High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertis- ing Interval) -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) // Use legacy advertising PDUs -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) // Omit advertiser's address from all PDUs ("anonymous advertising") -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) // Include TxPower in the extended header of the advertising PDU -#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) // Reserved for future use - -/* If extended advertising PDU types are being used (bit 4 = 0) then: +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) /*!< Non-Connectable and Non-Scannable Undirected advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) /*!< Connectable advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) /*!< Scannable advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) /*!< Directed advertising */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) /*!< High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval) */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) /*!< Use legacy advertising PDUs */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) /*!< Omit advertiser's address from all PDUs ("anonymous advertising") */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) /*!< Include TxPower in the extended header of the advertising PDU */ +#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) /*!< Reserved for future use */ + +/*!< If extended advertising PDU types are being used (bit 4 = 0) then: The advertisement shall not be both connectable and scannable. High duty cycle directed connectable advertising (<= 3.75 ms advertising interval) shall not be used (bit 3 = 0) */ -// ADV_IND +/*!< ADV_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) -// ADV_DIRECT_IND (low duty cycle) +/*!< ADV_DIRECT_IND (low duty cycle) */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_LD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED) -// ADV_DIRECT_IND (high duty cycle) +/*!< ADV_DIRECT_IND (high duty cycle) */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_HD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED) -// ADV_SCAN_IND +/*!< ADV_SCAN_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_SCAN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) -// ADV_NONCONN_IND +/*!< ADV_NONCONN_IND */ #define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_NONCONN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY) typedef uint16_t esp_ble_ext_adv_type_mask_t; -#define ESP_BLE_GAP_PHY_1M 1 -#define ESP_BLE_GAP_PHY_2M 2 -#define ESP_BLE_GAP_PHY_CODED 3 +#define ESP_BLE_GAP_PHY_1M 1 /*!< Secondery Advertisement PHY is LE1M */ +#define ESP_BLE_GAP_PHY_2M 2 /*!< Secondery Advertisement PHY is LE2M */ +#define ESP_BLE_GAP_PHY_CODED 3 /*!< Secondery Advertisement PHY is LE Coded */ typedef uint8_t esp_ble_gap_phy_t; -#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) -#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) +#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) /*!< No Prefer TX PHY supported by controller */ +#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) /*!< No Prefer RX PHY supported by controller */ typedef uint8_t esp_ble_gap_all_phys_t; -// Primary phy only support 1M and LE coded phy -#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M -#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED +/// Primary phy only support 1M and LE coded phy +#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M /*!< Primary Phy is LE1M */ +#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED /*!< Primary Phy is LE CODED */ typedef uint8_t esp_ble_gap_pri_phy_t; // primary phy -#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) -#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) -#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) +#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or reciever PHY */ +#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or reciever PHY */ +#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or reciever PHY */ typedef uint8_t esp_ble_gap_phy_mask_t; -#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 // The Host has no preferred coding when transmitting on the LE Coded PHY -#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 // The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY -#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 // The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY +#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 /*!< The Host has no preferred coding when transmitting on the LE Coded PHY */ +#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 /*!< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY */ +#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 /*!< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY */ typedef uint16_t esp_ble_gap_prefer_phy_options_t; -#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 -#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 +#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 /*!< Scan Advertisements on the LE1M PHY */ +#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 /*!< Scan advertisements on the LE coded PHY */ typedef uint8_t esp_ble_ext_scan_cfg_mask_t; -#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 -#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 -#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 +/// Advertising data +#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 /*!< extended advertising data compete */ +#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 /*!< extended advertising data incomplete */ +#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 /*!< extended advertising data truncated mode */ typedef uint8_t esp_ble_gap_ext_adv_data_status_t; -#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 -#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 +/// Advertising SYNC policy +#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 /*!< sync policy by advertising info */ +#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 /*!< periodic advertising sync policy */ typedef uint8_t esp_ble_gap_sync_t; -/* Advertising report */ -#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) -#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) -#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) -#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) -/* Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */ -#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) -#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) -#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) -#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) +/// Advertising report +#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) /*!< advertising report with extended advertising indication type */ +#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) /*!< advertising report with extended scan indication type */ +#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) /*!< advertising report with extended direct advertising indication type */ +#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) /*!< advertising report with extended scan response indication type */ + +/*!< Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */ +#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) /*!< advertising report with legacy advertising indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) /*!< advertising report with legacy direct indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) /*!< advertising report with legacy scan indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) /*!< advertising report with legacy non connectable indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) /*!< advertising report with legacy scan response indication type */ +#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) /*!< advertising report with legacy advertising with scan response indication type */ + typedef uint8_t esp_ble_gap_adv_type_t; +/// Extend advertising tx power, range: [-127, +126] dBm +#define EXT_ADV_TX_PWR_NO_PREFERENCE (127) /*!< host has no preference for tx power */ + /** * @brief ext adv parameters */ @@ -1762,8 +1768,8 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis * SMP in response to ESP_GAP_BLE_OOB_REQ_EVT * * @param[in] bd_addr: BD address of the peer device. -* @param[in] TK: TK value, the TK value shall be a 128-bit random number -* @param[in] len: length of tk, should always be 128-bit +* @param[in] TK: Temporary Key value, the TK value shall be a 128-bit random number +* @param[in] len: length of temporary key, should always be 128-bit * * @return - ESP_OK : success * - other : failed diff --git a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h index de90ff8efc6..c9278fbed29 100644 --- a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h +++ b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidd_api.h @@ -256,7 +256,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); +typedef void (*esp_hd_cb_t)(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param); /** * @brief This function is called to init callbacks with HID device module. diff --git a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h index 07abdece2d0..cf4a5a8f1e3 100644 --- a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h +++ b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_hidh_api.h @@ -287,7 +287,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); +typedef void (*esp_hh_cb_t)(esp_hidh_cb_event_t event, esp_hidh_cb_param_t *param); /** * @brief This function is called to init callbacks with HID host module. diff --git a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h index 9df1e58a717..be827649745 100644 --- a/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h +++ b/tools/sdk/esp32s3/include/bt/host/bluedroid/api/include/api/esp_spp_api.h @@ -205,7 +205,7 @@ typedef union { * @param event: Event type * @param param: Point to callback parameter, currently is union type */ -typedef void (esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); +typedef void (*esp_spp_cb_t)(esp_spp_cb_event_t event, esp_spp_cb_param_t *param); /** * @brief This function is called to init callbacks with SPP module. diff --git a/tools/sdk/esp32s3/include/bt/include/esp32s3/include/esp_bt.h b/tools/sdk/esp32s3/include/bt/include/esp32s3/include/esp_bt.h index 7bc1f0b6e2a..d0e1a434bff 100644 --- a/tools/sdk/esp32s3/include/bt/include/esp32s3/include/esp_bt.h +++ b/tools/sdk/esp32s3/include/bt/include/esp32s3/include/esp_bt.h @@ -180,7 +180,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .hw_recorrect_en = AGC_RECORRECT_EN, \ .cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \ -}; +} #else #define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h"); @@ -289,23 +289,23 @@ typedef enum { * @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm). */ typedef enum { - ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */ - ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */ - ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */ - ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */ - ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */ - ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */ - ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */ - ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */ - ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */ - ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */ - ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */ - ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */ - ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */ - ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */ - ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */ - ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */ - ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ + ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */ + ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */ + ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */ + ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */ + ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */ + ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */ + ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */ + ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */ + ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */ + ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */ + ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */ + ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */ + ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */ + ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */ + ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */ + ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ } esp_power_level_t; /** diff --git a/tools/sdk/esp32s3/include/driver/esp32s3/include/driver/touch_sensor.h b/tools/sdk/esp32s3/include/driver/esp32s3/include/driver/touch_sensor.h index d90a56e992c..94eb8239e18 100644 --- a/tools/sdk/esp32s3/include/driver/esp32s3/include/driver/touch_sensor.h +++ b/tools/sdk/esp32s3/include/driver/esp32s3/include/driver/touch_sensor.h @@ -39,15 +39,19 @@ esp_err_t touch_pad_sw_start(void); * @brief Set touch sensor times of charge and discharge and sleep time. * Excessive total time will slow down the touch response. * Too small measurement time will not be sampled enough, resulting in inaccurate measurements. - * + * @note Though this API name is same as ESP32, it has opposite logic of capacity. + * The touch sensor on ESP32-S3 will fix the count of charge and discharge cycles (specified by the second parameter) + * and then record the count of the clock cycles(which is 8 MHz) during the sensing period as the raw value. + * That means the raw value will increase as the capacity of the touch pad increasing. * @note The greater the duty cycle of the measurement time, the more system power is consumed. + * * @param sleep_cycle The touch sensor will sleep after each measurement. * sleep_cycle decide the interval between each measurement. * t_sleep = sleep_cycle / (RTC_SLOW_CLK frequency). * The approximate frequency value of RTC_SLOW_CLK can be obtained using rtc_clk_slow_freq_get_hz function. - * @param meas_times The times of charge and discharge in each measure process of touch channels. - * The timer frequency is 8Mhz. Range: 0 ~ 0xffff. - * Recommended typical value: Modify this value to make the measurement time around 1ms. + * @param meas_times The times of charge and discharge in each measurement of touch channels. Range: 0 ~ 0xffff. + * Recommended typical value: Modify this value to make the measurement time around 1 ms. + * The clock frequency is 8 MHz, so the raw value will be about 8000 if the measurement time is 1 ms * @return * - ESP_OK on success */ diff --git a/tools/sdk/esp32s3/include/driver/include/driver/i2s.h b/tools/sdk/esp32s3/include/driver/include/driver/i2s.h index 389b631ba7e..d231ad396bb 100644 --- a/tools/sdk/esp32s3/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32s3/include/driver/include/driver/i2s.h @@ -113,6 +113,7 @@ typedef struct { * We assume that the current 'dma_buf_len' is 100, then the real length of the DMA buffer is 8 * 100 = 800 bytes. * Note that the length of an internal real DMA buffer shouldn't be greater than 4092. */ + bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */ bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */ int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value. If fixed_mclk set, mclk_multiple won't take effect */ diff --git a/tools/sdk/esp32s3/include/efuse/esp32s3/include/esp_efuse_table.h b/tools/sdk/esp32s3/include/efuse/esp32s3/include/esp_efuse_table.h index b81d10f18b8..5fabde2bc5c 100644 --- a/tools/sdk/esp32s3/include/efuse/esp32s3/include/esp_efuse_table.h +++ b/tools/sdk/esp32s3/include/efuse/esp32s3/include/esp_efuse_table.h @@ -9,7 +9,7 @@ extern "C" { #endif -// md5_digest_table 62fa98bed350ebc4951c5f8191c487de +// md5_digest_table 5d853dcd3eb114e78147566245552b2d // This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY. // If you want to change some fields, you need to change esp_efuse_table.csv file // then run `efuse_common_table` or `efuse_custom_table` command it will generate this file. @@ -145,6 +145,11 @@ extern const esp_efuse_desc_t* ESP_EFUSE_KEY3[]; extern const esp_efuse_desc_t* ESP_EFUSE_KEY4[]; extern const esp_efuse_desc_t* ESP_EFUSE_KEY5[]; extern const esp_efuse_desc_t* ESP_EFUSE_SYS_DATA_PART2[]; +extern const esp_efuse_desc_t* ESP_EFUSE_K_RTC_LDO[]; +extern const esp_efuse_desc_t* ESP_EFUSE_K_DIG_LDO[]; +extern const esp_efuse_desc_t* ESP_EFUSE_V_RTC_DBIAS20[]; +extern const esp_efuse_desc_t* ESP_EFUSE_V_DIG_DBIAS20[]; +extern const esp_efuse_desc_t* ESP_EFUSE_DIG_DBIAS_HVT[]; #ifdef __cplusplus } diff --git a/tools/sdk/esp32s3/include/esp-dl/include/dl_define.hpp b/tools/sdk/esp32s3/include/esp-dl/include/dl_define.hpp index 734c0b80a4a..3f285f39206 100644 --- a/tools/sdk/esp32s3/include/esp-dl/include/dl_define.hpp +++ b/tools/sdk/esp32s3/include/esp-dl/include/dl_define.hpp @@ -38,11 +38,6 @@ } #endif -#define DL_Q16_MIN (-32768) -#define DL_Q16_MAX (32767) -#define DL_Q8_MIN (-128) -#define DL_Q8_MAX (127) - #ifndef DL_MAX #define DL_MAX(x, y) (((x) < (y)) ? (y) : (x)) #endif @@ -60,13 +55,24 @@ #endif #ifndef DL_RIGHT_SHIFT -#define DL_RIGHT_SHIFT(x, shift) ((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift)) +#define DL_RIGHT_SHIFT(x, shift) (((shift) > 0) ? ((x) >> (shift)) : ((x) << -(shift))) #endif #ifndef DL_LEFT_SHIFT -#define DL_LEFT_SHIFT(x, shift) ((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift)) +#define DL_LEFT_SHIFT(x, shift) (((shift) > 0) ? ((x) << (shift)) : ((x) >> -(shift))) +#endif + +#ifndef DL_SCALE +#define DL_SCALE(exponent) (((exponent) > 0) ? (1 << (exponent)) : ((float)1.0 / (1 << -(exponent)))) #endif +#ifndef DL_RESCALE +#define DL_RESCALE(exponent) (((exponent) > 0) ? ((float)1.0 / (1 << (exponent))) : (1 << -(exponent))) +#endif + +#define QIQO 0 +#define QIFO 1 + namespace dl { typedef enum @@ -75,9 +81,6 @@ namespace dl ReLU, /**/ LeakyReLU, /**/ PReLU, /**/ - // TODO: Sigmoid, /**/ - // TODO: Softmax, /**/ - PADDING_SAME_BEGIN, /**/ + PADDING_SAME_BEGIN, /**/ PADDING_SAME_END, /**/ } padding_type_t; - + typedef enum { PADDING_EMPTY, PADDING_CONSTANT, - PADDING_EDGE, + PADDING_EDGE, PADDING_REFLECT, PADDING_SYMMETRIC, } padding_mode_t; diff --git a/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_sigmoid.hpp b/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_sigmoid.hpp new file mode 100644 index 00000000000..e8d147d78cd --- /dev/null +++ b/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_sigmoid.hpp @@ -0,0 +1,147 @@ +#pragma once + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Sigmoid(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Sigmoid : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Sigmoid object + * + * @param output_exponent exponent of output + * @param name name of Sigmoid + */ + Sigmoid(const int output_exponent, const char *name = "Sigmoid") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Sigmoid object + * + */ + ~Sigmoid() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Sigmoid result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Sigmoid operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Sigmoid result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + temp = temp / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "sigmoid"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_softmax.hpp b/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_softmax.hpp new file mode 100644 index 00000000000..9e845af00c8 --- /dev/null +++ b/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_softmax.hpp @@ -0,0 +1,175 @@ +#pragma once + +#include +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief Softmax(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class Softmax : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int loop; /**/ + int channel; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new Softmax object + * + * @param output_exponent exponent of output + * @param name name of Softmax + * @param inplace true: the output will store to input + * false: the output will store to a separate memory + */ + Softmax(const int output_exponent, const char *name = "Softmax") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the Softmax object + * + */ + ~Softmax() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent); + + this->channel = input.shape[2]; + this->loop = input.get_size() / this->channel; + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& Softmax result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call Softmax operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return Softmax result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + std::unique_ptr buf(new float[this->channel]); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->loop; i++) + { + I max_input = input_ptr[0]; + for (size_t j = 1; j < this->channel; j++) + max_input = DL_MAX(max_input, input_ptr[j]); + + float summary = 0.0; + for (size_t j = 0; j < this->channel; j++) + { + buf[j] = dl::math::exp_fast(((float)input_ptr[j] - max_input) * this->scale); + // buf[j] = exp(((float)input_ptr[j] - max_input) * this->scale); + summary += buf[j]; + } + + if constexpr (type == QIQO) + { + summary = this->rescale / summary; + for (size_t j = 0; j < this->channel; j++) + dl::tool::truncate(output_ptr[j], buf[j] * summary); + } + else if constexpr (type == QIFO) + { + summary = 1.0 / summary; + for (size_t j = 0; j < this->channel; j++) + output_ptr[j] = buf[j] * summary; + } + + input_ptr += this->channel; + output_ptr += this->channel; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "softmax"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_tanh.hpp b/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_tanh.hpp new file mode 100644 index 00000000000..12eae71e55e --- /dev/null +++ b/tools/sdk/esp32s3/include/esp-dl/include/layer/dl_layer_tanh.hpp @@ -0,0 +1,150 @@ +#pragma once + +#include + +#include "dl_constant.hpp" +#include "dl_variable.hpp" +#include "dl_math.hpp" +#include "dl_layer_base.hpp" + +namespace dl +{ + namespace layer + { + /** + * @brief TanH(input) + * + * @tparam I supports int16_t and int8_t, + * - int16_t: stands for intput in int16_t quantize + * - int8_t: stands for intput in int8_t quantize + * @tparam I supports int16_t, int8_t and float + * - int16_t: stands for output in int16_t quantize + * - int8_t: stands for output in int8_t quantize + * - float: stands for output in float + * @tparam type supports QIQO and QIFO + * - QIQO: stands for both input and output in quantize + * - QIFO: stands for input in quantize and output in floating + * @tparam inplace supports true and false, + * - true: the output will store to input. However, if the type of input and output is different then will not + * - false: the output will store to a separate memory + */ + template + class TanH : public Layer + { + private: + const int output_exponent; /**/ + const float rescale; /**/ + Tensor *output; /**/ + std::vector output_shape; /**/ + int size; /**/ + float scale; /**/ + + public: + /** + * @brief Construct a new TanH object + * + * @param output_exponent exponent of output + * @param name name of TanH + */ + TanH(const int output_exponent, const char *name = "TanH") : Layer(name), + output_exponent(output_exponent), + rescale(DL_RESCALE(output_exponent)), + output(nullptr) {} + + /** + * @brief Destroy the TanH object + * + */ + ~TanH() + { + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + if (this->output != nullptr) + delete this->output; + } + + /** + * @brief Update output shape and exponent + * + * @param input as an input + * @param print_shape whether to print the output shape. + */ + void build(Tensor &input, bool print_shape = false) + { + this->scale = DL_SCALE(input.exponent + 1); + + this->size = input.get_size(); + + this->output_shape = input.shape; + + if constexpr (inplace && type == QIQO && sizeof(I) == sizeof(O)) + { + this->output = &input; + } + else + { + if (this->output == nullptr) + this->output = new Tensor; + this->output->set_shape(this->output_shape); + this->output->free_element(); + } + + if (print_shape) + { + std::cout << this->name << " | "; + this->output->print_shape(); + } + } + + /** + * @brief Get the output + * + * @return Tensor& TanH result + */ + Tensor &get_output() + { + return *this->output; + } + + /** + * @brief Call TanH operation. + * + * @param input as an input + * @param assign_core not effective yet + * @return TanH result + */ + Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) + { + DL_LOG_LAYER_LATENCY_INIT(); + + if constexpr (inplace == false || type == QIFO || sizeof(I) != sizeof(O)) + { + DL_LOG_LAYER_LATENCY_START(); + this->output->malloc_element(); + DL_LOG_LAYER_LATENCY_END(this->name, "apply"); + } + + DL_LOG_LAYER_LATENCY_START(); + I *input_ptr = input.element; + O *output_ptr = this->output->element; + for (size_t i = 0; i < this->size; i++) + { + // float temp = dl::math::exp_fast((float)input_ptr[i] * this->scale); + float temp = exp((float)input_ptr[i] * this->scale); + temp = (temp - 1.0f) / (temp + 1.0f); + + if constexpr (type == QIQO) + dl::tool::truncate(output_ptr[i], temp * this->rescale); + else if constexpr (type == QIFO) + output_ptr[i] = temp; + } + + if (this->output->shape != this->output_shape) + this->output->set_shape(this->output_shape); + this->output->set_exponent(this->output_exponent); + DL_LOG_LAYER_LATENCY_END(this->name, "tanh"); + + return *this->output; + } + }; + } // namespace layer +} // namespace dl diff --git a/tools/sdk/esp32s3/include/esp-dl/include/math/dl_math.hpp b/tools/sdk/esp32s3/include/esp-dl/include/math/dl_math.hpp index d3f2b94d3de..dfe89c89931 100644 --- a/tools/sdk/esp32s3/include/esp-dl/include/math/dl_math.hpp +++ b/tools/sdk/esp32s3/include/esp-dl/include/math/dl_math.hpp @@ -1,6 +1,7 @@ #pragma once #include "dl_define.hpp" +#include "dl_tool.hpp" namespace dl { @@ -8,7 +9,7 @@ namespace dl { /** * @brief x^a. - * + * * @param x as a base * @param a as an exponent * @return x^a @@ -31,7 +32,7 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ @@ -43,7 +44,7 @@ namespace dl /** * @brief 1/sqrt(x). - * + * * @param x as a base * @return 1/sqrt(x) */ @@ -61,15 +62,15 @@ namespace dl /** * @brief sqrt(x). - * + * * @param x as a base * @return sqrt(x) */ inline float sqrt_newton(float x) { /** - * Use Newton iteration method to find the square root - * */ + * Use Newton iteration method to find the square root + * */ if (x == 0.f) return 0.f; float result = x; @@ -84,7 +85,7 @@ namespace dl /** * @brief n-th root of x. - * + * * @param x as a base * @param n root times * @return n-th root of x @@ -112,7 +113,7 @@ namespace dl /** * @brief atan(x). - * + * * @param x as an input * @return atan(x) in range [-pi/2, pi/2] */ @@ -125,10 +126,10 @@ namespace dl // TODO:@yuanjiong /** - * @brief - * + * @brief + * * @param x - * @param y + * @param y * @return in range [-pi, pi] */ inline float atan2(float x, float y) @@ -150,7 +151,7 @@ namespace dl /** * @brief acos(x). - * + * * @param x as an input * @return acos(x) in range [-pi/2, pi/2] */ @@ -161,7 +162,7 @@ namespace dl /** * @brief asin(x). - * + * * @param x as an input * @return asin(x) in range [0, pi] */ @@ -172,12 +173,12 @@ namespace dl /** * @brief e^x - * + * * @param x exponent * @param steps iteration steps * @return e^x */ - inline float exp_fast(double x, int steps) + inline float exp_fast(float x, int steps = 8) { x = 1.0 + x / (1 << steps); for (int i = 0; i < steps; i++) diff --git a/tools/sdk/esp32s3/include/esp-dl/include/tool/dl_tool.hpp b/tools/sdk/esp32s3/include/esp-dl/include/tool/dl_tool.hpp index e5490e073d1..6566e535b85 100644 --- a/tools/sdk/esp32s3/include/esp-dl/include/tool/dl_tool.hpp +++ b/tools/sdk/esp32s3/include/esp-dl/include/tool/dl_tool.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "esp_system.h" @@ -26,7 +27,7 @@ namespace dl { /** * @brief Set memory zero. - * + * * @param ptr pointer of memory * @param n byte number */ @@ -34,8 +35,8 @@ namespace dl /** * @brief Set array value. - * - * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction + * + * @tparam T supports all data type, sizeof(T) equals to 1, 2 and 4 will boost by instruction * @param ptr pointer of array * @param value value to set * @param len length of array @@ -59,7 +60,7 @@ namespace dl /** * @brief Copy memory. - * + * * @param dst pointer of destination * @param src pointer of source * @param n byte number @@ -68,7 +69,7 @@ namespace dl /** * @brief Apply memory without initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -76,7 +77,7 @@ namespace dl */ inline void *malloc_aligned(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); @@ -99,7 +100,7 @@ namespace dl /** * @brief Apply memory with zero-initialized. Can use free_aligned() to free the memory. - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -116,7 +117,7 @@ namespace dl /** * @brief Free the calloc_aligned() and malloc_aligned() memory - * + * * @param address pointer of memory to free */ inline void free_aligned(void *address) @@ -129,7 +130,7 @@ namespace dl /** * @brief Apply memory without initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -137,14 +138,16 @@ namespace dl */ inline void *malloc_aligned_prefer(int number, int size, int align = 4) { - assert((align > 0) && (((align & (align-1)) == 0))); + assert((align > 0) && (((align & (align - 1)) == 0))); int total_size = number * size; void *res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); - if (NULL == res){ + if (NULL == res) + { res = heap_caps_malloc(total_size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); } #if DL_SPIRAM_SUPPORT - if (NULL == res){ + if (NULL == res) + { res = heap_caps_aligned_alloc(align, total_size, MALLOC_CAP_SPIRAM); } #endif @@ -163,7 +166,7 @@ namespace dl /** * @brief Apply memory with zero-initialized in preference order: internal aligned, internal, external aligned - * + * * @param number number of elements * @param size size of element * @param align number of byte aligned, e.g., 16 means 16-byte aligned @@ -179,7 +182,7 @@ namespace dl /** * @brief Free the calloc_aligned_prefer() and malloc_aligned_prefer() memory - * + * * @param address pointer of memory to free */ inline void free_aligned_prefer(void *address) @@ -192,7 +195,7 @@ namespace dl /** * @brief Truncate the input into int8_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -200,17 +203,12 @@ namespace dl template void truncate(int8_t &output, T input) { - if (input >= DL_Q8_MAX) - output = DL_Q8_MAX; - else if (input <= DL_Q8_MIN) - output = DL_Q8_MIN; - else - output = input; + output = DL_CLIP(input, INT8_MIN, INT8_MAX); } /** * @brief Truncate the input into int16_t range. - * + * * @tparam T supports all integer types * @param output as an output * @param input as an input @@ -218,17 +216,24 @@ namespace dl template void truncate(int16_t &output, T input) { - if (input >= DL_Q16_MAX) - output = DL_Q16_MAX; - else if (input <= DL_Q16_MIN) - output = DL_Q16_MIN; - else - output = input; + output = DL_CLIP(input, INT16_MIN, INT16_MAX); + } + + template + void truncate(int32_t &output, T input) + { + output = DL_CLIP(input, INT32_MIN, INT32_MAX); + } + + template + void truncate(int64_t &output, T input) + { + output = DL_CLIP(input, INT64_MIN, INT64_MAX); } /** * @brief Calculate the exponent of quantizing 1/n into max_value range. - * + * * @param n 1/n: value to be quantized * @param max_value the max_range */ @@ -248,7 +253,7 @@ namespace dl /** * @brief Print vector in format "[x1, x2, ...]\n". - * + * * @param array to print */ inline void print_vector(std::vector &array, const char *message = NULL) @@ -266,7 +271,7 @@ namespace dl /** * @brief Get the cycle object - * + * * @return cycle count */ inline uint32_t get_cycle() @@ -293,8 +298,8 @@ namespace dl public: /** * @brief Construct a new Latency object. - * - * @param size + * + * @param size */ Latency(const uint32_t size = 1) : size(size), period(0), @@ -307,7 +312,7 @@ namespace dl /** * @brief Destroy the Latency object. - * + * */ ~Latency() { @@ -317,7 +322,7 @@ namespace dl /** * @brief Record the start timestamp. - * + * */ void start() { @@ -330,7 +335,7 @@ namespace dl /** * @brief Record the period. - * + * */ void end() { @@ -355,7 +360,7 @@ namespace dl /** * @brief Return the period. - * + * * @return this->timestamp_end - this->timestamp */ uint32_t get_period() @@ -365,8 +370,8 @@ namespace dl /** * @brief Get the average period. - * - * @return average latency + * + * @return average latency */ uint32_t get_average_period() { @@ -375,7 +380,7 @@ namespace dl /** * @brief Clear the period - * + * */ void clear_period() { @@ -396,7 +401,7 @@ namespace dl /** * @brief Print in format "{message}: {this->period} {unit}\n". - * + * * @param message message of print */ void print(const char *message) @@ -410,7 +415,7 @@ namespace dl /** * @brief Print in format "{prefix}::{key}: {this->period} {unit}\n". - * + * * @param prefix prefix of print * @param key key of print */ diff --git a/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/dsp_types.h b/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/dsp_types.h index 1f11ea4520b..807608477a9 100644 --- a/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/dsp_types.h +++ b/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/dsp_types.h @@ -2,6 +2,7 @@ #define _dsp_types_H_ #include #include +#include // union to simplify access to the 16 bit data typedef union sc16_u diff --git a/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/esp_dsp.h b/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/esp_dsp.h index 419ed299965..9ce979e9955 100644 --- a/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/esp_dsp.h +++ b/tools/sdk/esp32s3/include/esp-dsp/modules/common/include/esp_dsp.h @@ -22,6 +22,7 @@ extern "C" // Common includes #include "dsp_common.h" +#include "dsp_types.h" // Signal processing #include "dsps_dotprod.h" diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_conv_queue.h b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_conv_queue.h index e0ca0a1d457..890689de391 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_conv_queue.h +++ b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_conv_queue.h @@ -20,7 +20,7 @@ typedef float fptp_t; //Flags for matrices -#define DL_MF_FOREIGNDATA (1<<0) /*< Matrix *item data actually points to another matrix and should not be freed */ +// #define DL_MF_FOREIGNDATA (0) /*< Matrix *item data actually points to another matrix and should not be freed */ //Float convolution FIFO queue. typedef struct { diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_matrix.h b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_matrix.h index d046e2452f7..0a42a57a332 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_matrix.h +++ b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/dl_lib_matrix.h @@ -32,7 +32,7 @@ extern multi_heap_handle_t gst_heap; #endif //Flags for matrices -#define DL_MF_FOREIGNDATA (1<<0) /*< Matrix *item data actually points to another matrix and should not be freed */ +#define DL_MF_FOREIGNDATA (1) /*< Matrix *item data actually points to another matrix and should not be freed */ //'Normal' float matrix typedef struct { diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_config.h b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_config.h index 3bf55f78e18..cf0b06a6cd0 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_config.h +++ b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_config.h @@ -8,6 +8,7 @@ //SR: Speech Recognition //afe_sr/AFE_SR: the audio front-end for speech recognition + //Set AFE_SR mode typedef enum { SR_MODE_LOW_COST = 0, @@ -34,6 +35,26 @@ typedef struct { int sample_rate; // sample rate of audio } afe_pcm_config_t; +/** + * @brief Function to get the debug audio data + * + * @param data The debug audio data which don't be modify. It should be copied away as soon as possible that avoid blocking for too long. + * @param data_size The number of bytes of data. + * @returns + */ +typedef void (*afe_debug_hook_callback_t)(const int16_t* data, int data_size); + +typedef enum { + AFE_DEBUG_HOOK_MASE_TASK_IN = 0, // To get the input data of mase task + AFE_DEBUG_HOOK_FETCH_TASK_IN = 1, // To get the input data of fetch task + AFE_DEBUG_HOOK_MAX = 2 +} afe_debug_hook_type_t; + +typedef struct { + afe_debug_hook_type_t hook_type; // debug type of hook + afe_debug_hook_callback_t hook_callback; // callback function which transfer debug audio data +} afe_debug_hook_t; + typedef struct { bool aec_init; bool se_init; @@ -52,6 +73,8 @@ typedef struct { afe_memory_alloc_mode_t memory_alloc_mode; afe_mn_peak_agc_mode_t agc_mode; // The agc mode for ASR afe_pcm_config_t pcm_config; // Config the channel num of original data which is fed to the afe feed function. + bool debug_init; + afe_debug_hook_t debug_hook[AFE_DEBUG_HOOK_MAX]; } afe_config_t; @@ -77,6 +100,8 @@ typedef struct { .pcm_config.mic_num = 1, \ .pcm_config.ref_num = 1, \ .pcm_config.sample_rate = 16000, \ + .debug_init = false, \ + .debug_hook = {{AFE_DEBUG_HOOK_MASE_TASK_IN, NULL}, {AFE_DEBUG_HOOK_FETCH_TASK_IN, NULL}}, \ } #elif CONFIG_IDF_TARGET_ESP32S3 #define AFE_CONFIG_DEFAULT() { \ @@ -100,5 +125,7 @@ typedef struct { .pcm_config.mic_num = 2, \ .pcm_config.ref_num = 1, \ .pcm_config.sample_rate = 16000, \ + .debug_init = false, \ + .debug_hook = {{AFE_DEBUG_HOOK_MASE_TASK_IN, NULL}, {AFE_DEBUG_HOOK_FETCH_TASK_IN, NULL}}, \ } #endif \ No newline at end of file diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_sr_iface.h b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_sr_iface.h index b513b5cbf7b..b9025e96225 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_sr_iface.h +++ b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_afe_sr_iface.h @@ -25,9 +25,9 @@ typedef struct afe_fetch_result_t { int16_t *data; // the data of audio. int data_size; // the size of data. The unit is byte. - int wakeup_state; // the value is afe_wakeup_state_t + wakenet_state_t wakeup_state; // the value is wakenet_state_t int wake_word_index; // if the wake word is detected. It will store the wake word index which start from 1. - int vad_state; // the value is afe_vad_state_t + afe_vad_state_t vad_state; // the value is afe_vad_state_t int trigger_channel_id; // the channel index of output int wake_word_length; // the length of wake word. It's unit is the number of samples. int ret_value; // the return state of fetch function @@ -101,6 +101,14 @@ typedef int (*esp_afe_sr_iface_op_feed_t)(esp_afe_sr_data_t *afe, const int16_t* */ typedef afe_fetch_result_t* (*esp_afe_sr_iface_op_fetch_t)(esp_afe_sr_data_t *afe); +/** + * @brief reset ringbuf of AFE. + * + * @param afe The AFE_SR object to query + * @return -1: fail, 0: success + */ +typedef int (*esp_afe_sr_iface_op_reset_buffer_t)(esp_afe_sr_data_t *afe); + /** * @brief Initial wakenet and wake words coefficient, or reset wakenet and wake words coefficient * when wakenet has been initialized. @@ -174,6 +182,7 @@ typedef struct { esp_afe_sr_iface_op_create_from_config_t create_from_config; esp_afe_sr_iface_op_feed_t feed; esp_afe_sr_iface_op_fetch_t fetch; + esp_afe_sr_iface_op_reset_buffer_t reset_buffer; esp_afe_sr_iface_op_get_samp_chunksize_t get_feed_chunksize; esp_afe_sr_iface_op_get_samp_chunksize_t get_fetch_chunksize; esp_afe_sr_iface_op_get_total_channel_num_t get_total_channel_num; diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_iface.h b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_iface.h index 63e5a4d4b48..f43f3263e33 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_iface.h +++ b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_iface.h @@ -7,6 +7,10 @@ #define ESP_MN_MAX_PHRASE_LEN 63 #define ESP_MN_MIN_PHRASE_LEN 2 +#define ESP_MN_PREFIX "mn" +#define ESP_MN_ENGLISH "en" +#define ESP_MN_CHINESE "cn" + typedef enum { ESP_MN_STATE_DETECTING = 0, // detecting ESP_MN_STATE_DETECTED = 1, // detected @@ -84,6 +88,14 @@ typedef int (*esp_mn_iface_op_set_det_threshold_t)(model_iface_data_t *model, fl */ typedef int (*esp_mn_iface_op_get_samp_rate_t)(model_iface_data_t *model); +/** + * @brief Get the language of model + * + * @param model The language name + * @return Language name string defined in esp_mn_models.h, eg: ESP_MN_CHINESE, ESP_MN_ENGLISH + */ +typedef char * (*esp_mn_iface_op_get_language_t)(model_iface_data_t *model); + /** * @brief Feed samples of an audio stream to the speech recognition model and detect if there is a speech command found. * @@ -118,6 +130,14 @@ typedef esp_mn_results_t* (*esp_mn_iface_op_get_results_t)(model_iface_data_t *m */ typedef void (*esp_mn_iface_op_open_log_t)(model_iface_data_t *model_data); +/** + * @brief Clean all status of model + * + * @param model_data The model object to query. + * + */ +typedef void (*esp_mn_iface_op_clean_t)(model_iface_data_t *model_data); + /** * @brief Set the speech commands by mn_command_root * @@ -133,9 +153,11 @@ typedef struct { esp_mn_iface_op_get_samp_chunksize_t get_samp_chunksize; esp_mn_iface_op_get_samp_chunknum_t get_samp_chunknum; esp_mn_iface_op_set_det_threshold_t set_det_threshold; + esp_mn_iface_op_get_language_t get_language; esp_mn_iface_op_detect_t detect; esp_mn_iface_op_destroy_t destroy; esp_mn_iface_op_get_results_t get_results; esp_mn_iface_op_open_log_t open_log; + esp_mn_iface_op_clean_t clean; esp_wn_iface_op_set_speech_commands set_speech_commands; } esp_mn_iface_t; diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_models.h b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_models.h index c65e0aabdb5..15d7ddd4ca1 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_models.h +++ b/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_models.h @@ -5,11 +5,6 @@ //a specific phrase or word. - -#define ESP_MN_PREFIX "mn" -#define ESP_MN_ENGLISH "en" -#define ESP_MN_CHINESE "cn" - /** * @brief Get the multinet handle from model name * @@ -29,9 +24,8 @@ char *esp_mn_language_from_name(char *model_name); /* Configure wake word to use based on what's selected in menuconfig. */ -#if defined CONFIG_USE_MULTINET -#if CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION +#ifdef CONFIG_SR_MN_CN_MULTINET2_SINGLE_RECOGNITION #include "multinet2_ch.h" #define MULTINET_COEFF get_coeff_multinet2_ch #define MULTINET_MODEL_NAME "mn2_cn" @@ -41,10 +35,6 @@ char *esp_mn_language_from_name(char *model_name); #define MULTINET_MODEL_NAME "NULL" #endif -#else -#define MULTINET_COEFF "COEFF_NULL" -#define MULTINET_MODEL_NAME "NULL" -#endif /* example diff --git a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_speech_commands.h b/tools/sdk/esp32s3/include/esp-sr/src/include/esp_mn_speech_commands.h similarity index 99% rename from tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_speech_commands.h rename to tools/sdk/esp32s3/include/esp-sr/src/include/esp_mn_speech_commands.h index 2ef3c164578..c7b29274096 100644 --- a/tools/sdk/esp32s3/include/esp-sr/include/esp32s3/esp_mn_speech_commands.h +++ b/tools/sdk/esp32s3/include/esp-sr/src/include/esp_mn_speech_commands.h @@ -117,7 +117,7 @@ esp_mn_phrase_t *esp_mn_commands_get_from_string(const char *phoneme_string); * - NULL Success * - others The list of error phrase which can not be parsed by multinet. */ -esp_mn_error_t *esp_mn_commands_update(const esp_mn_iface_t *multinet, const model_iface_data_t *model_data); +esp_mn_error_t *esp_mn_commands_update(const esp_mn_iface_t *multinet, model_iface_data_t *model_data); /** * @brief Print the MultiNet Speech Commands. diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_process_sdkconfig.h b/tools/sdk/esp32s3/include/esp-sr/src/include/esp_process_sdkconfig.h similarity index 80% rename from tools/sdk/esp32/include/esp-sr/include/esp32/esp_process_sdkconfig.h rename to tools/sdk/esp32s3/include/esp-sr/src/include/esp_process_sdkconfig.h index aca5c50eab4..9743dcad7da 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/esp_process_sdkconfig.h +++ b/tools/sdk/esp32s3/include/esp-sr/src/include/esp_process_sdkconfig.h @@ -20,4 +20,4 @@ void check_chip_config(void); * - ESP_OK Success * - ESP_ERR_INVALID_STATE Fail */ -esp_err_t esp_mn_commands_update_from_sdkconfig(esp_mn_iface_t *multinet, const model_iface_data_t *model_data); +esp_mn_error_t* esp_mn_commands_update_from_sdkconfig(const esp_mn_iface_t *multinet, model_iface_data_t *model_data); diff --git a/tools/sdk/esp32/include/esp-sr/include/esp32/model_path.h b/tools/sdk/esp32s3/include/esp-sr/src/include/model_path.h similarity index 88% rename from tools/sdk/esp32/include/esp-sr/include/esp32/model_path.h rename to tools/sdk/esp32s3/include/esp-sr/src/include/model_path.h index 4900dbb7eda..0c685cdd310 100644 --- a/tools/sdk/esp32/include/esp-sr/include/esp32/model_path.h +++ b/tools/sdk/esp32s3/include/esp-sr/src/include/model_path.h @@ -76,4 +76,19 @@ void srmodel_spiffs_deinit(srmodel_list_t *models); * * @return the base path od srmodel spiffs */ -char *get_model_base_path(void); \ No newline at end of file +char *get_model_base_path(void); + + +#ifdef ESP_PLATFORM +#include "dl_lib_coefgetter_if.h" +/** + * @brief Return model_coeff_getter_t pointer base on model_name + * + * @warning Just support ESP32 to load old wakenet + * + * @param model_name The model name + * + * @return model_coeff_getter_t pointer or NULL + */ +model_coeff_getter_t* srmodel_get_model_coeff(char *model_name); +#endif \ No newline at end of file diff --git a/tools/sdk/esp32s3/include/esp32-camera/driver/include/esp_camera.h b/tools/sdk/esp32s3/include/esp32-camera/driver/include/esp_camera.h index 2025bb403a9..ee84b307baf 100755 --- a/tools/sdk/esp32s3/include/esp32-camera/driver/include/esp_camera.h +++ b/tools/sdk/esp32s3/include/esp32-camera/driver/include/esp_camera.h @@ -18,8 +18,8 @@ .pin_pwdn = PIN_PWDN, .pin_reset = PIN_RESET, .pin_xclk = PIN_XCLK, - .pin_sscb_sda = PIN_SIOD, - .pin_sscb_scl = PIN_SIOC, + .pin_sccb_sda = PIN_SIOD, + .pin_sccb_scl = PIN_SIOC, .pin_d7 = PIN_D7, .pin_d6 = PIN_D6, .pin_d5 = PIN_D5, @@ -112,8 +112,14 @@ typedef struct { int pin_pwdn; /*!< GPIO pin for camera power down line */ int pin_reset; /*!< GPIO pin for camera reset line */ int pin_xclk; /*!< GPIO pin for camera XCLK line */ - int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ - int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ + union { + int pin_sccb_sda; /*!< GPIO pin for camera SDA line */ + int pin_sscb_sda __attribute__((deprecated("please use pin_sccb_sda instead"))); /*!< GPIO pin for camera SDA line (legacy name) */ + }; + union { + int pin_sccb_scl; /*!< GPIO pin for camera SCL line */ + int pin_sscb_scl __attribute__((deprecated("please use pin_sccb_scl instead"))); /*!< GPIO pin for camera SCL line (legacy name) */ + }; int pin_d7; /*!< GPIO pin for camera D7 line */ int pin_d6; /*!< GPIO pin for camera D6 line */ int pin_d5; /*!< GPIO pin for camera D5 line */ @@ -141,6 +147,8 @@ typedef struct { #if CONFIG_CAMERA_CONVERTER_ENABLED camera_conv_mode_t conv_mode; /*!< RGB<->YUV Conversion mode */ #endif + + int sccb_i2c_port; /*!< If pin_sccb_sda is -1, use the already configured I2C bus by number */ } camera_config_t; /** diff --git a/tools/sdk/esp32s3/include/esp32-camera/driver/include/sensor.h b/tools/sdk/esp32s3/include/esp32-camera/driver/include/sensor.h index d5ec7463fd3..6ab12a21aa5 100755 --- a/tools/sdk/esp32s3/include/esp32-camera/driver/include/sensor.h +++ b/tools/sdk/esp32s3/include/esp32-camera/driver/include/sensor.h @@ -30,6 +30,7 @@ typedef enum { BF20A6_PID = 0x20a6, SC101IOT_PID = 0xda4a, SC030IOT_PID = 0x9a46, + SC031GS_PID = 0x0031, } camera_pid_t; typedef enum { @@ -46,6 +47,7 @@ typedef enum { CAMERA_BF20A6, CAMERA_SC101IOT, CAMERA_SC030IOT, + CAMERA_SC031GS, CAMERA_MODEL_MAX, CAMERA_NONE, } camera_model_t; @@ -64,6 +66,7 @@ typedef enum { BF20A6_SCCB_ADDR = 0x6E, SC101IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 SC030IOT_SCCB_ADDR = 0x68,// 0xd0 >> 1 + SC031GS_SCCB_ADDR = 0x30, } camera_sccb_addr_t; typedef enum { @@ -209,7 +212,7 @@ typedef struct _sensor { // Sensor function pointers int (*init_status) (sensor_t *sensor); - int (*reset) (sensor_t *sensor); + int (*reset) (sensor_t *sensor); // Reset the configuration of the sensor, and return ESP_OK if reset is successful int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); int (*set_framesize) (sensor_t *sensor, framesize_t framesize); int (*set_contrast) (sensor_t *sensor, int level); diff --git a/tools/sdk/esp32s3/include/esp_common/include/esp_idf_version.h b/tools/sdk/esp32s3/include/esp_common/include/esp_idf_version.h index ef308895c9d..74dda44cbdc 100644 --- a/tools/sdk/esp32s3/include/esp_common/include/esp_idf_version.h +++ b/tools/sdk/esp32s3/include/esp_common/include/esp_idf_version.h @@ -23,7 +23,7 @@ extern "C" { /** Minor version number (x.X.x) */ #define ESP_IDF_VERSION_MINOR 4 /** Patch version number (x.x.X) */ -#define ESP_IDF_VERSION_PATCH 2 +#define ESP_IDF_VERSION_PATCH 3 /** * Macro to convert IDF version number into an integer diff --git a/tools/sdk/esp32s3/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32s3/include/esp_http_server/include/esp_http_server.h index 1c8b78583ff..1f790b5ff86 100644 --- a/tools/sdk/esp32s3/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32s3/include/esp_http_server/include/esp_http_server.h @@ -40,6 +40,8 @@ initializer that should be kept in sync .global_user_ctx_free_fn = NULL, \ .global_transport_ctx = NULL, \ .global_transport_ctx_free_fn = NULL, \ + .enable_so_linger = false, \ + .linger_timeout = 0, \ .open_fn = NULL, \ .close_fn = NULL, \ .uri_match_fn = NULL \ @@ -185,6 +187,9 @@ typedef struct httpd_config { */ httpd_free_ctx_fn_t global_transport_ctx_free_fn; + bool enable_so_linger; /*!< bool to enable/disable linger */ + int linger_timeout; /*!< linger timeout (in seconds) */ + /** * Custom session opening callback. * diff --git a/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_clk.h b/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_clk.h index 5a4666fdddf..8846f9272d9 100644 --- a/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_clk.h +++ b/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_clk.h @@ -82,6 +82,19 @@ int esp_clk_xtal_freq(void); */ uint64_t esp_clk_rtc_time(void); +/** + * @brief obtain internal critical section used esp_clk implementation. + * + * This is used by the esp_light_sleep_start() to avoid deadlocking when it + * calls esp_clk related API after stalling the other CPU. + */ +void esp_clk_private_lock(void); + +/** + * @brief counterpart of esp_clk_private_lock + */ +void esp_clk_private_unlock(void); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_sleep_internal.h b/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_sleep_internal.h new file mode 100644 index 00000000000..ee0b72953f0 --- /dev/null +++ b/tools/sdk/esp32s3/include/esp_hw_support/include/esp_private/esp_sleep_internal.h @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief Enables the use of ADC and temperature sensor in monitor (ULP) mode + * + * @note This state is kept in RTC memory and will keep its value after a deep sleep wakeup + * + */ +void esp_sleep_enable_adc_tsens_monitor(bool enable); + + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s3/include/esp_hw_support/include/esp_sleep.h b/tools/sdk/esp32s3/include/esp_hw_support/include/esp_sleep.h index 75d2f9726c3..8090fe85211 100644 --- a/tools/sdk/esp32s3/include/esp_hw_support/include/esp_sleep.h +++ b/tools/sdk/esp32s3/include/esp_hw_support/include/esp_sleep.h @@ -69,7 +69,7 @@ typedef enum { ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program - ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only) + ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3) ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only) ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only) ESP_SLEEP_WAKEUP_COCPU, //!< Wakeup caused by COCPU int diff --git a/tools/sdk/esp32s3/include/esp_hw_support/port/esp32s3/rtc_clk_common.h b/tools/sdk/esp32s3/include/esp_hw_support/port/esp32s3/rtc_clk_common.h index 01b3c1cea23..7cd1f2af025 100644 --- a/tools/sdk/esp32s3/include/esp_hw_support/port/esp32s3/rtc_clk_common.h +++ b/tools/sdk/esp32s3/include/esp_hw_support/port/esp32s3/rtc_clk_common.h @@ -19,7 +19,10 @@ #define DPORT_SOC_CLK_SEL_PLL 1 #define DPORT_SOC_CLK_SEL_8M 2 -#define RTC_FAST_CLK_FREQ_8M 8500000 +// On esp32s3, RC_FAST_CLK has a freq of ~17.5MHz +#define SOC_CLK_RC_FAST_FREQ_APPROX 17500000 +// '8M' does not mean the actual freq, it only represents the clock source is RC_FAST_CLK. +#define RTC_FAST_CLK_FREQ_8M SOC_CLK_RC_FAST_FREQ_APPROX #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32s3/include/esp_ipc/include/esp_ipc_isr.h b/tools/sdk/esp32s3/include/esp_ipc/include/esp_ipc_isr.h index 22fa5b10b03..70290ba5618 100644 --- a/tools/sdk/esp32s3/include/esp_ipc/include/esp_ipc_isr.h +++ b/tools/sdk/esp32s3/include/esp_ipc/include/esp_ipc_isr.h @@ -62,6 +62,7 @@ void esp_ipc_isr_asm_call_blocking(esp_ipc_isr_func_t func, void* arg); * - If the stall feature is paused using esp_ipc_isr_stall_pause(), this function will have no effect * * @note This function is not available in single-core mode. + * @note It is the caller's responsibility to avoid deadlocking on spinlocks */ void esp_ipc_isr_stall_other_cpu(void); diff --git a/tools/sdk/esp32s3/include/esp_lcd/include/esp_lcd_panel_io.h b/tools/sdk/esp32s3/include/esp_lcd/include/esp_lcd_panel_io.h index 57f27ac96aa..2f2c613f1a8 100644 --- a/tools/sdk/esp32s3/include/esp_lcd/include/esp_lcd_panel_io.h +++ b/tools/sdk/esp32s3/include/esp_lcd/include/esp_lcd_panel_io.h @@ -47,7 +47,7 @@ esp_err_t esp_lcd_panel_io_rx_param(esp_lcd_panel_io_handle_t io, int lcd_cmd, v * this function will wait until they are finished and the queue is empty before sending the command(s). * * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()` - * @param[in] lcd_cmd The specific LCD command + * @param[in] lcd_cmd The specific LCD command (set to -1 if no command needed - only in SPI and I2C) * @param[in] param Buffer that holds the command specific parameters, set to NULL if no parameter is needed for the command * @param[in] param_size Size of `param` in memory, in bytes, set to zero if no parameter is needed for the command * @return diff --git a/tools/sdk/esp32s3/include/esp_littlefs/include/esp_littlefs.h b/tools/sdk/esp32s3/include/esp_littlefs/include/esp_littlefs.h index 07f35231291..6337f7b17b5 100644 --- a/tools/sdk/esp32s3/include/esp_littlefs/include/esp_littlefs.h +++ b/tools/sdk/esp32s3/include/esp_littlefs/include/esp_littlefs.h @@ -2,22 +2,16 @@ #define ESP_LITTLEFS_H__ #include "esp_err.h" -#include "littlefs/lfs.h" -#include "sdkconfig.h" +#include #ifdef __cplusplus extern "C" { #endif -/** - * @brief Last Modified Time - * - * Use 't' for LITTLEFS_ATTR_MTIME to match example: - * https://github.com/ARMmbed/littlefs/issues/23#issuecomment-482293539 - * And to match other external tools such as: - * https://github.com/earlephilhower/mklittlefs - */ -#define LITTLEFS_ATTR_MTIME ((uint8_t) 't') +#define ESP_LITTLEFS_VERSION_NUMBER "1.5.0" +#define ESP_LITTLEFS_VERSION_MAJOR 1 +#define ESP_LITTLEFS_VERSION_MINOR 5 +#define ESP_LITTLEFS_VERSION_PATCH 0 /** *Configuration structure for esp_vfs_littlefs_register. @@ -88,14 +82,6 @@ esp_err_t esp_littlefs_format(const char* partition_label); */ esp_err_t esp_littlefs_info(const char* partition_label, size_t *total_bytes, size_t *used_bytes); -#if CONFIG_LITTLEFS_HUMAN_READABLE -/** - * @brief converts an enumerated lfs error into a string. - * @param lfs_errno The enumerated littlefs error. - */ -const char * esp_littlefs_errno(enum lfs_error lfs_errno); -#endif - #ifdef __cplusplus } // extern "C" #endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/lfs_config.h b/tools/sdk/esp32s3/include/esp_littlefs/src/lfs_config.h deleted file mode 100644 index 809d2ccc517..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/lfs_config.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_CFG_H -#define LFS_CFG_H - -// System includes -#include -#include -#include -#include -#include "esp_heap_caps.h" - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return heap_caps_malloc(size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h b/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h deleted file mode 100644 index 1a9456c5196..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_filebd.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Block device emulated in a file - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_FILEBD_H -#define LFS_FILEBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_FILEBD_YES_TRACE -#define LFS_FILEBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_FILEBD_TRACE(...) -#endif - -// filebd config (optional) -struct lfs_filebd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; -}; - -// filebd state -typedef struct lfs_filebd { - int fd; - const struct lfs_filebd_config *cfg; -} lfs_filebd_t; - - -// Create a file block device using the geometry in lfs_config -int lfs_filebd_create(const struct lfs_config *cfg, const char *path); -int lfs_filebd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_filebd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_filebd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_filebd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_filebd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_filebd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_filebd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h b/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h deleted file mode 100644 index 3a70bc6e134..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_rambd.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Block device emulated in RAM - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_RAMBD_H -#define LFS_RAMBD_H - -#include "lfs.h" -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_RAMBD_YES_TRACE -#define LFS_RAMBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_RAMBD_TRACE(...) -#endif - -// rambd config (optional) -struct lfs_rambd_config { - // 8-bit erase value to simulate erasing with. -1 indicates no erase - // occurs, which is still a valid block device - int32_t erase_value; - - // Optional statically allocated buffer for the block device. - void *buffer; -}; - -// rambd state -typedef struct lfs_rambd { - uint8_t *buffer; - const struct lfs_rambd_config *cfg; -} lfs_rambd_t; - - -// Create a RAM block device using the geometry in lfs_config -int lfs_rambd_create(const struct lfs_config *cfg); -int lfs_rambd_createcfg(const struct lfs_config *cfg, - const struct lfs_rambd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_rambd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_rambd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_rambd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_rambd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_rambd_sync(const struct lfs_config *cfg); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h b/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h deleted file mode 100644 index 61679e5e026..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/bd/lfs_testbd.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Testing block device, wraps filebd and rambd while providing a bunch - * of hooks for testing littlefs in various conditions. - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_TESTBD_H -#define LFS_TESTBD_H - -#include "lfs.h" -#include "lfs_util.h" -#include "bd/lfs_rambd.h" -#include "bd/lfs_filebd.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Block device specific tracing -#ifdef LFS_TESTBD_YES_TRACE -#define LFS_TESTBD_TRACE(...) LFS_TRACE(__VA_ARGS__) -#else -#define LFS_TESTBD_TRACE(...) -#endif - -// Mode determining how "bad blocks" behave during testing. This simulates -// some real-world circumstances such as progs not sticking (prog-noop), -// a readonly disk (erase-noop), and ECC failures (read-error). -// -// Not that read-noop is not allowed. Read _must_ return a consistent (but -// may be arbitrary) value on every read. -enum lfs_testbd_badblock_behavior { - LFS_TESTBD_BADBLOCK_PROGERROR, - LFS_TESTBD_BADBLOCK_ERASEERROR, - LFS_TESTBD_BADBLOCK_READERROR, - LFS_TESTBD_BADBLOCK_PROGNOOP, - LFS_TESTBD_BADBLOCK_ERASENOOP, -}; - -// Type for measuring wear -typedef uint32_t lfs_testbd_wear_t; -typedef int32_t lfs_testbd_swear_t; - -// testbd config, this is required for testing -struct lfs_testbd_config { - // 8-bit erase value to use for simulating erases. -1 does not simulate - // erases, which can speed up testing by avoiding all the extra block-device - // operations to store the erase value. - int32_t erase_value; - - // Number of erase cycles before a block becomes "bad". The exact behavior - // of bad blocks is controlled by the badblock_mode. - uint32_t erase_cycles; - - // The mode determining how bad blocks fail - uint8_t badblock_behavior; - - // Number of write operations (erase/prog) before forcefully killing - // the program with exit. Simulates power-loss. 0 disables. - uint32_t power_cycles; - - // Optional buffer for RAM block device. - void *buffer; - - // Optional buffer for wear - void *wear_buffer; -}; - -// testbd state -typedef struct lfs_testbd { - union { - struct { - lfs_filebd_t bd; - struct lfs_filebd_config cfg; - } file; - struct { - lfs_rambd_t bd; - struct lfs_rambd_config cfg; - } ram; - } u; - - bool persist; - uint32_t power_cycles; - lfs_testbd_wear_t *wear; - - const struct lfs_testbd_config *cfg; -} lfs_testbd_t; - - -/// Block device API /// - -// Create a test block device using the geometry in lfs_config -// -// Note that filebd is used if a path is provided, if path is NULL -// testbd will use rambd which can be much faster. -int lfs_testbd_create(const struct lfs_config *cfg, const char *path); -int lfs_testbd_createcfg(const struct lfs_config *cfg, const char *path, - const struct lfs_testbd_config *bdcfg); - -// Clean up memory associated with block device -int lfs_testbd_destroy(const struct lfs_config *cfg); - -// Read a block -int lfs_testbd_read(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -// Program a block -// -// The block must have previously been erased. -int lfs_testbd_prog(const struct lfs_config *cfg, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -// Erase a block -// -// A block must be erased before being programmed. The -// state of an erased block is undefined. -int lfs_testbd_erase(const struct lfs_config *cfg, lfs_block_t block); - -// Sync the block device -int lfs_testbd_sync(const struct lfs_config *cfg); - - -/// Additional extended API for driving test features /// - -// Get simulated wear on a given block -lfs_testbd_swear_t lfs_testbd_getwear(const struct lfs_config *cfg, - lfs_block_t block); - -// Manually set simulated wear on a given block -int lfs_testbd_setwear(const struct lfs_config *cfg, - lfs_block_t block, lfs_testbd_wear_t wear); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/lfs.h b/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/lfs.h deleted file mode 100644 index 3fc1e982f1a..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/lfs.h +++ /dev/null @@ -1,701 +0,0 @@ -/* - * The little filesystem - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_H -#define LFS_H - -#include -#include -#include "lfs_util.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/// Version info /// - -// Software library version -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_VERSION 0x00020005 -#define LFS_VERSION_MAJOR (0xffff & (LFS_VERSION >> 16)) -#define LFS_VERSION_MINOR (0xffff & (LFS_VERSION >> 0)) - -// Version of On-disk data structures -// Major (top-nibble), incremented on backwards incompatible changes -// Minor (bottom-nibble), incremented on feature additions -#define LFS_DISK_VERSION 0x00020000 -#define LFS_DISK_VERSION_MAJOR (0xffff & (LFS_DISK_VERSION >> 16)) -#define LFS_DISK_VERSION_MINOR (0xffff & (LFS_DISK_VERSION >> 0)) - - -/// Definitions /// - -// Type definitions -typedef uint32_t lfs_size_t; -typedef uint32_t lfs_off_t; - -typedef int32_t lfs_ssize_t; -typedef int32_t lfs_soff_t; - -typedef uint32_t lfs_block_t; - -// Maximum name size in bytes, may be redefined to reduce the size of the -// info struct. Limited to <= 1022. Stored in superblock and must be -// respected by other littlefs drivers. -#ifndef LFS_NAME_MAX -#define LFS_NAME_MAX 255 -#endif - -// Maximum size of a file in bytes, may be redefined to limit to support other -// drivers. Limited on disk to <= 4294967296. However, above 2147483647 the -// functions lfs_file_seek, lfs_file_size, and lfs_file_tell will return -// incorrect values due to using signed integers. Stored in superblock and -// must be respected by other littlefs drivers. -#ifndef LFS_FILE_MAX -#define LFS_FILE_MAX 2147483647 -#endif - -// Maximum size of custom attributes in bytes, may be redefined, but there is -// no real benefit to using a smaller LFS_ATTR_MAX. Limited to <= 1022. -#ifndef LFS_ATTR_MAX -#define LFS_ATTR_MAX 1022 -#endif - -// Possible error codes, these are negative to allow -// valid positive return values -enum lfs_error { - LFS_ERR_OK = 0, // No error - LFS_ERR_IO = -5, // Error during device operation - LFS_ERR_CORRUPT = -84, // Corrupted - LFS_ERR_NOENT = -2, // No directory entry - LFS_ERR_EXIST = -17, // Entry already exists - LFS_ERR_NOTDIR = -20, // Entry is not a dir - LFS_ERR_ISDIR = -21, // Entry is a dir - LFS_ERR_NOTEMPTY = -39, // Dir is not empty - LFS_ERR_BADF = -9, // Bad file number - LFS_ERR_FBIG = -27, // File too large - LFS_ERR_INVAL = -22, // Invalid parameter - LFS_ERR_NOSPC = -28, // No space left on device - LFS_ERR_NOMEM = -12, // No more memory available - LFS_ERR_NOATTR = -61, // No data/attr available - LFS_ERR_NAMETOOLONG = -36, // File name too long -}; - -// File types -enum lfs_type { - // file types - LFS_TYPE_REG = 0x001, - LFS_TYPE_DIR = 0x002, - - // internally used types - LFS_TYPE_SPLICE = 0x400, - LFS_TYPE_NAME = 0x000, - LFS_TYPE_STRUCT = 0x200, - LFS_TYPE_USERATTR = 0x300, - LFS_TYPE_FROM = 0x100, - LFS_TYPE_TAIL = 0x600, - LFS_TYPE_GLOBALS = 0x700, - LFS_TYPE_CRC = 0x500, - - // internally used type specializations - LFS_TYPE_CREATE = 0x401, - LFS_TYPE_DELETE = 0x4ff, - LFS_TYPE_SUPERBLOCK = 0x0ff, - LFS_TYPE_DIRSTRUCT = 0x200, - LFS_TYPE_CTZSTRUCT = 0x202, - LFS_TYPE_INLINESTRUCT = 0x201, - LFS_TYPE_SOFTTAIL = 0x600, - LFS_TYPE_HARDTAIL = 0x601, - LFS_TYPE_MOVESTATE = 0x7ff, - - // internal chip sources - LFS_FROM_NOOP = 0x000, - LFS_FROM_MOVE = 0x101, - LFS_FROM_USERATTRS = 0x102, -}; - -// File open flags -enum lfs_open_flags { - // open flags - LFS_O_RDONLY = 1, // Open a file as read only -#ifndef LFS_READONLY - LFS_O_WRONLY = 2, // Open a file as write only - LFS_O_RDWR = 3, // Open a file as read and write - LFS_O_CREAT = 0x0100, // Create a file if it does not exist - LFS_O_EXCL = 0x0200, // Fail if a file already exists - LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size - LFS_O_APPEND = 0x0800, // Move to end of file on every write -#endif - - // internally used flags -#ifndef LFS_READONLY - LFS_F_DIRTY = 0x010000, // File does not match storage - LFS_F_WRITING = 0x020000, // File has been written since last flush -#endif - LFS_F_READING = 0x040000, // File has been read since last flush -#ifndef LFS_READONLY - LFS_F_ERRED = 0x080000, // An error occurred during write -#endif - LFS_F_INLINE = 0x100000, // Currently inlined in directory entry -}; - -// File seek flags -enum lfs_whence_flags { - LFS_SEEK_SET = 0, // Seek relative to an absolute position - LFS_SEEK_CUR = 1, // Seek relative to the current file position - LFS_SEEK_END = 2, // Seek relative to the end of the file -}; - - -// Configuration provided during initialization of the littlefs -struct lfs_config { - // Opaque user provided context that can be used to pass - // information to the block device operations - void *context; - - // Read a region in a block. Negative error codes are propagated - // to the user. - int (*read)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - - // Program a region in a block. The block must have previously - // been erased. Negative error codes are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*prog)(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - - // Erase a block. A block must be erased before being programmed. - // The state of an erased block is undefined. Negative error codes - // are propagated to the user. - // May return LFS_ERR_CORRUPT if the block should be considered bad. - int (*erase)(const struct lfs_config *c, lfs_block_t block); - - // Sync the state of the underlying block device. Negative error codes - // are propagated to the user. - int (*sync)(const struct lfs_config *c); - -#ifdef LFS_THREADSAFE - // Lock the underlying block device. Negative error codes - // are propagated to the user. - int (*lock)(const struct lfs_config *c); - - // Unlock the underlying block device. Negative error codes - // are propagated to the user. - int (*unlock)(const struct lfs_config *c); -#endif - - // Minimum size of a block read in bytes. All read operations will be a - // multiple of this value. - lfs_size_t read_size; - - // Minimum size of a block program in bytes. All program operations will be - // a multiple of this value. - lfs_size_t prog_size; - - // Size of an erasable block in bytes. This does not impact ram consumption - // and may be larger than the physical erase size. However, non-inlined - // files take up at minimum one block. Must be a multiple of the read and - // program sizes. - lfs_size_t block_size; - - // Number of erasable blocks on the device. - lfs_size_t block_count; - - // Number of erase cycles before littlefs evicts metadata logs and moves - // the metadata to another block. Suggested values are in the - // range 100-1000, with large values having better performance at the cost - // of less consistent wear distribution. - // - // Set to -1 to disable block-level wear-leveling. - int32_t block_cycles; - - // Size of block caches in bytes. Each cache buffers a portion of a block in - // RAM. The littlefs needs a read cache, a program cache, and one additional - // cache per file. Larger caches can improve performance by storing more - // data and reducing the number of disk accesses. Must be a multiple of the - // read and program sizes, and a factor of the block size. - lfs_size_t cache_size; - - // Size of the lookahead buffer in bytes. A larger lookahead buffer - // increases the number of blocks found during an allocation pass. The - // lookahead buffer is stored as a compact bitmap, so each byte of RAM - // can track 8 blocks. Must be a multiple of 8. - lfs_size_t lookahead_size; - - // Optional statically allocated read buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *read_buffer; - - // Optional statically allocated program buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *prog_buffer; - - // Optional statically allocated lookahead buffer. Must be lookahead_size - // and aligned to a 32-bit boundary. By default lfs_malloc is used to - // allocate this buffer. - void *lookahead_buffer; - - // Optional upper limit on length of file names in bytes. No downside for - // larger names except the size of the info struct which is controlled by - // the LFS_NAME_MAX define. Defaults to LFS_NAME_MAX when zero. Stored in - // superblock and must be respected by other littlefs drivers. - lfs_size_t name_max; - - // Optional upper limit on files in bytes. No downside for larger files - // but must be <= LFS_FILE_MAX. Defaults to LFS_FILE_MAX when zero. Stored - // in superblock and must be respected by other littlefs drivers. - lfs_size_t file_max; - - // Optional upper limit on custom attributes in bytes. No downside for - // larger attributes size but must be <= LFS_ATTR_MAX. Defaults to - // LFS_ATTR_MAX when zero. - lfs_size_t attr_max; - - // Optional upper limit on total space given to metadata pairs in bytes. On - // devices with large blocks (e.g. 128kB) setting this to a low size (2-8kB) - // can help bound the metadata compaction time. Must be <= block_size. - // Defaults to block_size when zero. - lfs_size_t metadata_max; -}; - -// File info structure -struct lfs_info { - // Type of the file, either LFS_TYPE_REG or LFS_TYPE_DIR - uint8_t type; - - // Size of the file, only valid for REG files. Limited to 32-bits. - lfs_size_t size; - - // Name of the file stored as a null-terminated string. Limited to - // LFS_NAME_MAX+1, which can be changed by redefining LFS_NAME_MAX to - // reduce RAM. LFS_NAME_MAX is stored in superblock and must be - // respected by other littlefs drivers. - char name[LFS_NAME_MAX+1]; -}; - -// Custom attribute structure, used to describe custom attributes -// committed atomically during file writes. -struct lfs_attr { - // 8-bit type of attribute, provided by user and used to - // identify the attribute - uint8_t type; - - // Pointer to buffer containing the attribute - void *buffer; - - // Size of attribute in bytes, limited to LFS_ATTR_MAX - lfs_size_t size; -}; - -// Optional configuration provided during lfs_file_opencfg -struct lfs_file_config { - // Optional statically allocated file buffer. Must be cache_size. - // By default lfs_malloc is used to allocate this buffer. - void *buffer; - - // Optional list of custom attributes related to the file. If the file - // is opened with read access, these attributes will be read from disk - // during the open call. If the file is opened with write access, the - // attributes will be written to disk every file sync or close. This - // write occurs atomically with update to the file's contents. - // - // Custom attributes are uniquely identified by an 8-bit type and limited - // to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller - // than the buffer, it will be padded with zeros. If the stored attribute - // is larger, then it will be silently truncated. If the attribute is not - // found, it will be created implicitly. - struct lfs_attr *attrs; - - // Number of custom attributes in the list - lfs_size_t attr_count; -}; - - -/// internal littlefs data structures /// -typedef struct lfs_cache { - lfs_block_t block; - lfs_off_t off; - lfs_size_t size; - uint8_t *buffer; -} lfs_cache_t; - -typedef struct lfs_mdir { - lfs_block_t pair[2]; - uint32_t rev; - lfs_off_t off; - uint32_t etag; - uint16_t count; - bool erased; - bool split; - lfs_block_t tail[2]; -} lfs_mdir_t; - -// littlefs directory type -typedef struct lfs_dir { - struct lfs_dir *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - lfs_off_t pos; - lfs_block_t head[2]; -} lfs_dir_t; - -// littlefs file type -typedef struct lfs_file { - struct lfs_file *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - - struct lfs_ctz { - lfs_block_t head; - lfs_size_t size; - } ctz; - - uint32_t flags; - lfs_off_t pos; - lfs_block_t block; - lfs_off_t off; - lfs_cache_t cache; - - const struct lfs_file_config *cfg; -} lfs_file_t; - -typedef struct lfs_superblock { - uint32_t version; - lfs_size_t block_size; - lfs_size_t block_count; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; -} lfs_superblock_t; - -typedef struct lfs_gstate { - uint32_t tag; - lfs_block_t pair[2]; -} lfs_gstate_t; - -// The littlefs filesystem type -typedef struct lfs { - lfs_cache_t rcache; - lfs_cache_t pcache; - - lfs_block_t root[2]; - struct lfs_mlist { - struct lfs_mlist *next; - uint16_t id; - uint8_t type; - lfs_mdir_t m; - } *mlist; - uint32_t seed; - - lfs_gstate_t gstate; - lfs_gstate_t gdisk; - lfs_gstate_t gdelta; - - struct lfs_free { - lfs_block_t off; - lfs_block_t size; - lfs_block_t i; - lfs_block_t ack; - uint32_t *buffer; - } free; - - const struct lfs_config *cfg; - lfs_size_t name_max; - lfs_size_t file_max; - lfs_size_t attr_max; - -#ifdef LFS_MIGRATE - struct lfs1 *lfs1; -#endif -} lfs_t; - - -/// Filesystem functions /// - -#ifndef LFS_READONLY -// Format a block device with the littlefs -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_format(lfs_t *lfs, const struct lfs_config *config); -#endif - -// Mounts a littlefs -// -// Requires a littlefs object and config struct. Multiple filesystems -// may be mounted simultaneously with multiple littlefs objects. Both -// lfs and config must be allocated while mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_mount(lfs_t *lfs, const struct lfs_config *config); - -// Unmounts a littlefs -// -// Does nothing besides releasing any allocated resources. -// Returns a negative error code on failure. -int lfs_unmount(lfs_t *lfs); - -/// General operations /// - -#ifndef LFS_READONLY -// Removes a file or directory -// -// If removing a directory, the directory must be empty. -// Returns a negative error code on failure. -int lfs_remove(lfs_t *lfs, const char *path); -#endif - -#ifndef LFS_READONLY -// Rename or move a file or directory -// -// If the destination exists, it must match the source in type. -// If the destination is a directory, the directory must be empty. -// -// Returns a negative error code on failure. -int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath); -#endif - -// Find info about a file or directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a negative error code on failure. -int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info); - -// Get a custom attribute -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. When read, if the stored attribute is smaller than -// the buffer, it will be padded with zeros. If the stored attribute is larger, -// then it will be silently truncated. If no attribute is found, the error -// LFS_ERR_NOATTR is returned and the buffer is filled with zeros. -// -// Returns the size of the attribute, or a negative error code on failure. -// Note, the returned size is the size of the attribute on disk, irrespective -// of the size of the buffer. This can be used to dynamically allocate a buffer -// or check for existence. -lfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path, - uint8_t type, void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Set custom attributes -// -// Custom attributes are uniquely identified by an 8-bit type and limited -// to LFS_ATTR_MAX bytes. If an attribute is not found, it will be -// implicitly created. -// -// Returns a negative error code on failure. -int lfs_setattr(lfs_t *lfs, const char *path, - uint8_t type, const void *buffer, lfs_size_t size); -#endif - -#ifndef LFS_READONLY -// Removes a custom attribute -// -// If an attribute is not found, nothing happens. -// -// Returns a negative error code on failure. -int lfs_removeattr(lfs_t *lfs, const char *path, uint8_t type); -#endif - - -/// File operations /// - -#ifndef LFS_NO_MALLOC -// Open a file -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// Returns a negative error code on failure. -int lfs_file_open(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags); - -// if LFS_NO_MALLOC is defined, lfs_file_open() will fail with LFS_ERR_NOMEM -// thus use lfs_file_opencfg() with config.buffer set. -#endif - -// Open a file with extra configuration -// -// The mode that the file is opened in is determined by the flags, which -// are values from the enum lfs_open_flags that are bitwise-ored together. -// -// The config struct provides additional config options per file as described -// above. The config struct must be allocated while the file is open, and the -// config struct must be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file, - const char *path, int flags, - const struct lfs_file_config *config); - -// Close a file -// -// Any pending writes are written out to storage as though -// sync had been called and releases any allocated resources. -// -// Returns a negative error code on failure. -int lfs_file_close(lfs_t *lfs, lfs_file_t *file); - -// Synchronize a file on storage -// -// Any pending writes are written out to storage. -// Returns a negative error code on failure. -int lfs_file_sync(lfs_t *lfs, lfs_file_t *file); - -// Read data from file -// -// Takes a buffer and size indicating where to store the read data. -// Returns the number of bytes read, or a negative error code on failure. -lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file, - void *buffer, lfs_size_t size); - -#ifndef LFS_READONLY -// Write data to file -// -// Takes a buffer and size indicating the data to write. The file will not -// actually be updated on the storage until either sync or close is called. -// -// Returns the number of bytes written, or a negative error code on failure. -lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file, - const void *buffer, lfs_size_t size); -#endif - -// Change the position of the file -// -// The change in position is determined by the offset and whence flag. -// Returns the new position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file, - lfs_soff_t off, int whence); - -#ifndef LFS_READONLY -// Truncates the size of the file to the specified size -// -// Returns a negative error code on failure. -int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size); -#endif - -// Return the position of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR) -// Returns the position of the file, or a negative error code on failure. -lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file); - -// Change the position of the file to the beginning of the file -// -// Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_SET) -// Returns a negative error code on failure. -int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file); - -// Return the size of the file -// -// Similar to lfs_file_seek(lfs, file, 0, LFS_SEEK_END) -// Returns the size of the file, or a negative error code on failure. -lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file); - - -/// Directory operations /// - -#ifndef LFS_READONLY -// Create a directory -// -// Returns a negative error code on failure. -int lfs_mkdir(lfs_t *lfs, const char *path); -#endif - -// Open a directory -// -// Once open a directory can be used with read to iterate over files. -// Returns a negative error code on failure. -int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path); - -// Close a directory -// -// Releases any allocated resources. -// Returns a negative error code on failure. -int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir); - -// Read an entry in the directory -// -// Fills out the info structure, based on the specified file or directory. -// Returns a positive value on success, 0 at the end of directory, -// or a negative error code on failure. -int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info); - -// Change the position of the directory -// -// The new off must be a value previous returned from tell and specifies -// an absolute offset in the directory seek. -// -// Returns a negative error code on failure. -int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off); - -// Return the position of the directory -// -// The returned offset is only meant to be consumed by seek and may not make -// sense, but does indicate the current position in the directory iteration. -// -// Returns the position of the directory, or a negative error code on failure. -lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir); - -// Change the position of the directory to the beginning of the directory -// -// Returns a negative error code on failure. -int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir); - - -/// Filesystem-level filesystem operations - -// Finds the current size of the filesystem -// -// Note: Result is best effort. If files share COW structures, the returned -// size may be larger than the filesystem actually is. -// -// Returns the number of allocated blocks, or a negative error code on failure. -lfs_ssize_t lfs_fs_size(lfs_t *lfs); - -// Traverse through all blocks in use by the filesystem -// -// The provided callback will be called with each block address that is -// currently in use by the filesystem. This can be used to determine which -// blocks are in use or how much of the storage is available. -// -// Returns a negative error code on failure. -int lfs_fs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data); - -#ifndef LFS_READONLY -#ifdef LFS_MIGRATE -// Attempts to migrate a previous version of littlefs -// -// Behaves similarly to the lfs_format function. Attempts to mount -// the previous version of littlefs and update the filesystem so it can be -// mounted with the current version of littlefs. -// -// Requires a littlefs object and config struct. This clobbers the littlefs -// object, and does not leave the filesystem mounted. The config struct must -// be zeroed for defaults and backwards compatibility. -// -// Returns a negative error code on failure. -int lfs_migrate(lfs_t *lfs, const struct lfs_config *cfg); -#endif -#endif - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/lfs_util.h b/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/lfs_util.h deleted file mode 100644 index 0cbc2a31995..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs/lfs_util.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * lfs utility functions - * - * Copyright (c) 2022, The littlefs authors. - * Copyright (c) 2017, Arm Limited. All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef LFS_UTIL_H -#define LFS_UTIL_H - -// Users can override lfs_util.h with their own configuration by defining -// LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h). -// -// If LFS_CONFIG is used, none of the default utils will be emitted and must be -// provided by the config file. To start, I would suggest copying lfs_util.h -// and modifying as needed. -#ifdef LFS_CONFIG -#define LFS_STRINGIZE(x) LFS_STRINGIZE2(x) -#define LFS_STRINGIZE2(x) #x -#include LFS_STRINGIZE(LFS_CONFIG) -#else - -// System includes -#include -#include -#include -#include - -#ifndef LFS_NO_MALLOC -#include -#endif -#ifndef LFS_NO_ASSERT -#include -#endif -#if !defined(LFS_NO_DEBUG) || \ - !defined(LFS_NO_WARN) || \ - !defined(LFS_NO_ERROR) || \ - defined(LFS_YES_TRACE) -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// Macros, may be replaced by system specific wrappers. Arguments to these -// macros must not have side-effects as the macros can be removed for a smaller -// code footprint - -// Logging functions -#ifndef LFS_TRACE -#ifdef LFS_YES_TRACE -#define LFS_TRACE_(fmt, ...) \ - printf("%s:%d:trace: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_TRACE(...) LFS_TRACE_(__VA_ARGS__, "") -#else -#define LFS_TRACE(...) -#endif -#endif - -#ifndef LFS_DEBUG -#ifndef LFS_NO_DEBUG -#define LFS_DEBUG_(fmt, ...) \ - printf("%s:%d:debug: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "") -#else -#define LFS_DEBUG(...) -#endif -#endif - -#ifndef LFS_WARN -#ifndef LFS_NO_WARN -#define LFS_WARN_(fmt, ...) \ - printf("%s:%d:warn: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_WARN(...) LFS_WARN_(__VA_ARGS__, "") -#else -#define LFS_WARN(...) -#endif -#endif - -#ifndef LFS_ERROR -#ifndef LFS_NO_ERROR -#define LFS_ERROR_(fmt, ...) \ - printf("%s:%d:error: " fmt "%s\n", __FILE__, __LINE__, __VA_ARGS__) -#define LFS_ERROR(...) LFS_ERROR_(__VA_ARGS__, "") -#else -#define LFS_ERROR(...) -#endif -#endif - -// Runtime assertions -#ifndef LFS_ASSERT -#ifndef LFS_NO_ASSERT -#define LFS_ASSERT(test) assert(test) -#else -#define LFS_ASSERT(test) -#endif -#endif - - -// Builtin functions, these may be replaced by more efficient -// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more -// expensive basic C implementation for debugging purposes - -// Min/max functions for unsigned 32-bit numbers -static inline uint32_t lfs_max(uint32_t a, uint32_t b) { - return (a > b) ? a : b; -} - -static inline uint32_t lfs_min(uint32_t a, uint32_t b) { - return (a < b) ? a : b; -} - -// Align to nearest multiple of a size -static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) { - return a - (a % alignment); -} - -static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) { - return lfs_aligndown(a + alignment-1, alignment); -} - -// Find the smallest power of 2 greater than or equal to a -static inline uint32_t lfs_npw2(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return 32 - __builtin_clz(a-1); -#else - uint32_t r = 0; - uint32_t s; - a -= 1; - s = (a > 0xffff) << 4; a >>= s; r |= s; - s = (a > 0xff ) << 3; a >>= s; r |= s; - s = (a > 0xf ) << 2; a >>= s; r |= s; - s = (a > 0x3 ) << 1; a >>= s; r |= s; - return (r | (a >> 1)) + 1; -#endif -} - -// Count the number of trailing binary zeros in a -// lfs_ctz(0) may be undefined -static inline uint32_t lfs_ctz(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__) - return __builtin_ctz(a); -#else - return lfs_npw2((a & -a) + 1) - 1; -#endif -} - -// Count the number of binary ones in a -static inline uint32_t lfs_popc(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM)) - return __builtin_popcount(a); -#else - a = a - ((a >> 1) & 0x55555555); - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); - return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24; -#endif -} - -// Find the sequence comparison of a and b, this is the distance -// between a and b ignoring overflow -static inline int lfs_scmp(uint32_t a, uint32_t b) { - return (int)(unsigned)(a - b); -} - -// Convert between 32-bit little-endian and native order -static inline uint32_t lfs_fromle32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return a; -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return __builtin_bswap32(a); -#else - return (((uint8_t*)&a)[0] << 0) | - (((uint8_t*)&a)[1] << 8) | - (((uint8_t*)&a)[2] << 16) | - (((uint8_t*)&a)[3] << 24); -#endif -} - -static inline uint32_t lfs_tole32(uint32_t a) { - return lfs_fromle32(a); -} - -// Convert between 32-bit big-endian and native order -static inline uint32_t lfs_frombe32(uint32_t a) { -#if !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) - return __builtin_bswap32(a); -#elif !defined(LFS_NO_INTRINSICS) && ( \ - (defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) - return a; -#else - return (((uint8_t*)&a)[0] << 24) | - (((uint8_t*)&a)[1] << 16) | - (((uint8_t*)&a)[2] << 8) | - (((uint8_t*)&a)[3] << 0); -#endif -} - -static inline uint32_t lfs_tobe32(uint32_t a) { - return lfs_frombe32(a); -} - -// Calculate CRC-32 with polynomial = 0x04c11db7 -uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size); - -// Allocate memory, only used if buffers are not provided to littlefs -// Note, memory must be 64-bit aligned -static inline void *lfs_malloc(size_t size) { -#ifndef LFS_NO_MALLOC - return malloc(size); -#else - (void)size; - return NULL; -#endif -} - -// Deallocate memory, only used if buffers are not provided to littlefs -static inline void lfs_free(void *p) { -#ifndef LFS_NO_MALLOC - free(p); -#else - (void)p; -#endif -} - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif -#endif diff --git a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs_api.h b/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs_api.h deleted file mode 100644 index 135b05972d0..00000000000 --- a/tools/sdk/esp32s3/include/esp_littlefs/src/littlefs_api.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ESP_LITTLEFS_API_H__ -#define ESP_LITTLEFS_API_H__ - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp_vfs.h" -#include "esp_partition.h" -#include "littlefs/lfs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief a file descriptor - * That's also a singly linked list used for keeping tracks of all opened file descriptor - * - * Shortcomings/potential issues of 32-bit hash (when CONFIG_LITTLEFS_USE_ONLY_HASH) listed here: - * * unlink - If a different file is open that generates a hash collision, it will report an - * error that it cannot unlink an open file. - * * rename - If a different file is open that generates a hash collision with - * src or dst, it will report an error that it cannot rename an open file. - * Potential consequences: - * 1. A file cannot be deleted while a collision-geneating file is open. - * Worst-case, if the other file is always open during the lifecycle - * of your app, it's collision file cannot be deleted, which in the - * worst-case could cause storage-capacity issues. - * 2. Same as (1), but for renames - */ -typedef struct _vfs_littlefs_file_t { - lfs_file_t file; - uint32_t hash; - struct _vfs_littlefs_file_t * next; /*!< Pointer to next file in Singly Linked List */ -#ifndef CONFIG_LITTLEFS_USE_ONLY_HASH - char * path; -#endif -} vfs_littlefs_file_t; - -/** - * @brief littlefs definition structure - */ -typedef struct { - lfs_t *fs; /*!< Handle to the underlying littlefs */ - SemaphoreHandle_t lock; /*!< FS lock */ - const esp_partition_t* partition; /*!< The partition on which littlefs is located */ - char base_path[ESP_VFS_PATH_MAX+1]; /*!< Mount point */ - - struct lfs_config cfg; /*!< littlefs Mount configuration */ - - vfs_littlefs_file_t *file; /*!< Singly Linked List of files */ - - vfs_littlefs_file_t **cache; /*!< A cache of pointers to the opened files */ - uint16_t cache_size; /*!< The cache allocated size (in pointers) */ - uint16_t fd_count; /*!< The count of opened file descriptor used to speed up computation */ -} esp_littlefs_t; - -/** - * @brief Read a region in a block. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_read(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, void *buffer, lfs_size_t size); - -/** - * @brief Program a region in a block. - * - * The block must have previously been erased. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_prog(const struct lfs_config *c, lfs_block_t block, - lfs_off_t off, const void *buffer, lfs_size_t size); - -/** - * @brief Erase a block. - * - * A block must be erased before being programmed. - * The state of an erased block is undefined. - * Negative error codes are propogated to the user. - * May return LFS_ERR_CORRUPT if the block should be considered bad. - * @return errorcode. 0 on success. - */ -int littlefs_api_erase(const struct lfs_config *c, lfs_block_t block); - -/** - * @brief Sync the state of the underlying block device. - * - * Negative error codes are propogated to the user. - * - * @return errorcode. 0 on success. - */ -int littlefs_api_sync(const struct lfs_config *c); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/esp32s3/include/esp_rainmaker/include/esp_rmaker_ota.h b/tools/sdk/esp32s3/include/esp_rainmaker/include/esp_rmaker_ota.h index 6dc7962177e..c5483a8afbd 100644 --- a/tools/sdk/esp32s3/include/esp_rainmaker/include/esp_rmaker_ota.h +++ b/tools/sdk/esp32s3/include/esp_rainmaker/include/esp_rmaker_ota.h @@ -21,6 +21,31 @@ extern "C" { #endif +/** @cond **/ +/** ESP RainMaker Event Base */ +ESP_EVENT_DECLARE_BASE(RMAKER_OTA_EVENT); +/** @endcond **/ + +/** ESP RainMaker Events */ +typedef enum { + /* Invalid event. Used for internal handling only */ + RMAKER_OTA_EVENT_INVALID = 0, + /** RainMaker OTA is Starting */ + RMAKER_OTA_EVENT_STARTING, + /** RainMaker OTA has Started */ + RMAKER_OTA_EVENT_IN_PROGRESS, + /** RainMaker OTA Successful */ + RMAKER_OTA_EVENT_SUCCESSFUL, + /** RainMaker OTA Failed */ + RMAKER_OTA_EVENT_FAILED, + /** RainMaker OTA Rejected */ + RMAKER_OTA_EVENT_REJECTED, + /** RainMaker OTA Delayed */ + RMAKER_OTA_EVENT_DELAYED, + /** OTA Image has been flashed and active partition changed. Reboot is requested. Applicable only if Auto reboot is disabled **/ + RMAKER_OTA_EVENT_REQ_FOR_REBOOT, +} esp_rmaker_ota_event_t; + /** Default ESP RainMaker OTA Server Certificate */ extern const char *ESP_RMAKER_OTA_DEFAULT_SERVER_CERT; @@ -56,10 +81,16 @@ typedef struct { /** Size of the OTA File. Can be 0 if the file size isn't received from * the ESP RainMaker Cloud */ int filesize; + /** The firmware version of the OTA image **/ + char *fw_version; + /** The OTA Job ID received from cloud **/ + char *ota_job_id; /** The server certificate passed in esp_rmaker_enable_ota() */ const char *server_cert; /** The private data passed in esp_rmaker_enable_ota() */ char *priv; + /** OTA Metadata. Applicable only for OTA using Topics. Will be received (if applicable) from the backend, alongwith the OTA URL */ + char *metadata; } esp_rmaker_ota_data_t; /** Function prototype for OTA Callback @@ -170,6 +201,18 @@ esp_err_t esp_rmaker_ota_default_cb(esp_rmaker_ota_handle_t handle, esp_rmaker_o * @return error on failure */ esp_err_t esp_rmaker_ota_fetch(void); + +/** Fetch OTA Info with a delay + * + * For OTA using Topics, this API can be used to explicitly ask the backend if an OTA is available + * after a delay (in seconds) passed as an argument. + * + * @param[in] time Delay (in seconds) + * + * @return ESP_OK if the OTA fetch timer was created. + * @return error on failure + */ +esp_err_t esp_rmaker_ota_fetch_with_delay(int time); #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/esp_rom/esp32s3/esp_rom_caps.h b/tools/sdk/esp32s3/include/esp_rom/esp32s3/esp_rom_caps.h index 5955f2c371e..65847c4064f 100644 --- a/tools/sdk/esp32s3/include/esp_rom/esp32s3/esp_rom_caps.h +++ b/tools/sdk/esp32s3/include/esp_rom/esp32s3/esp_rom_caps.h @@ -22,3 +22,4 @@ #define ESP_ROM_HAS_RETARGETABLE_LOCKING (1) // ROM was built with retargetable locking #define ESP_ROM_USB_SERIAL_DEVICE_NUM (4) // The serial port ID (UART, USB, ...) of USB_SERIAL_JTAG in the ROM. #define ESP_ROM_HAS_ERASE_0_REGION_BUG (1) // ROM has esp_flash_erase_region(size=0) bug +#define ESP_ROM_NEEDS_SWSETUP_WORKAROUND (1) // ROM uses 32-bit time_t. A workaround is required to prevent printf functions from crashing diff --git a/tools/sdk/esp32s3/include/esp_rom/include/esp32/rom/miniz.h b/tools/sdk/esp32s3/include/esp_rom/include/esp32/rom/miniz.h index 7661f804468..5fefa84999a 100644 --- a/tools/sdk/esp32s3/include/esp_rom/include/esp32/rom/miniz.h +++ b/tools/sdk/esp32s3/include/esp_rom/include/esp32/rom/miniz.h @@ -760,7 +760,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s3/include/esp_rom/include/esp32c3/rom/miniz.h b/tools/sdk/esp32s3/include/esp_rom/include/esp32c3/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32s3/include/esp_rom/include/esp32c3/rom/miniz.h +++ b/tools/sdk/esp32s3/include/esp_rom/include/esp32c3/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s3/include/esp_rom/include/esp32h2/rom/miniz.h b/tools/sdk/esp32s3/include/esp_rom/include/esp32h2/rom/miniz.h index 4c8cb7a421d..aaef48c14af 100644 --- a/tools/sdk/esp32s3/include/esp_rom/include/esp32h2/rom/miniz.h +++ b/tools/sdk/esp32s3/include/esp_rom/include/esp32h2/rom/miniz.h @@ -729,7 +729,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s3/include/esp_rom/include/esp32s2/rom/miniz.h b/tools/sdk/esp32s3/include/esp_rom/include/esp32s2/rom/miniz.h index b9b9202aaa7..fd2fe3c9a19 100644 --- a/tools/sdk/esp32s3/include/esp_rom/include/esp32s2/rom/miniz.h +++ b/tools/sdk/esp32s3/include/esp_rom/include/esp32s2/rom/miniz.h @@ -745,7 +745,7 @@ typedef struct // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s3/include/esp_rom/include/esp32s3/rom/miniz.h b/tools/sdk/esp32s3/include/esp_rom/include/esp32s3/rom/miniz.h index 7553511349e..f095b539b9b 100644 --- a/tools/sdk/esp32s3/include/esp_rom/include/esp32s3/rom/miniz.h +++ b/tools/sdk/esp32s3/include/esp_rom/include/esp32s3/rom/miniz.h @@ -728,7 +728,7 @@ typedef struct { // Initializes the compressor. // There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. -// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// pBut_buf_func: If **not** NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. // If pBut_buf_func is NULL the user should always call the tdefl_compress() API. // flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); diff --git a/tools/sdk/esp32s3/include/esp_rom/include/esp_rom_efuse.h b/tools/sdk/esp32s3/include/esp_rom/include/esp_rom_efuse.h index 907e175ecad..6280a1e5b60 100644 --- a/tools/sdk/esp32s3/include/esp_rom/include/esp_rom_efuse.h +++ b/tools/sdk/esp32s3/include/esp_rom/include/esp_rom_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -20,6 +12,7 @@ extern "C" { #include #include +#include "soc/soc_caps.h" #define ESP_ROM_EFUSE_FLASH_DEFAULT_SPI (0) #define ESP_ROM_EFUSE_FLASH_DEFAULT_HSPI (1) @@ -56,6 +49,18 @@ uint32_t esp_rom_efuse_get_flash_gpio_info(void); */ uint32_t esp_rom_efuse_get_flash_wp_gpio(void); +#if SOC_SPI_MEM_SUPPORT_OPI_MODE +/** + * @brief Read opi flash pads configuration from Efuse + * + * @return + * - 0 for default SPI pins. + * - Other values define a custom pin configuration mask. From the LSB, every 6 bits represent a GPIO number which stand for: + * DQS, D4, D5, D6, D7 accordingly. + */ +uint32_t esp_rom_efuse_get_opiconfig(void); +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE + /** * @brief Read eFuse to check whether secure boot has been enabled or not * diff --git a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h b/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32c3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h b/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32h2_defs.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h b/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h deleted file mode 100644 index 49ba82ddf00..00000000000 --- a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32s2_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 72 diff --git a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h b/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h deleted file mode 100644 index 3dfd4a14b75..00000000000 --- a/tools/sdk/esp32s3/include/esp_serial_slave_link/include/essl_spi/esp32s3_defs.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#pragma once - -// NOTE: From the view of master -#define CMD_HD_WRBUF_REG 0x01 -#define CMD_HD_RDBUF_REG 0x02 -#define CMD_HD_WRDMA_REG 0x03 -#define CMD_HD_RDDMA_REG 0x04 - -#define CMD_HD_ONEBIT_MODE 0x00 -#define CMD_HD_DOUT_MODE 0x10 -#define CMD_HD_QOUT_MODE 0x20 -#define CMD_HD_DIO_MODE 0x50 -#define CMD_HD_QIO_MODE 0xA0 - -#define CMD_HD_SEG_END_REG 0x05 -#define CMD_HD_EN_QPI_REG 0x06 -#define CMD_HD_WR_END_REG 0x07 -#define CMD_HD_INT0_REG 0x08 -#define CMD_HD_INT1_REG 0x09 -#define CMD_HD_INT2_REG 0x0A -#define CMD_HD_EX_QPI_REG 0xDD - -#define SPI_SLAVE_HD_BUFFER_SIZE 64 diff --git a/tools/sdk/esp32s3/include/esp_timer/include/esp_private/esp_timer_private.h b/tools/sdk/esp32s3/include/esp_timer/include/esp_private/esp_timer_private.h index ecd42641115..6f32f1431e1 100644 --- a/tools/sdk/esp32s3/include/esp_timer/include/esp_private/esp_timer_private.h +++ b/tools/sdk/esp32s3/include/esp_timer/include/esp_private/esp_timer_private.h @@ -52,11 +52,11 @@ void esp_timer_private_update_apb_freq(uint32_t apb_ticks_per_us); void esp_timer_private_advance(int64_t time_us); /** - * @brief obtain internal critical section used esp_timer implementation + * @brief obtain internal critical section used in the esp_timer implementation * This can be used when a sequence of calls to esp_timer has to be made, * and it is necessary that the state of the timer is consistent between * the calls. Should be treated in the same way as a spinlock. - * Call esp_timer_unlock to release the lock + * Call esp_timer_private_unlock to release the lock */ void esp_timer_private_lock(void); diff --git a/tools/sdk/esp32s3/include/esp_wifi/include/esp_coexist_internal.h b/tools/sdk/esp32s3/include/esp_wifi/include/esp_coexist_internal.h index 7ba06d4c690..1633c020276 100644 --- a/tools/sdk/esp32s3/include/esp_wifi/include/esp_coexist_internal.h +++ b/tools/sdk/esp32s3/include/esp_wifi/include/esp_coexist_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,6 +23,7 @@ typedef enum { } coex_prefer_t; typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); +typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void); /** * @brief Pre-Init software coexist @@ -115,6 +116,18 @@ int coex_wifi_release(uint32_t event); */ int coex_wifi_channel_set(uint8_t primary, uint8_t secondary); +/** + * @brief Register application callback function to Wi-Fi update low power clock module. + * + * @param callback : Wi-Fi update low power clock callback function + */ +void coex_wifi_register_update_lpclk_callback(coex_set_lpclk_source_callback_t callback); + +/** + * @brief Update low power clock interval + */ +void coex_update_lpclk_interval(void); + /** * @brief Get coexistence event duration. * diff --git a/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi.h b/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi.h index a2c763260e5..7b2a7ef4851 100644 --- a/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi.h +++ b/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -496,6 +496,15 @@ bool esp_wifi_internal_is_tsf_active(void); * */ void esp_wifi_internal_update_light_sleep_wake_ahead_time(uint32_t); + +/** + * @brief Update WiFi TSF tick interval + * + * @return + * - true: Active + * - false: Not active + */ +esp_err_t esp_wifi_update_tsf_tick_interval(void); #endif /** @@ -590,6 +599,15 @@ void esp_wifi_set_sleep_delay_time(uint32_t return_to_sleep_delay); */ void esp_wifi_set_keep_alive_time(uint32_t keep_alive_time); +/** + * @brief Configure wifi beacon montior default parameters + * + * @param enable: enable or disable beacon monitor + * @param timeout: timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond + * @param threshold: maximum number of consecutive lost beacons allowed + */ +void esp_wifi_beacon_monitor_configure(bool enable, int timeout, int threshold, int delta_intr_early, int delta_timeout); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi_os_adapter.h index 88d0ee54029..8b921b9da7f 100644 --- a/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32s3/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -77,7 +77,7 @@ typedef struct { void (* _wifi_apb80m_release)(void); void (* _phy_disable)(void); void (* _phy_enable)(void); -#if CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 void (* _phy_common_clock_enable)(void); void (* _phy_common_clock_disable)(void); #endif diff --git a/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi.h index e06569dfc15..08be53cf6a4 100644 --- a/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi.h @@ -339,7 +339,7 @@ esp_err_t esp_wifi_restore(void); * * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. - * @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. + * @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between ESP32 and the AP is established. * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error * number ESP_ERR_WIFI_STATE. * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called @@ -600,18 +600,19 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); * @attention 1. It is discouraged to call this API since this doesn't validate the per-country rules, * it's up to the user to fill in all fields according to local regulations. * Please use esp_wifi_set_country_code instead. - * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO} - * @attention 3. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which - * the station is connected is used. E.g. if the configured country info is {.cc="USA", .schan=1, .nchan=11} + * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}. + * @attention 3. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which + * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected * from the AP the country info is set back to the country info of the station automatically, * {.cc="US", .schan=1, .nchan=11} in the example. - * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. - * @attention 5. When the country info is changed because of configuration or because the station connects to a different + * @attention 5. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. + * @attention 6. When the country info is changed because of configuration or because the station connects to a different * external AP, the country IE in probe response/beacon of the soft-AP is also changed. - * @attention 6. The country configuration is stored into flash. - * @attention 7. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the + * @attention 7. The country configuration is stored into flash. + * @attention 8. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the * country info. * * @param country the configured country info @@ -909,7 +910,7 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument, e.g. parameter is out of range */ esp_err_t esp_wifi_set_max_tx_power(int8_t power); @@ -922,7 +923,7 @@ esp_err_t esp_wifi_set_max_tx_power(int8_t power); * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_WIFI_ARG: invalid argument */ esp_err_t esp_wifi_get_max_tx_power(int8_t *power); @@ -1018,7 +1019,7 @@ esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); @@ -1031,7 +1032,7 @@ esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); * return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init - * - ESP_ERR_WIFI_NOT_START: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start or promiscuous mode is not enabled * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_set_csi(bool en); @@ -1244,6 +1245,7 @@ esp_err_t esp_wifi_set_connectionless_wake_interval(uint16_t interval); * * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. * @attention 8. The default country is "CN" and ieee80211d_enabled is TRUE. + * @attention 9. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * * @param country the configured country ISO code * @param ieee80211d_enabled 802.11d is enabled or not diff --git a/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi_types.h b/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi_types.h index 89020d4abbf..4dae6a8c3fa 100644 --- a/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi_types.h +++ b/tools/sdk/esp32s3/include/esp_wifi/include/esp_wifi_types.h @@ -219,6 +219,14 @@ typedef struct { bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ } wifi_pmf_config_t; +/** Configuration for SAE PWE derivation */ +typedef enum { + WPA3_SAE_PWE_UNSPECIFIED, + WPA3_SAE_PWE_HUNT_AND_PECK, + WPA3_SAE_PWE_HASH_TO_ELEMENT, + WPA3_SAE_PWE_BOTH, +} wifi_sae_pwe_method_t; + /** @brief Soft-AP configuration settings for the ESP32 */ typedef struct { uint8_t ssid[32]; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ @@ -249,6 +257,7 @@ typedef struct { uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ uint32_t reserved:29; /**< Reserved for future feature set */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Whether SAE hash to element is enabled */ } wifi_sta_config_t; /** @brief Configuration data for ESP32 AP or STA. diff --git a/tools/sdk/esp32s3/include/expat/expat/expat/lib/expat.h b/tools/sdk/esp32s3/include/expat/expat/expat/lib/expat.h index 0f021e25def..e2020a4a29e 100644 --- a/tools/sdk/esp32s3/include/expat/expat/expat/lib/expat.h +++ b/tools/sdk/esp32s3/include/expat/expat/expat/lib/expat.h @@ -15,6 +15,7 @@ Copyright (c) 2016 Cristian Rodríguez Copyright (c) 2016 Thomas Beutlich Copyright (c) 2017 Rhodri James + Copyright (c) 2022 Thijs Schreijer Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -174,8 +175,10 @@ struct XML_cp { }; /* This is called for an element declaration. See above for - description of the model argument. It's the caller's responsibility - to free model when finished with it. + description of the model argument. It's the user code's responsibility + to free model when finished with it. See XML_FreeContentModel. + There is no need to free the model from the handler, it can be kept + around and freed at a later stage. */ typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData, const XML_Char *name, @@ -237,6 +240,17 @@ XML_ParserCreate(const XML_Char *encoding); and the local part will be concatenated without any separator. It is a programming error to use the separator '\0' with namespace triplets (see XML_SetReturnNSTriplet). + If a namespace separator is chosen that can be part of a URI or + part of an XML name, splitting an expanded name back into its + 1, 2 or 3 original parts on application level in the element handler + may end up vulnerable, so these are advised against; sane choices for + a namespace separator are e.g. '\n' (line feed) and '|' (pipe). + + Note that Expat does not validate namespace URIs (beyond encoding) + against RFC 3986 today (and is not required to do so with regard to + the XML 1.0 namespaces specification) but it may start doing that + in future releases. Before that, an application using Expat must + be ready to receive namespace URIs containing non-URI characters. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); @@ -317,7 +331,7 @@ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *pubid, int has_internal_subset); -/* This is called for the start of the DOCTYPE declaration when the +/* This is called for the end of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ @@ -1041,7 +1055,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold( */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 4 -#define XML_MICRO_VERSION 3 +#define XML_MICRO_VERSION 8 #ifdef __cplusplus } diff --git a/tools/sdk/esp32s3/include/expat/port/include/expat_config.h b/tools/sdk/esp32s3/include/expat/port/include/expat_config.h index 468910220f4..42acb52a5ca 100644 --- a/tools/sdk/esp32s3/include/expat/port/include/expat_config.h +++ b/tools/sdk/esp32s3/include/expat/port/include/expat_config.h @@ -63,7 +63,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.4.3" +#define PACKAGE_STRING "expat 2.4.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -72,13 +72,13 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.4.3" +#define PACKAGE_VERSION "2.4.8" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.4.3" +#define VERSION "2.4.8" /* whether byteorder is bigendian */ /* #undef WORDS_BIGENDIAN */ diff --git a/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos/idf_additions.h b/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos/idf_additions.h new file mode 100644 index 00000000000..bd1d0bd2381 --- /dev/null +++ b/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos/idf_additions.h @@ -0,0 +1,57 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "idf_additions_inc.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Saves the current priority and current base priority of a task, then raises the tasks + * current and base priority to uxNewPriority if uxNewPriority is of a higher priority. + * Once a task's priority has been raised with this function, the priority can be restored + * by calling prvTaskPriorityRestore() + * - Note that this function differs from vTaskPrioritySet() as the task's current priority + * will be modified even if the task has already inherited a priority. + * - This function is intended for special circumstance where a task must be forced immediately + * to a higher priority. + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @note vTaskPrioritySet() should not be called while a task's priority is already raised via this function + * + * @param pxSavedPriority returns base and current priorities + * + * @param uxNewPriority The priority to which the task will be set. + */ +void prvTaskPriorityRaise( prvTaskSavedPriority_t * pxSavedPriority, UBaseType_t uxNewPriority ); + +/** + * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. + * See the configuration section for more information. + * + * Restore a task's priority that was previously raised by prvTaskPriorityRaise(). + * + * For configUSE_MUTEXES == 0: A context switch will occur before the function returns if the priority + * being set is higher than the currently executing task. + * + * @note This functions is private is only be called internally within various IDF components. + * Users should never call this function from their application. + * + * @param pxSavedPriority previously saved base and current priorities that need to be restored + */ +void prvTaskPriorityRestore( prvTaskSavedPriority_t * pxSavedPriority ); + +#endif // ( INCLUDE_vTaskPrioritySet == 1) diff --git a/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos/idf_additions_inc.h b/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos/idf_additions_inc.h new file mode 100644 index 00000000000..25b0b6d9a4d --- /dev/null +++ b/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos/idf_additions_inc.h @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#ifndef FREERTOS_ADDITITIONS_INC_H_ +#define FREERTOS_ADDITITIONS_INC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" + +#if ( INCLUDE_vTaskPrioritySet == 1 ) + +typedef struct { + UBaseType_t uxPriority; +#if ( configUSE_MUTEXES == 1 ) + UBaseType_t uxBasePriority; +#endif +} prvTaskSavedPriority_t; + +#endif // ( INCLUDE_vTaskPrioritySet == 1) + +#ifdef __cplusplus +} +#endif + +#endif //FREERTOS_ADDITITIONS_INC_H_ diff --git a/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos_tasks_c_additions.h b/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos_tasks_c_additions.h deleted file mode 100644 index 464c0b3ffb9..00000000000 --- a/tools/sdk/esp32s3/include/freertos/include/esp_additions/freertos_tasks_c_additions.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -/** - * This file will be included in `tasks.c` file, thus, it must NOT be included - * by any (other) file. - * The functions below only consist in getters for the static variables in - * `tasks.c` file. - * The only source files that should call these functions are the ones in - * `/additions` directory. - */ - -#if ( configENABLE_TASK_SNAPSHOT == 1 ) - - UBaseType_t pxTCBGetSize ( void ) - { - return sizeof(TCB_t); - } - - ListItem_t* pxTCBGetStateListItem ( void *pxTCB ) - { - return &(((TCB_t*)pxTCB)->xStateListItem); - } - - StackType_t* pxTCBGetStartOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxStack; - } - - StackType_t* pxTCBGetTopOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxTopOfStack; - } - - StackType_t* pxTCBGetEndOfStack ( void *pxTCB ) - { - return (StackType_t*) ((TCB_t*)pxTCB)->pxEndOfStack; - } - - - List_t* pxListGetReadyTask ( UBaseType_t idx ) - { - return &( pxReadyTasksLists[idx] ); - } - - List_t* pxListGetReadyPendingTask ( UBaseType_t idx ) - { - return &( xPendingReadyList[idx] ); - } - - List_t* pxGetDelayedTaskList ( void ) { - return pxDelayedTaskList; - } - - List_t* pxGetOverflowDelayedTaskList ( void ) { - return pxOverflowDelayedTaskList; - } - - List_t* pxGetTasksWaitingTermination ( void ) { - return &xTasksWaitingTermination; - } - - List_t* pxGetSuspendedTaskList ( void ) { - return &xSuspendedTaskList; - } - -#endif diff --git a/tools/sdk/esp32s3/include/freertos/include/freertos/task.h b/tools/sdk/esp32s3/include/freertos/include/freertos/task.h index 88b2730933d..89841757d49 100644 --- a/tools/sdk/esp32s3/include/freertos/include/freertos/task.h +++ b/tools/sdk/esp32s3/include/freertos/include/freertos/task.h @@ -2655,12 +2655,13 @@ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, * not have this parameter and always waits for notifications on index 0. * * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value - * will be cleared in the calling task's notification value before the task - * checks to see if any notifications are pending, and optionally blocks if no - * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if - * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have - * the effect of resetting the task's notification value to 0. Setting - * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged. + * will be cleared in the calling task's notification value before the task is + * marked as waiting for a new notification (provided a notification is not + * already pending). Optionally blocks if no notifications are pending. Setting + * ulBitsToClearOnEntry to ULONG_MAX (if limits.h is included) or 0xffffffffUL + * (if limits.h is not included) will have the effect of resetting the task's + * notification value to 0. Setting ulBitsToClearOnEntry to 0 will leave the + * task's notification value unchanged. * * @param ulBitsToClearOnExit If a notification is pending or received before * the calling task exits the xTaskNotifyWait() function then the task's @@ -3367,6 +3368,25 @@ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION; +#ifdef ESP_PLATFORM +/* + * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN + * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. + * + * This function is a wrapper to take the "xTaskQueueMutex" spinlock of tasks.c. + * This lock is taken whenver any of the task lists or event lists are + * accessed/modified, such as when adding/removing tasks to/from the delayed + * task list or various event lists. + * + * This functions is meant to be called by xEventGroupSetBits() and + * vEventGroupDelete() as both those functions will access event lists (instead + * of delegating the entire responsibility to one of vTask...EventList() + * functions). + */ +void vTaskTakeEventListLock( void ); +void vTaskReleaseEventListLock( void ); +#endif // ESP_PLATFORM + /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/gpio_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/gpio_ll.h index 6a5b7b1b85f..a68ff6729c3 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/gpio_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/gpio_ll.h @@ -52,6 +52,14 @@ static inline void gpio_ll_pullup_en(gpio_dev_t *hw, gpio_num_t gpio_num) */ static inline void gpio_ll_pullup_dis(gpio_dev_t *hw, gpio_num_t gpio_num) { + // The pull-up value of the USB pins are controlled by the pins’ pull-up value together with USB pull-up value + // USB DP pin is default to PU enabled + // Note that from esp32s3 ECO1, USB_EXCHG_PINS feature has been supported. If this efuse is burnt, the gpio pin + // which should be checked is USB_DM_GPIO_NUM instead. + if (gpio_num == USB_DP_GPIO_NUM) { + SET_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_PAD_PULL_OVERRIDE); + CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_DP_PULLUP); + } REG_CLR_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PU); } diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2c_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2c_ll.h index ec209daf2e6..20b5c7d9ede 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2c_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2c_ll.h @@ -109,11 +109,12 @@ static inline void i2c_ll_cal_bus_clk(uint32_t source_clk, uint32_t bus_freq, i2 clk_cal->clkm_div = clkm_div; clk_cal->scl_low = half_cycle; // default, scl_wait_high < scl_high - clk_cal->scl_high = (bus_freq <= 50000) ? half_cycle : (half_cycle / 5 * 4 + 4); - clk_cal->scl_wait_high = half_cycle - clk_cal->scl_high; - clk_cal->sda_hold = half_cycle / 2; - // scl_wait_high < sda_sample <= scl_high - clk_cal->sda_sample = half_cycle / 2; + // Make 80KHz as a boundary here, because when working at lower frequency, too much scl_wait_high will faster the frequency + // according to some hardware behaviors. + clk_cal->scl_wait_high = (bus_freq >= 80*1000) ? (half_cycle / 2 - 2) : (half_cycle / 4); + clk_cal->scl_high = half_cycle - clk_cal->scl_wait_high; + clk_cal->sda_hold = half_cycle / 4; + clk_cal->sda_sample = half_cycle / 2 + clk_cal->scl_wait_high; clk_cal->setup = half_cycle; clk_cal->hold = half_cycle; //default we set the timeout value to about 10 bus cycles @@ -145,10 +146,13 @@ static inline void i2c_ll_set_bus_timing(i2c_dev_t *hw, i2c_clk_cal_t *bus_cfg) { HAL_FORCE_MODIFY_U32_REG_FIELD(hw->clk_conf, sclk_div_num, bus_cfg->clkm_div - 1); /* According to the Technical Reference Manual, the following timings must be subtracted by 1. - * Moreover, the frequency calculation also shows that we must subtract 3 to the total SCL */ - //scl period - hw->scl_low_period.scl_low_period = bus_cfg->scl_low - 1 - 2; - hw->scl_high_period.scl_high_period = bus_cfg->scl_high - 1 - 1; + * However, according to the practical measurement and some hardware behaviour, if wait_high_period and scl_high minus one. + * The SCL frequency would be a little higher than expected. Therefore, the solution + * here is not to minus scl_high as well as scl_wait high, and the frequency will be absolutely accurate to all frequency + * to some extent. */ + hw->scl_low_period.scl_low_period = bus_cfg->scl_low - 1; + hw->scl_high_period.scl_high_period = bus_cfg->scl_high; + hw->scl_high_period.scl_wait_high_period = bus_cfg->scl_wait_high; //sda sample hw->sda_hold.sda_hold_time = bus_cfg->sda_hold - 1; hw->sda_sample.sda_sample_time = bus_cfg->sda_sample - 1; @@ -205,6 +209,23 @@ static inline void i2c_ll_set_scl_timing(i2c_dev_t *hw, int high_period, int low hw->scl_high_period.scl_wait_high_period = high_period - high_period_output; } +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +static inline void i2c_ll_set_scl_clk_timing(i2c_dev_t *hw, int high_period, int low_period, int wait_high_period) +{ + hw->scl_low_period.scl_low_period = low_period; + hw->scl_high_period.scl_high_period = high_period; + hw->scl_high_period.scl_wait_high_period = wait_high_period; +} + /** * @brief Clear I2C interrupt status * @@ -559,6 +580,22 @@ static inline void i2c_ll_get_scl_timing(i2c_dev_t *hw, int *high_period, int *l *low_period = hw->scl_low_period.scl_low_period + 1; } +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +static inline void i2c_ll_get_scl_clk_timing(i2c_dev_t *hw, int *high_period, int *low_period, int *wait_high_period) +{ + *high_period = hw->scl_high_period.scl_high_period; + *wait_high_period = hw->scl_high_period.scl_wait_high_period; + *low_period = hw->scl_low_period.scl_low_period; +} + /** * @brief Write the I2C hardware txFIFO * diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2s_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2s_ll.h index c1b3ae7f505..f8a63ed16cd 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2s_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/i2s_ll.h @@ -220,6 +220,23 @@ static inline void i2s_ll_tx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) hw->tx_conf1.tx_bck_div_num = val - 1; } +/** + * @brief Set I2S tx raw clock division + * + * @param hw Peripheral I2S hardware instance address. + * @param x div x + * @param y div y + * @param z div z + * @param yn1 yn1 + */ +static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) +{ + hw->tx_clkm_div_conf.tx_clkm_div_x = x; + hw->tx_clkm_div_conf.tx_clkm_div_y = y; + hw->tx_clkm_div_conf.tx_clkm_div_z = z; + hw->tx_clkm_div_conf.tx_clkm_div_yn1 = yn1; +} + /** * @brief Configure I2S TX clock devider * @@ -663,11 +680,11 @@ static inline void i2s_ll_tx_enable_pdm_hp_filter(i2s_dev_t *hw, bool enable) * @brief Enable I2S TX PDM sigma-delta codec * * @param hw Peripheral I2S hardware instance address. - * @param dither I2S TX PDM sigmadelta dither value + * @param enable whether enable sd dac one line mode */ static inline void i2s_ll_tx_enable_pdm_sd_codec(i2s_dev_t *hw, bool enable) { - hw->tx_pcm2pdm_conf.tx_dac_2out_en = enable; + hw->tx_pcm2pdm_conf.tx_dac_2out_en = !enable; hw->tx_pcm2pdm_conf.tx_dac_mode_en = enable; } diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/lcd_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/lcd_ll.h index 495d08b9056..fc5d5a6baab 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/lcd_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/lcd_ll.h @@ -5,6 +5,7 @@ */ #pragma once +#include /* For NULL declaration */ #include #include #include "hal/misc.h" @@ -23,25 +24,27 @@ extern "C" { #define LCD_LL_EVENT_VSYNC_END (1 << 0) #define LCD_LL_EVENT_TRANS_DONE (1 << 1) -// Maximum coefficient of clock prescaler -#define LCD_LL_CLOCK_PRESCALE_MAX (64) +#define LCD_LL_CLK_FRAC_DIV_N_MAX 256 // LCD_CLK = LCD_CLK_S / (N + b/a), the N register is 8 bit-width +#define LCD_LL_CLK_FRAC_DIV_AB_MAX 64 // LCD_CLK = LCD_CLK_S / (N + b/a), the a/b register is 6 bit-width +#define LCD_LL_PCLK_DIV_MAX 64 // LCD_PCLK = LCD_CLK / MO, the MO register is 6 bit-width + +#define LCD_LL_COLOR_RANGE_TO_REG(range) (uint8_t[]){0,1}[(range)] +#define LCD_LL_CONV_STD_TO_REG(std) (uint8_t[]){0,1}[(std)] +#define LCD_LL_YUV_SAMPLE_TO_REG(sample) (uint8_t[]){0,1,2}[(sample)] static inline void lcd_ll_enable_clock(lcd_cam_dev_t *dev, bool en) { dev->lcd_clock.clk_en = en; } -static inline void lcd_ll_set_group_clock_src(lcd_cam_dev_t *dev, lcd_clock_source_t src, int div_num, int div_a, int div_b) +/** + * @brief Select clock source for LCD peripheral + * + * @param dev LCD register base address + * @param src Clock source + */ +static inline void lcd_ll_select_clk_src(lcd_cam_dev_t *dev, lcd_clock_source_t src) { - // lcd_clk = module_clock_src / (div_num + div_b / div_a) - HAL_ASSERT(div_num >= 2 && div_num <= 256); - // dic_num == 0 means 256 divider in hardware - if (div_num >= 256) { - div_num = 0; - } - HAL_FORCE_MODIFY_U32_REG_FIELD(dev->lcd_clock, lcd_clkm_div_num, div_num); - dev->lcd_clock.lcd_clkm_div_a = div_a; - dev->lcd_clock.lcd_clkm_div_b = div_b; switch (src) { case LCD_CLK_SRC_PLL160M: dev->lcd_clock.lcd_clk_sel = 3; @@ -53,13 +56,41 @@ static inline void lcd_ll_set_group_clock_src(lcd_cam_dev_t *dev, lcd_clock_sour dev->lcd_clock.lcd_clk_sel = 1; break; default: - // disble LCD clock source + // disable LCD clock source dev->lcd_clock.lcd_clk_sel = 0; - HAL_ASSERT(false && "unsupported clock source"); + HAL_ASSERT(false); break; } } +/** + * @brief Set clock coefficient of LCD peripheral + * + * @param dev LCD register base address + * @param div_num Integer part of the divider + * @param div_a denominator of the divider + * @param div_b numerator of the divider + */ +static inline void lcd_ll_set_group_clock_coeff(lcd_cam_dev_t *dev, int div_num, int div_a, int div_b) +{ + // lcd_clk = module_clock_src / (div_num + div_b / div_a) + HAL_ASSERT(div_num >= 2 && div_num <= LCD_LL_CLK_FRAC_DIV_N_MAX); + // dic_num == 0 means LCD_LL_CLK_FRAC_DIV_N_MAX divider in hardware + if (div_num >= LCD_LL_CLK_FRAC_DIV_N_MAX) { + div_num = 0; + } + HAL_FORCE_MODIFY_U32_REG_FIELD(dev->lcd_clock, lcd_clkm_div_num, div_num); + dev->lcd_clock.lcd_clkm_div_a = div_a; + dev->lcd_clock.lcd_clkm_div_b = div_b; +} + + +/** + * @brief Set the PCLK clock level state when there's no transaction undergoing + * + * @param dev LCD register base address + * @param level 1 is high level, 0 is low level + */ __attribute__((always_inline)) static inline void lcd_ll_set_clock_idle_level(lcd_cam_dev_t *dev, bool level) { @@ -75,6 +106,7 @@ static inline void lcd_ll_set_pixel_clock_edge(lcd_cam_dev_t *dev, bool active_o __attribute__((always_inline)) static inline void lcd_ll_set_pixel_clock_prescale(lcd_cam_dev_t *dev, uint32_t prescale) { + HAL_ASSERT(prescale <= LCD_LL_PCLK_DIV_MAX); // Formula: pixel_clk = lcd_clk / (1 + clkcnt_n) // clkcnt_n can't be zero uint32_t scale = 1; @@ -92,6 +124,92 @@ static inline void lcd_ll_enable_rgb_yuv_convert(lcd_cam_dev_t *dev, bool en) dev->lcd_rgb_yuv.lcd_conv_bypass = en; } +/** + * @brief Set convert data line width + * + * @param dev LCD register base address + * @param width data line width (8 or 16) + */ +static inline void lcd_ll_set_convert_data_width(lcd_cam_dev_t *dev, uint32_t width) +{ + HAL_ASSERT(width == 8 || width == 16); + dev->lcd_rgb_yuv.lcd_conv_mode_8bits_on = (width == 8) ? 1 : 0; +} + +/** + * @brief Set the color range of input data + * + * @param dev LCD register base address + * @param range Color range + */ +static inline void lcd_ll_set_input_color_range(lcd_cam_dev_t *dev, lcd_color_range_t range) +{ + dev->lcd_rgb_yuv.lcd_conv_data_in_mode = LCD_LL_COLOR_RANGE_TO_REG(range); +} + +/** + * @brief Set the color range of output data + * + * @param dev LCD register base address + * @param range Color range + */ +static inline void lcd_ll_set_output_color_range(lcd_cam_dev_t *dev, lcd_color_range_t range) +{ + dev->lcd_rgb_yuv.lcd_conv_data_out_mode = LCD_LL_COLOR_RANGE_TO_REG(range); +} + +/** + * @brief Set YUV conversion standard + * + * @param dev LCD register base address + * @param std YUV conversion standard + */ +static inline void lcd_ll_set_yuv_convert_std(lcd_cam_dev_t *dev, lcd_yuv_conv_std_t std) +{ + dev->lcd_rgb_yuv.lcd_conv_protocol_mode = LCD_LL_CONV_STD_TO_REG(std); +} + +/** + * @brief Set the converter mode: RGB565 to YUV + * + * @param dev LCD register base address + * @param yuv_sample YUV sample mode + */ +static inline void lcd_ll_set_convert_mode_rgb_to_yuv(lcd_cam_dev_t *dev, lcd_yuv_sample_t yuv_sample) +{ + dev->lcd_rgb_yuv.lcd_conv_trans_mode = 1; + dev->lcd_rgb_yuv.lcd_conv_yuv_mode = LCD_LL_YUV_SAMPLE_TO_REG(yuv_sample); + dev->lcd_rgb_yuv.lcd_conv_yuv2yuv_mode = 3; +} + +/** + * @brief Set the converter mode: YUV to RGB565 + * + * @param dev LCD register base address + * @param yuv_sample YUV sample mode + */ +static inline void lcd_ll_set_convert_mode_yuv_to_rgb(lcd_cam_dev_t *dev, lcd_yuv_sample_t yuv_sample) +{ + dev->lcd_rgb_yuv.lcd_conv_trans_mode = 0; + dev->lcd_rgb_yuv.lcd_conv_yuv_mode = LCD_LL_YUV_SAMPLE_TO_REG(yuv_sample); + dev->lcd_rgb_yuv.lcd_conv_yuv2yuv_mode = 3; +} + +/** + * @brief Set the converter mode: YUV to YUV + * + * @param dev LCD register base address + * @param src_sample Source YUV sample mode + * @param dst_sample Destination YUV sample mode + */ +static inline void lcd_ll_set_convert_mode_yuv_to_yuv(lcd_cam_dev_t *dev, lcd_yuv_sample_t src_sample, lcd_yuv_sample_t dst_sample) +{ + HAL_ASSERT(src_sample != dst_sample); + dev->lcd_rgb_yuv.lcd_conv_trans_mode = 1; + dev->lcd_rgb_yuv.lcd_conv_yuv_mode = LCD_LL_YUV_SAMPLE_TO_REG(src_sample); + dev->lcd_rgb_yuv.lcd_conv_yuv2yuv_mode = LCD_LL_YUV_SAMPLE_TO_REG(dst_sample); +} + __attribute__((always_inline)) static inline void lcd_ll_set_phase_cycles(lcd_cam_dev_t *dev, uint32_t cmd_cycles, uint32_t dummy_cycles, uint32_t data_cycles) { diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/rtc_io_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/rtc_io_ll.h index 08a3c63e6ab..97eff5f3687 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/rtc_io_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/rtc_io_ll.h @@ -17,6 +17,8 @@ #include "soc/rtc_io_struct.h" #include "hal/rtc_io_types.h" #include "hal/gpio_types.h" +#include "soc/io_mux_reg.h" +#include "soc/usb_serial_jtag_reg.h" #define RTCIO_LL_PIN_FUNC 0 @@ -181,6 +183,14 @@ static inline void rtcio_ll_pullup_enable(int rtcio_num) */ static inline void rtcio_ll_pullup_disable(int rtcio_num) { + // The pull-up value of the USB pins are controlled by the pins’ pull-up value together with USB pull-up value + // USB DP pin is default to PU enabled + // Note that from esp32s3 ECO1, USB_EXCHG_PINS feature has been supported. If this efuse is burnt, the gpio pin + // which should be checked is USB_DM_GPIO_NUM instead. + if (rtcio_num == USB_DP_GPIO_NUM) { + SET_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_PAD_PULL_OVERRIDE); + CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_DP_PULLUP); + } if (rtc_io_desc[rtcio_num].pullup) { CLEAR_PERI_REG_MASK(rtc_io_desc[rtcio_num].reg, rtc_io_desc[rtcio_num].pullup); } diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/spi_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/spi_ll.h index 6058afe1e55..e210a76f8ef 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/spi_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/spi_ll.h @@ -76,6 +76,21 @@ typedef enum { } spi_ll_trans_len_cond_t; FLAG_ATTR(spi_ll_trans_len_cond_t) +// SPI base command in esp32s3 +typedef enum { + /* Slave HD Only */ + SPI_LL_BASE_CMD_HD_WRBUF = 0x01, + SPI_LL_BASE_CMD_HD_RDBUF = 0x02, + SPI_LL_BASE_CMD_HD_WRDMA = 0x03, + SPI_LL_BASE_CMD_HD_RDDMA = 0x04, + SPI_LL_BASE_CMD_HD_SEG_END = 0x05, + SPI_LL_BASE_CMD_HD_EN_QPI = 0x06, + SPI_LL_BASE_CMD_HD_WR_END = 0x07, + SPI_LL_BASE_CMD_HD_INT0 = 0x08, + SPI_LL_BASE_CMD_HD_INT1 = 0x09, + SPI_LL_BASE_CMD_HD_INT2 = 0x0A, +} spi_ll_base_command_t; + /*------------------------------------------------------------------------------ * Control *----------------------------------------------------------------------------*/ @@ -1091,6 +1106,93 @@ static inline uint32_t spi_ll_slave_hd_get_last_addr(spi_dev_t *hw) #undef SPI_LL_RST_MASK #undef SPI_LL_UNUSED_INT_MASK +/** + * Get the base spi command in esp32s3 + * + * @param cmd_t Command value + */ +static inline uint8_t spi_ll_get_slave_hd_base_command(spi_command_t cmd_t) +{ + uint8_t cmd_base = 0x00; + switch (cmd_t) + { + case SPI_CMD_HD_WRBUF: + cmd_base = SPI_LL_BASE_CMD_HD_WRBUF; + break; + case SPI_CMD_HD_RDBUF: + cmd_base = SPI_LL_BASE_CMD_HD_RDBUF; + break; + case SPI_CMD_HD_WRDMA: + cmd_base = SPI_LL_BASE_CMD_HD_WRDMA; + break; + case SPI_CMD_HD_RDDMA: + cmd_base = SPI_LL_BASE_CMD_HD_RDDMA; + break; + case SPI_CMD_HD_SEG_END: + cmd_base = SPI_LL_BASE_CMD_HD_SEG_END; + break; + case SPI_CMD_HD_EN_QPI: + cmd_base = SPI_LL_BASE_CMD_HD_EN_QPI; + break; + case SPI_CMD_HD_WR_END: + cmd_base = SPI_LL_BASE_CMD_HD_WR_END; + break; + case SPI_CMD_HD_INT0: + cmd_base = SPI_LL_BASE_CMD_HD_INT0; + break; + case SPI_CMD_HD_INT1: + cmd_base = SPI_LL_BASE_CMD_HD_INT1; + break; + case SPI_CMD_HD_INT2: + cmd_base = SPI_LL_BASE_CMD_HD_INT2; + break; + default: + HAL_ASSERT(cmd_base); + } + return cmd_base; +} + +/** + * Get the spi communication command + * + * @param cmd_t Base command value + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline uint16_t spi_ll_get_slave_hd_command(spi_command_t cmd_t, spi_line_mode_t line_mode) +{ + uint8_t cmd_base = spi_ll_get_slave_hd_base_command(cmd_t); + uint8_t cmd_mod = 0x00; //CMD:1-bit, ADDR:1-bit, DATA:1-bit + + if (line_mode.data_lines == 2) { + if (line_mode.addr_lines == 2) { + cmd_mod = 0x50; //CMD:1-bit, ADDR:2-bit, DATA:2-bit + } else { + cmd_mod = 0x10; //CMD:1-bit, ADDR:1-bit, DATA:2-bit + } + } else if (line_mode.data_lines == 4) { + if (line_mode.addr_lines == 4) { + cmd_mod = 0xA0; //CMD:1-bit, ADDR:4-bit, DATA:4-bit + } else { + cmd_mod = 0x20; //CMD:1-bit, ADDR:1-bit, DATA:4-bit + } + } + if (cmd_base == SPI_LL_BASE_CMD_HD_SEG_END || cmd_base == SPI_LL_BASE_CMD_HD_EN_QPI) { + cmd_mod = 0x00; + } + + return cmd_base | cmd_mod; +} + +/** + * Get the dummy bits + * + * @param line_mode Line mode of SPI transaction phases: CMD, ADDR, DOUT/DIN. + */ +static inline int spi_ll_get_slave_hd_dummy_bits(spi_line_mode_t line_mode) +{ + return 8; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/usb_phy_ll.h b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/usb_phy_ll.h index fc665552d86..acf6eed1024 100644 --- a/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/usb_phy_ll.h +++ b/tools/sdk/esp32s3/include/hal/esp32s3/include/hal/usb_phy_ll.h @@ -59,6 +59,8 @@ static inline void usb_phy_ll_int_jtag_enable(usb_serial_jtag_dev_t *hw) hw->conf0.phy_sel = 0; // Disable software control USB D+ D- pullup pulldown (Device FS: dp_pullup = 1) hw->conf0.pad_pull_override = 0; + // Enable USB D+ pullup + hw->conf0.dp_pullup = 1; // Enable USB pad function hw->conf0.usb_pad_enable = 1; // phy_sel is controlled by the following register value diff --git a/tools/sdk/esp32s3/include/hal/include/hal/adc_hal.h b/tools/sdk/esp32s3/include/hal/include/hal/adc_hal.h index b8455e27ecd..787e50246e6 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/adc_hal.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/adc_hal.h @@ -36,9 +36,6 @@ #define ADC_HAL_DMA_INTR_MASK BIT(9) #endif -//For ADC module, each conversion contains 4 bytes -#define ADC_HAL_DATA_LEN_PER_CONV 4 - typedef enum adc_hal_work_mode_t { ADC_HAL_ULP_MODE, ADC_HAL_SINGLE_READ_MODE, diff --git a/tools/sdk/esp32s3/include/hal/include/hal/adc_types.h b/tools/sdk/esp32s3/include/hal/include/hal/adc_types.h index dc07531e0b9..3490986c28e 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/adc_types.h @@ -161,7 +161,8 @@ typedef struct { typedef struct { union { struct { - uint32_t data: 13; /*! ADC_CHANNEL_MAX), The data is invalid. */ diff --git a/tools/sdk/esp32s3/include/hal/include/hal/i2c_hal.h b/tools/sdk/esp32s3/include/hal/include/hal/i2c_hal.h index b255878cc43..cc56014b634 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/i2c_hal.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/i2c_hal.h @@ -120,6 +120,29 @@ typedef struct { */ #define i2c_hal_set_source_clk(hal, src_clk) i2c_ll_set_source_clk((hal)->dev, src_clk) +/** + * @brief Configure I2C SCL timing + * + * @param hw Beginning address of the peripheral registers + * @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2) + * @param low_period The I2C SCL low period (in core clock cycle, low_period > 1) + * @param wait_high_period The I2C SCL wait rising edge period. + * + * @return None. + */ +#define i2c_hal_set_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_set_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + +/** + * @brief Get I2C SCL timing configuration + * + * @param hw Beginning address of the peripheral registers + * @param high_period Pointer to accept the SCL high period + * @param low_period Pointer to accept the SCL low period + * + * @return None + */ +#define i2c_hal_get_scl_clk_timing(hal, high_period, low_period, wait_high_period) i2c_ll_get_scl_clk_timing((hal)->dev, high_period, low_period, wait_high_period) + /** * @brief Init the I2C master. * diff --git a/tools/sdk/esp32s3/include/hal/include/hal/i2s_hal.h b/tools/sdk/esp32s3/include/hal/include/hal/i2s_hal.h index 037970fa2b3..2be94f66d15 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/i2s_hal.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/i2s_hal.h @@ -125,6 +125,16 @@ void i2s_hal_init(i2s_hal_context_t *hal, int i2s_num); */ void i2s_hal_set_clock_src(i2s_hal_context_t *hal, i2s_clock_src_t sel); +/** + * @brief Calculate the closest sample rate clock configuration. + * clock relationship: + * Fmclk = bck_div*fbck = fsclk/(mclk_div+b/a) + * + * @param clk_cfg I2S clock configuration(input) + * @param cal Point to `i2s_ll_mclk_div_t` structure(output). + */ +void i2s_hal_mclk_div_decimal_cal(i2s_hal_clock_cfg_t *clk_cfg, i2s_ll_mclk_div_t *cal); + /** * @brief Set Tx channel style * @@ -342,8 +352,9 @@ void i2s_hal_rx_set_common_mode(i2s_hal_context_t *hal, const i2s_hal_config_t * * * @param hal Context of the HAL layer * @param sample_rate PDM sample rate + * @param is_mono whether is mono */ -void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate); +void i2s_hal_tx_set_pdm_mode_default(i2s_hal_context_t *hal, uint32_t sample_rate, bool is_mono); #endif #if SOC_I2S_SUPPORTS_PDM_RX diff --git a/tools/sdk/esp32s3/include/hal/include/hal/lcd_hal.h b/tools/sdk/esp32s3/include/hal/include/hal/lcd_hal.h index db255b3d1e4..1312b5135e5 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/lcd_hal.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/lcd_hal.h @@ -1,23 +1,52 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include +#include + #ifdef __cplusplus extern "C" { #endif +/** + * @brief LCD peripheral SOC layer handle + */ typedef struct lcd_cam_dev_t *lcd_soc_handle_t; +/** + * @brief LCD HAL layer context + */ typedef struct { - lcd_soc_handle_t dev; + lcd_soc_handle_t dev; // SOC layer handle } lcd_hal_context_t; +/** + * @brief LCD HAL layer initialization + * + * @param hal LCD HAL layer context + * @param id LCD peripheral ID + */ void lcd_hal_init(lcd_hal_context_t *hal, int id); +#define LCD_HAL_PCLK_FLAG_ALLOW_EQUAL_SYSCLK (1 << 0) + +/** + * @brief LCD PCLK clock calculation + * @note Currently this function is only used by RGB LCD driver, I80 driver still uses a fixed clock division + * + * @param hal LCD HAL layer context + * @param src_freq_hz LCD source clock frequency in Hz + * @param expect_pclk_freq_hz Expected LCD PCLK frequency in Hz + * @param lcd_clk_flags Extra flags to control LCD PCLK clock calculation, supported flags are prefixed with LCD_HAL_PCLK_FLAG_ + * @return Actual LCD PCLK frequency in Hz + */ +uint32_t lcd_hal_cal_pclk_freq(lcd_hal_context_t *hal, uint32_t src_freq_hz, uint32_t expect_pclk_freq_hz, int lcd_clk_flags); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32s3/include/hal/include/hal/lcd_types.h index 13810a79ac3..af11ef64a8d 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/lcd_types.h @@ -34,6 +34,39 @@ typedef enum { LCD_CLK_SRC_XTAL, /*!< Select XTAL as the source clock */ } lcd_clock_source_t; +/** + * @brief LCD color space + */ +typedef enum { + LCD_COLOR_SPACE_RGB, /*!< Color space: RGB */ + LCD_COLOR_SPACE_YUV, /*!< Color space: YUV */ +} lcd_color_space_t; + +/** + * @brief LCD color range + */ +typedef enum { + LCD_COLOR_RANGE_LIMIT, /*!< Limited color range */ + LCD_COLOR_RANGE_FULL, /*!< Full color range */ +} lcd_color_range_t; + +/** + * @brief YUV sampling method + */ +typedef enum { + LCD_YUV_SAMPLE_422, /*!< YUV 4:2:2 sampling */ + LCD_YUV_SAMPLE_420, /*!< YUV 4:2:0 sampling */ + LCD_YUV_SAMPLE_411, /*!< YUV 4:1:1 sampling */ +} lcd_yuv_sample_t; + +/** + * @brief The standard used for conversion between RGB and YUV + */ +typedef enum { + LCD_YUV_CONV_STD_BT601, /*!< YUV<->RGB conversion standard: BT.601 */ + LCD_YUV_CONV_STD_BT709, /*!< YUV<->RGB conversion standard: BT.709 */ +} lcd_yuv_conv_std_t; + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/hal/include/hal/spi_types.h b/tools/sdk/esp32s3/include/hal/include/hal/spi_types.h index 169069c5c62..9c008838a19 100644 --- a/tools/sdk/esp32s3/include/hal/include/hal/spi_types.h +++ b/tools/sdk/esp32s3/include/hal/include/hal/spi_types.h @@ -55,6 +55,22 @@ typedef struct { uint8_t data_lines; ///< The line width of data phase, e.g. 4-line-data-phase. } spi_line_mode_t; +/** + * @brief SPI command. + */ +typedef enum { + /* Slave HD Only */ + SPI_CMD_HD_WRBUF = BIT(0), + SPI_CMD_HD_RDBUF = BIT(1), + SPI_CMD_HD_WRDMA = BIT(2), + SPI_CMD_HD_RDDMA = BIT(3), + SPI_CMD_HD_SEG_END = BIT(4), + SPI_CMD_HD_EN_QPI = BIT(5), + SPI_CMD_HD_WR_END = BIT(6), + SPI_CMD_HD_INT0 = BIT(7), + SPI_CMD_HD_INT1 = BIT(8), + SPI_CMD_HD_INT2 = BIT(9), +} spi_command_t; /** @cond */ //Doxy command to hide preprocessor definitions from docs */ diff --git a/tools/sdk/esp32s3/include/hal/platform_port/include/hal/assert.h b/tools/sdk/esp32s3/include/hal/platform_port/include/hal/assert.h index 45e9b138741..1bfeada1f59 100644 --- a/tools/sdk/esp32s3/include/hal/platform_port/include/hal/assert.h +++ b/tools/sdk/esp32s3/include/hal/platform_port/include/hal/assert.h @@ -30,7 +30,9 @@ extern void abort(void); #endif #endif -#if CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent +#if IS_ULP_COCPU +#define HAL_ASSERT(__e) ((void)(__e)) +#elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 1 // silent #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : abort()) #elif CONFIG_HAL_DEFAULT_ASSERTION_LEVEL == 2 // full assertion #define HAL_ASSERT(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, #__e)) diff --git a/tools/sdk/esp32s3/include/heap/include/esp_heap_caps.h b/tools/sdk/esp32s3/include/heap/include/esp_heap_caps.h index c7d85d4217f..2832b101b5e 100644 --- a/tools/sdk/esp32s3/include/heap/include/esp_heap_caps.h +++ b/tools/sdk/esp32s3/include/heap/include/esp_heap_caps.h @@ -33,7 +33,7 @@ extern "C" { #define MALLOC_CAP_INTERNAL (1<<11) ///< Memory must be internal; specifically it should not disappear when flash/spiram cache is switched off #define MALLOC_CAP_DEFAULT (1<<12) ///< Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call #define MALLOC_CAP_IRAM_8BIT (1<<13) ///< Memory must be in IRAM and allow unaligned access -#define MALLOC_CAP_RETENTION (1<<14) +#define MALLOC_CAP_RETENTION (1<<14) ///< Memory must be able to accessed by retention DMA #define MALLOC_CAP_RTCRAM (1<<15) ///< Memory must be in RTC fast memory #define MALLOC_CAP_INVALID (1<<31) ///< Memory can't be used / list end marker @@ -58,8 +58,6 @@ esp_err_t heap_caps_register_failed_alloc_callback(esp_alloc_failed_hook_t callb * * Equivalent semantics to libc malloc(), for capability-aware memory. * - * In IDF, ``malloc(p)`` is equivalent to ``heap_caps_malloc(p, MALLOC_CAP_8BIT)``. - * * @param size Size, in bytes, of the amount of memory to allocate * @param caps Bitwise OR of MALLOC_CAP_* flags indicating the type * of memory to be returned diff --git a/tools/sdk/esp32s3/include/nvs_flash/include/nvs.h b/tools/sdk/esp32s3/include/nvs_flash/include/nvs.h index 0faef98fd3d..a800d4d1847 100644 --- a/tools/sdk/esp32s3/include/nvs_flash/include/nvs.h +++ b/tools/sdk/esp32s3/include/nvs_flash/include/nvs.h @@ -132,6 +132,8 @@ typedef struct nvs_opaque_iterator_t *nvs_iterator_t; * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); @@ -161,6 +163,8 @@ esp_err_t nvs_open(const char* name, nvs_open_mode_t open_mode, nvs_handle_t *ou * mode is NVS_READONLY * - ESP_ERR_NVS_INVALID_NAME if namespace name doesn't satisfy constraints * - ESP_ERR_NO_MEM in case memory could not be allocated for the internal structures + * - ESP_ERR_NVS_NOT_ENOUGH_SPACE if there is no space for a new entry or there are too many different + * namespaces (maximum allowed different namespaces: 254) * - other error codes from the underlying storage driver */ esp_err_t nvs_open_from_partition(const char *part_name, const char* name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle); diff --git a/tools/sdk/esp32s3/include/protocomm/include/transports/protocomm_ble.h b/tools/sdk/esp32s3/include/protocomm/include/transports/protocomm_ble.h index d684e7e921a..0efb31c2134 100644 --- a/tools/sdk/esp32s3/include/protocomm/include/transports/protocomm_ble.h +++ b/tools/sdk/esp32s3/include/protocomm/include/transports/protocomm_ble.h @@ -52,7 +52,7 @@ typedef struct protocomm_ble_config { /** * BLE device name being broadcast at the time of provisioning */ - char device_name[MAX_BLE_DEVNAME_LEN]; + char device_name[MAX_BLE_DEVNAME_LEN + 1]; /** * 128 bit UUID of the provisioning service diff --git a/tools/sdk/esp32s3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h b/tools/sdk/esp32s3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h index 9355d034ef4..59f2224a9a9 100644 --- a/tools/sdk/esp32s3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h +++ b/tools/sdk/esp32s3/include/rmaker_common/include/esp_rmaker_mqtt_glue.h @@ -11,10 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + #pragma once + #include #include #include + #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/cpu.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/cpu.h deleted file mode 100644 index ad7f7c11d57..00000000000 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/cpu.h +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once - -#include -#include -#include -#include "xtensa/corebits.h" - -/* C macros for xtensa special register read/write/exchange */ - -#define RSR(reg, curval) asm volatile ("rsr %0, " #reg : "=r" (curval)); -#define WSR(reg, newval) asm volatile ("wsr %0, " #reg : : "r" (newval)); -#define XSR(reg, swapval) asm volatile ("xsr %0, " #reg : "+r" (swapval)); - -/** @brief Read current stack pointer address - * - */ -static inline void *get_sp(void) -{ - void *sp; - asm volatile ("mov %0, sp;" : "=r" (sp)); - return sp; -} - -/* Functions to set page attributes for Region Protection option in the CPU. - * See Xtensa ISA Reference manual for explanation of arguments (section 4.6.3.2). - */ - -static inline void cpu_write_dtlb(uint32_t vpn, unsigned attr) -{ - asm volatile ("wdtlb %1, %0; dsync\n" :: "r" (vpn), "r" (attr)); -} - - -static inline void cpu_write_itlb(unsigned vpn, unsigned attr) -{ - asm volatile ("witlb %1, %0; isync\n" :: "r" (vpn), "r" (attr)); -} - -/** - * @brief Configure memory region protection - * - * Make page 0 access raise an exception. - * Also protect some other unused pages so we can catch weirdness. - * Useful attribute values: - * 0 — cached, RW - * 2 — bypass cache, RWX (default value after CPU reset) - * 15 — no access, raise exception - */ - -static inline void cpu_configure_region_protection(void) -{ - const uint32_t pages_to_protect[] = {0x00000000, 0x80000000, 0xa0000000, 0xc0000000, 0xe0000000}; - for (int i = 0; i < sizeof(pages_to_protect) / sizeof(pages_to_protect[0]); ++i) { - cpu_write_dtlb(pages_to_protect[i], 0xf); - cpu_write_itlb(pages_to_protect[i], 0xf); - } - cpu_write_dtlb(0x20000000, 0); - cpu_write_itlb(0x20000000, 0); -} - -/** - * @brief Stall CPU using RTC controller - * @param cpu_id ID of the CPU to stall (0 = PRO, 1 = APP) - */ -void esp_cpu_stall(int cpu_id); - -/** - * @brief Un-stall CPU using RTC controller - * @param cpu_id ID of the CPU to un-stall (0 = PRO, 1 = APP) - */ -void esp_cpu_unstall(int cpu_id); - -/** - * @brief Reset CPU using RTC controller - * @param cpu_id ID of the CPU to reset (0 = PRO, 1 = APP) - */ -void esp_cpu_reset(int cpu_id); - - -/** - * @brief Returns true if a JTAG debugger is attached to CPU - * OCD (on chip debug) port. - * - * @note If "Make exception and panic handlers JTAG/OCD aware" - * is disabled, this function always returns false. - */ -bool esp_cpu_in_ocd_debug_mode(void); - -/** - * @brief Convert the PC register value to its true address - * - * The address of the current instruction is not stored as an exact uint32_t - * representation in PC register. This function will convert the value stored in - * the PC register to a uint32_t address. - * - * @param pc_raw The PC as stored in register format. - * - * @return Address in uint32_t format - */ -static inline uint32_t esp_cpu_process_stack_pc(uint32_t pc) -{ - if (pc & 0x80000000) { - //Top two bits of a0 (return address) specify window increment. Overwrite to map to address space. - pc = (pc & 0x3fffffff) | 0x40000000; - } - //Minus 3 to get PC of previous instruction (i.e. instruction executed before return address) - return pc - 3; -} - -typedef uint32_t esp_cpu_ccount_t; - -static inline esp_cpu_ccount_t esp_cpu_get_ccount(void) -{ - uint32_t result; - RSR(CCOUNT, result); - return result; -} diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/io_mux_reg.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/io_mux_reg.h index 4b9057400ca..877a84e757a 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/io_mux_reg.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/io_mux_reg.h @@ -163,6 +163,8 @@ #define SD_DATA1_GPIO_NUM 14 #define SD_DATA2_GPIO_NUM 9 #define SD_DATA3_GPIO_NUM 10 +#define USB_DM_GPIO_NUM 19 +#define USB_DP_GPIO_NUM 20 #define MAX_RTC_GPIO_NUM 21 #define MAX_PAD_GPIO_NUM 48 diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/periph_defs.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/periph_defs.h index c2bb13a80ce..943798d945b 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/periph_defs.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/periph_defs.h @@ -150,7 +150,7 @@ typedef enum { ETS_CACHE_CORE0_ACS_INTR_SOURCE, ETS_CACHE_CORE1_ACS_INTR_SOURCE, ETS_USB_SERIAL_JTAG_INTR_SOURCE, - ETS_PREI_BACKUP_INTR_SOURCE, + ETS_PERI_BACKUP_INTR_SOURCE, ETS_DMA_EXTMEM_REJECT_SOURCE, ETS_MAX_INTR_SOURCE, /**< number of interrupt sources */ } periph_interrput_t; diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc.h index 479e2c2073b..8aab38acb65 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc.h @@ -50,7 +50,10 @@ extern "C" { #define RTC_SLOW_CLK_8MD256_CAL_TIMEOUT_THRES(cycles) (cycles << 12) #define RTC_SLOW_CLK_150K_CAL_TIMEOUT_THRES(cycles) (cycles << 10) -#define RTC_SLOW_CLK_FREQ_150K 150000 +// On esp32s3, RC_SLOW_CLK has a freq of ~136kHz +#define SOC_CLK_RC_SLOW_FREQ_APPROX 136000 +// '150K' does not mean the actual freq, it represents the clock source is RC_SLOW_CLK. RC_SLOW_CLK has a freq of ~150kHz only on esp32. +#define RTC_SLOW_CLK_FREQ_150K SOC_CLK_RC_SLOW_FREQ_APPROX #define RTC_SLOW_CLK_FREQ_8MD256 (RTC_FAST_CLK_FREQ_APPROX / 256) #define RTC_SLOW_CLK_FREQ_32K 32768 @@ -75,7 +78,7 @@ extern "C" { #define DELAY_SLOW_CLK_SWITCH 300 #define DELAY_8M_ENABLE 50 -/* Number of 8M/256 clock cycles to use for XTAL frequency estimation. +/* Number of RC_FAST_D256 clock cycles to use for XTAL frequency estimation. * 10 cycles will take approximately 300 microseconds. */ #define XTAL_FREQ_EST_CYCLES 10 @@ -129,6 +132,19 @@ set sleep_init default param #define RTC_CNTL_PD_CUR_SLEEP_DEFAULT 1 #define RTC_CNTL_DG_VDD_DRV_B_SLP_DEFAULT 0xf +/* +The follow value is used to get a reasonable rtc voltage dbias value according to digital dbias & some other value +storing in efuse +*/ +#define K_RTC_MID_MUL10000 198 +#define K_DIG_MID_MUL10000 211 +#define V_RTC_MID_MUL10000 10181 +#define V_DIG_MID_MUL10000 10841 + +/* +set LDO slave during CPU switch +*/ +#define DEFAULT_LDO_SLAVE 0x7 /** * @brief Possible main XTAL frequency values. @@ -160,7 +176,7 @@ typedef enum { typedef enum { RTC_CPU_FREQ_SRC_XTAL, //!< XTAL RTC_CPU_FREQ_SRC_PLL, //!< PLL (480M or 320M) - RTC_CPU_FREQ_SRC_8M, //!< Internal 8M RTC oscillator + RTC_CPU_FREQ_SRC_8M, //!< Internal 17.5M RC oscillator RTC_CPU_FREQ_SRC_APLL //!< APLL } rtc_cpu_freq_src_t; @@ -178,9 +194,9 @@ typedef struct rtc_cpu_freq_config_s { * @brief RTC SLOW_CLK frequency values */ typedef enum { - RTC_SLOW_FREQ_RTC = 0, //!< Internal 150 kHz RC oscillator + RTC_SLOW_FREQ_RTC = 0, //!< Internal 136 kHz RC oscillator RTC_SLOW_FREQ_32K_XTAL = 1, //!< External 32 kHz XTAL - RTC_SLOW_FREQ_8MD256 = 2, //!< Internal 8 MHz RC oscillator, divided by 256 + RTC_SLOW_FREQ_8MD256 = 2, //!< Internal 17.5 MHz RC oscillator, divided by 256 } rtc_slow_freq_t; /** @@ -188,11 +204,11 @@ typedef enum { */ typedef enum { RTC_FAST_FREQ_XTALD4 = 0, //!< Main XTAL, divided by 4 - RTC_FAST_FREQ_8M = 1, //!< Internal 8 MHz RC oscillator + RTC_FAST_FREQ_8M = 1, //!< Internal 17.5 MHz RC oscillator } rtc_fast_freq_t; -/* With the default value of CK8M_DFREQ, 8M clock frequency is 8.5 MHz +/- 7% */ -#define RTC_FAST_CLK_FREQ_APPROX 8500000 +/* With the default value of CK8M_DFREQ, RTC_FAST clock frequency is 17.5 MHz +/- 7% */ +#define RTC_FAST_CLK_FREQ_APPROX 17500000 #define RTC_CLK_CAL_FRACT 19 //!< Number of fractional bits in values returned by rtc_clk_cal @@ -204,9 +220,9 @@ typedef enum { */ typedef enum { RTC_CAL_RTC_MUX = 0, //!< Currently selected RTC SLOW_CLK - RTC_CAL_8MD256 = 1, //!< Internal 8 MHz RC oscillator, divided by 256 + RTC_CAL_8MD256 = 1, //!< Internal 17.5 MHz RC oscillator, divided by 256 RTC_CAL_32K_XTAL = 2, //!< External 32 kHz XTAL - RTC_CAL_INTERNAL_OSC = 3 //!< Internal 150 kHz oscillator + RTC_CAL_INTERNAL_OSC = 3 //!< Internal 136 kHz oscillator } rtc_cal_sel_t; /** @@ -218,9 +234,9 @@ typedef struct { rtc_fast_freq_t fast_freq : 1; //!< RTC_FAST_CLK frequency to set rtc_slow_freq_t slow_freq : 2; //!< RTC_SLOW_CLK frequency to set uint32_t clk_rtc_clk_div : 8; - uint32_t clk_8m_clk_div : 3; //!< RTC 8M clock divider (division is by clk_8m_div+1, i.e. 0 means 8MHz frequency) - uint32_t slow_clk_dcap : 8; //!< RTC 150k clock adjustment parameter (higher value leads to lower frequency) - uint32_t clk_8m_dfreq : 8; //!< RTC 8m clock adjustment parameter (higher value leads to higher frequency) + uint32_t clk_8m_clk_div : 3; //!< RTC_FAST_CLK source RC_FAST clock divider (division is by clk_8m_div+1, i.e. 0 means ~17.5MHz frequency) + uint32_t slow_clk_dcap : 8; //!< RC_SLOW clock adjustment parameter (higher value leads to lower frequency) + uint32_t clk_8m_dfreq : 8; //!< RC_FAST clock adjustment parameter (higher value leads to higher frequency) } rtc_clk_config_t; /** @@ -346,31 +362,31 @@ bool rtc_clk_32k_enabled(void); void rtc_clk_32k_bootstrap(uint32_t cycle); /** - * @brief Enable or disable 8 MHz internal oscillator + * @brief Enable or disable 17.5 MHz internal oscillator * - * Output from 8 MHz internal oscillator is passed into a configurable + * Output from 17.5 MHz internal oscillator is passed into a configurable * divider, which by default divides the input clock frequency by 256. * Output of the divider may be used as RTC_SLOW_CLK source. * Output of the divider is referred to in register descriptions and code as * 8md256 or simply d256. Divider values other than 256 may be configured, but * this facility is not currently needed, so is not exposed in the code. * - * When 8MHz/256 divided output is not needed, the divider should be disabled + * When RC_FAST_D256 divided output is not needed, the divider should be disabled * to reduce power consumption. * - * @param clk_8m_en true to enable 8MHz generator + * @param clk_8m_en true to enable 17.5MHz generator * @param d256_en true to enable /256 divider */ void rtc_clk_8m_enable(bool clk_8m_en, bool d256_en); /** - * @brief Get the state of 8 MHz internal oscillator + * @brief Get the state of 17.5 MHz internal oscillator * @return true if the oscillator is enabled */ bool rtc_clk_8m_enabled(void); /** - * @brief Get the state of /256 divider which is applied to 8MHz clock + * @brief Get the state of /256 divider which is applied to 17.5MHz clock * @return true if the divided output is enabled */ bool rtc_clk_8md256_enabled(void); @@ -408,9 +424,9 @@ rtc_slow_freq_t rtc_clk_slow_freq_get(void); /** * @brief Get the approximate frequency of RTC_SLOW_CLK, in Hz * - * - if RTC_SLOW_FREQ_RTC is selected, returns ~150000 + * - if RTC_SLOW_FREQ_RTC is selected, returns 136000 * - if RTC_SLOW_FREQ_32K_XTAL is selected, returns 32768 - * - if RTC_SLOW_FREQ_8MD256 is selected, returns ~33000 + * - if RTC_SLOW_FREQ_8MD256 is selected, returns ~68000 * * rtc_clk_cal function can be used to get more precise value by comparing * RTC_SLOW_CLK frequency to the frequency of main XTAL. @@ -519,6 +535,11 @@ uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles); * 32k XTAL is being calibrated, but the oscillator has not started up (due to * incorrect loading capacitance, board design issue, or lack of 32 XTAL on board). * + * @note When 32k CLK is being calibrated, this function will check the accuracy + * of the clock. Since the xtal 32k or ext osc 32k is generally very stable, if + * the check fails, then consider this an invalid 32k clock and return 0. This + * check can filter some jamming signal. + * * @param cal_clk clock to be measured * @param slow_clk_cycles number of slow clock cycles to average * @return average slow clock period in microseconds, Q13.19 fixed point format, @@ -580,22 +601,22 @@ uint64_t rtc_deep_slp_time_get(void); void rtc_clk_wait_for_slow_cycle(void); /** - * @brief Enable the rtc digital 8M clock + * @brief Enable the digital RC_FAST_CLK * - * This function is used to enable the digital rtc 8M clock to support peripherals. - * For enabling the analog 8M clock, using `rtc_clk_8M_enable` function above. + * This function is used to enable the digital RC_FAST clock to support peripherals. + * For enabling the analog 17.5M clock, using `rtc_clk_8M_enable` function above. */ void rtc_dig_clk8m_enable(void); /** - * @brief Disable the rtc digital 8M clock + * @brief Disable the digital RC_FAST_CLK * - * This function is used to disable the digital rtc 8M clock, which is only used to support peripherals. + * This function is used to disable the digital RC_FAST clock, which is only used to support peripherals. */ void rtc_dig_clk8m_disable(void); /** - * @brief Get whether the rtc digital 8M clock is enabled + * @brief Get whether the digital RC_FAST_CLK is enabled */ bool rtc_dig_8m_enabled(void); @@ -651,7 +672,7 @@ typedef struct { uint32_t wifi_pd_en : 1; //!< power down WiFi uint32_t bt_pd_en : 1; //!< power down BT uint32_t cpu_pd_en : 1; //!< power down CPU, but not restart when lightsleep. - uint32_t int_8m_pd_en : 1; //!< Power down Internal 8M oscillator + uint32_t int_8m_pd_en : 1; //!< Power down Internal 17.5M oscillator uint32_t dig_peri_pd_en : 1; //!< power down digital peripherals uint32_t deep_slp : 1; //!< power down digital domain uint32_t wdt_flashboot_mod_en : 1; //!< enable WDT flashboot mode @@ -680,7 +701,7 @@ typedef struct { #define RTC_SLEEP_PD_BT BIT(7) //!< Power down BT #define RTC_SLEEP_PD_CPU BIT(8) //!< Power down CPU when in lightsleep, but not restart #define RTC_SLEEP_PD_DIG_PERIPH BIT(9) //!< Power down DIG peripherals -#define RTC_SLEEP_PD_INT_8M BIT(10) //!< Power down Internal 8M oscillator +#define RTC_SLEEP_PD_INT_8M BIT(10) //!< Power down Internal 17.5M oscillator #define RTC_SLEEP_PD_XTAL BIT(11) //!< Power down main XTAL //These flags are not power domains, but will affect some sleep parameters @@ -807,7 +828,7 @@ uint32_t rtc_deep_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt); * RTC power and clock control initialization settings */ typedef struct { - uint32_t ck8m_wait : 8; //!< Number of rtc_fast_clk cycles to wait for 8M clock to be ready + uint32_t ck8m_wait : 8; //!< Number of rtc_fast_clk cycles to wait for 17.5M clock to be ready uint32_t xtal_wait : 8; //!< Number of rtc_fast_clk cycles to wait for XTAL clock to be ready uint32_t pll_wait : 8; //!< Number of rtc_fast_clk cycles to wait for PLL to be ready uint32_t clkctl_init : 1; //!< Perform clock control related initialization diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_cntl_reg.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_cntl_reg.h index f2a859aed47..8fc99515ecf 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_cntl_reg.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_cntl_reg.h @@ -3683,6 +3683,9 @@ ork.*/ #define RTC_CNTL_DISABLE_RTC_CPU_V 0x1 #define RTC_CNTL_DISABLE_RTC_CPU_S 31 +/* +Due to the LDO slaves, RTC_CNTL_DATE_REG[18:13] can only be used for LDO adjustment. +*/ #define RTC_CNTL_DATE_REG (DR_REG_RTCCNTL_BASE + 0x1FC) /* RTC_CNTL_DATE : R/W ;bitpos:[27:0] ;default: 28'h2101271 ; */ /*description: .*/ @@ -3690,7 +3693,12 @@ ork.*/ #define RTC_CNTL_DATE_M ((RTC_CNTL_DATE_V)<<(RTC_CNTL_DATE_S)) #define RTC_CNTL_DATE_V 0xFFFFFFF #define RTC_CNTL_DATE_S 0 - +/*LDO SLAVE : R/W ;bitpos:[18:13] ; default: 6'd0 ;*/ +/*description: .*/ +#define RTC_CNTL_SLAVE_PD 0x0000003F +#define RTC_CNTL_SLAVE_PD_M ((RTC_CNTL_SLAVE_V)<<(RTC_CNTL_SLAVE_S)) +#define RTC_CNTL_SLAVE_PD_V 0x3F +#define RTC_CNTL_SLAVE_PD_S 13 #ifdef __cplusplus } diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_i2c_reg.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_i2c_reg.h index 3c065af2591..322f28192e2 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_i2c_reg.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/rtc_i2c_reg.h @@ -23,7 +23,7 @@ extern "C" { /** RTC_I2C_SCL_LOW_REG register * configure low scl period */ -#define RTC_I2C_SCL_LOW_REG (DR_REG_RTC_BASE + 0x0) +#define RTC_I2C_SCL_LOW_REG (DR_REG_RTC_I2C_BASE + 0x0) /** RTC_I2C_SCL_LOW_PERIOD_REG : R/W; bitpos: [19:0]; default: 256; * time period that scl =0 */ @@ -35,7 +35,7 @@ extern "C" { /** RTC_I2C_CTRL_REG register * configure i2c ctrl */ -#define RTC_I2C_CTRL_REG (DR_REG_RTC_BASE + 0x4) +#define RTC_I2C_CTRL_REG (DR_REG_RTC_I2C_BASE + 0x4) /** RTC_I2C_SDA_FORCE_OUT : R/W; bitpos: [0]; default: 0; * 1=push pull,0=open drain */ @@ -103,7 +103,7 @@ extern "C" { /** RTC_I2C_STATUS_REG register * get i2c status */ -#define RTC_I2C_STATUS_REG (DR_REG_RTC_BASE + 0x8) +#define RTC_I2C_STATUS_REG (DR_REG_RTC_I2C_BASE + 0x8) /** RTC_I2C_ACK_REC : RO; bitpos: [0]; default: 0; * ack response */ @@ -178,7 +178,7 @@ extern "C" { /** RTC_I2C_TO_REG register * configure time out */ -#define RTC_I2C_TO_REG (DR_REG_RTC_BASE + 0xc) +#define RTC_I2C_TO_REG (DR_REG_RTC_I2C_BASE + 0xc) /** RTC_I2C_TIME_OUT_REG : R/W; bitpos: [19:0]; default: 65536; * time out threshold */ @@ -190,7 +190,7 @@ extern "C" { /** RTC_I2C_SLAVE_ADDR_REG register * configure slave id */ -#define RTC_I2C_SLAVE_ADDR_REG (DR_REG_RTC_BASE + 0x10) +#define RTC_I2C_SLAVE_ADDR_REG (DR_REG_RTC_I2C_BASE + 0x10) /** RTC_I2C_SLAVE_ADDR : R/W; bitpos: [14:0]; default: 0; * slave address */ @@ -209,7 +209,7 @@ extern "C" { /** RTC_I2C_SCL_HIGH_REG register * configure high scl period */ -#define RTC_I2C_SCL_HIGH_REG (DR_REG_RTC_BASE + 0x14) +#define RTC_I2C_SCL_HIGH_REG (DR_REG_RTC_I2C_BASE + 0x14) /** RTC_I2C_SCL_HIGH_PERIOD_REG : R/W; bitpos: [19:0]; default: 256; * time period that scl = 1 */ @@ -221,7 +221,7 @@ extern "C" { /** RTC_I2C_SDA_DUTY_REG register * configure sda duty */ -#define RTC_I2C_SDA_DUTY_REG (DR_REG_RTC_BASE + 0x18) +#define RTC_I2C_SDA_DUTY_REG (DR_REG_RTC_I2C_BASE + 0x18) /** RTC_I2C_SDA_DUTY_NUM : R/W; bitpos: [19:0]; default: 16; * time period for SDA to toggle after SCL goes low */ @@ -233,7 +233,7 @@ extern "C" { /** RTC_I2C_SCL_START_PERIOD_REG register * configure scl start period */ -#define RTC_I2C_SCL_START_PERIOD_REG (DR_REG_RTC_BASE + 0x1c) +#define RTC_I2C_SCL_START_PERIOD_REG (DR_REG_RTC_I2C_BASE + 0x1c) /** RTC_I2C_SCL_START_PERIOD : R/W; bitpos: [19:0]; default: 8; * time period for SCL to toggle after I2C start is triggered */ @@ -245,7 +245,7 @@ extern "C" { /** RTC_I2C_SCL_STOP_PERIOD_REG register * configure scl stop period */ -#define RTC_I2C_SCL_STOP_PERIOD_REG (DR_REG_RTC_BASE + 0x20) +#define RTC_I2C_SCL_STOP_PERIOD_REG (DR_REG_RTC_I2C_BASE + 0x20) /** RTC_I2C_SCL_STOP_PERIOD : R/W; bitpos: [19:0]; default: 8; * time period for SCL to stop after I2C end is triggered */ @@ -257,7 +257,7 @@ extern "C" { /** RTC_I2C_INT_CLR_REG register * interrupt clear register */ -#define RTC_I2C_INT_CLR_REG (DR_REG_RTC_BASE + 0x24) +#define RTC_I2C_INT_CLR_REG (DR_REG_RTC_I2C_BASE + 0x24) /** RTC_I2C_SLAVE_TRAN_COMP_INT_CLR : WO; bitpos: [0]; default: 0; * clear slave transit complete interrupt */ @@ -325,7 +325,7 @@ extern "C" { /** RTC_I2C_INT_RAW_REG register * interrupt raw register */ -#define RTC_I2C_INT_RAW_REG (DR_REG_RTC_BASE + 0x28) +#define RTC_I2C_INT_RAW_REG (DR_REG_RTC_I2C_BASE + 0x28) /** RTC_I2C_SLAVE_TRAN_COMP_INT_RAW : RO; bitpos: [0]; default: 0; * slave transit complete interrupt raw */ @@ -393,7 +393,7 @@ extern "C" { /** RTC_I2C_INT_ST_REG register * interrupt state register */ -#define RTC_I2C_INT_ST_REG (DR_REG_RTC_BASE + 0x2c) +#define RTC_I2C_INT_ST_REG (DR_REG_RTC_I2C_BASE + 0x2c) /** RTC_I2C_SLAVE_TRAN_COMP_INT_ST : RO; bitpos: [0]; default: 0; * slave transit complete interrupt state */ @@ -461,7 +461,7 @@ extern "C" { /** RTC_I2C_INT_ENA_REG register * interrupt enable register */ -#define RTC_I2C_INT_ENA_REG (DR_REG_RTC_BASE + 0x30) +#define RTC_I2C_INT_ENA_REG (DR_REG_RTC_I2C_BASE + 0x30) /** RTC_I2C_SLAVE_TRAN_COMP_INT_ENA : R/W; bitpos: [0]; default: 0; * enable slave transit complete interrupt */ @@ -529,7 +529,7 @@ extern "C" { /** RTC_I2C_DATA_REG register * get i2c data status */ -#define RTC_I2C_DATA_REG (DR_REG_RTC_BASE + 0x34) +#define RTC_I2C_DATA_REG (DR_REG_RTC_I2C_BASE + 0x34) /** RTC_I2C_I2C_RDATA : RO; bitpos: [7:0]; default: 0; * data received */ @@ -555,7 +555,7 @@ extern "C" { /** RTC_I2C_CMD0_REG register * i2c commond0 register */ -#define RTC_I2C_CMD0_REG (DR_REG_RTC_BASE + 0x38) +#define RTC_I2C_CMD0_REG (DR_REG_RTC_I2C_BASE + 0x38) /** RTC_I2C_COMMAND0 : R/W; bitpos: [13:0]; default: 2307; * command0 */ @@ -574,7 +574,7 @@ extern "C" { /** RTC_I2C_CMD1_REG register * i2c commond1 register */ -#define RTC_I2C_CMD1_REG (DR_REG_RTC_BASE + 0x3c) +#define RTC_I2C_CMD1_REG (DR_REG_RTC_I2C_BASE + 0x3c) /** RTC_I2C_COMMAND1 : R/W; bitpos: [13:0]; default: 6401; * command1 */ @@ -593,7 +593,7 @@ extern "C" { /** RTC_I2C_CMD2_REG register * i2c commond2 register */ -#define RTC_I2C_CMD2_REG (DR_REG_RTC_BASE + 0x40) +#define RTC_I2C_CMD2_REG (DR_REG_RTC_I2C_BASE + 0x40) /** RTC_I2C_COMMAND2 : R/W; bitpos: [13:0]; default: 2306; * command2 */ @@ -612,7 +612,7 @@ extern "C" { /** RTC_I2C_CMD3_REG register * i2c commond3 register */ -#define RTC_I2C_CMD3_REG (DR_REG_RTC_BASE + 0x44) +#define RTC_I2C_CMD3_REG (DR_REG_RTC_I2C_BASE + 0x44) /** RTC_I2C_COMMAND3 : R/W; bitpos: [13:0]; default: 257; * command3 */ @@ -631,7 +631,7 @@ extern "C" { /** RTC_I2C_CMD4_REG register * i2c commond4 register */ -#define RTC_I2C_CMD4_REG (DR_REG_RTC_BASE + 0x48) +#define RTC_I2C_CMD4_REG (DR_REG_RTC_I2C_BASE + 0x48) /** RTC_I2C_COMMAND4 : R/W; bitpos: [13:0]; default: 2305; * command4 */ @@ -650,7 +650,7 @@ extern "C" { /** RTC_I2C_CMD5_REG register * i2c commond5_register */ -#define RTC_I2C_CMD5_REG (DR_REG_RTC_BASE + 0x4c) +#define RTC_I2C_CMD5_REG (DR_REG_RTC_I2C_BASE + 0x4c) /** RTC_I2C_COMMAND5 : R/W; bitpos: [13:0]; default: 5889; * command5 */ @@ -669,7 +669,7 @@ extern "C" { /** RTC_I2C_CMD6_REG register * i2c commond6 register */ -#define RTC_I2C_CMD6_REG (DR_REG_RTC_BASE + 0x50) +#define RTC_I2C_CMD6_REG (DR_REG_RTC_I2C_BASE + 0x50) /** RTC_I2C_COMMAND6 : R/W; bitpos: [13:0]; default: 6401; * command6 */ @@ -688,7 +688,7 @@ extern "C" { /** RTC_I2C_CMD7_REG register * i2c commond7 register */ -#define RTC_I2C_CMD7_REG (DR_REG_RTC_BASE + 0x54) +#define RTC_I2C_CMD7_REG (DR_REG_RTC_I2C_BASE + 0x54) /** RTC_I2C_COMMAND7 : R/W; bitpos: [13:0]; default: 2308; * command7 */ @@ -707,7 +707,7 @@ extern "C" { /** RTC_I2C_CMD8_REG register * i2c commond8 register */ -#define RTC_I2C_CMD8_REG (DR_REG_RTC_BASE + 0x58) +#define RTC_I2C_CMD8_REG (DR_REG_RTC_I2C_BASE + 0x58) /** RTC_I2C_COMMAND8 : R/W; bitpos: [13:0]; default: 6401; * command8 */ @@ -726,7 +726,7 @@ extern "C" { /** RTC_I2C_CMD9_REG register * i2c commond9 register */ -#define RTC_I2C_CMD9_REG (DR_REG_RTC_BASE + 0x5c) +#define RTC_I2C_CMD9_REG (DR_REG_RTC_I2C_BASE + 0x5c) /** RTC_I2C_COMMAND9 : R/W; bitpos: [13:0]; default: 2307; * command9 */ @@ -745,7 +745,7 @@ extern "C" { /** RTC_I2C_CMD10_REG register * i2c commond10 register */ -#define RTC_I2C_CMD10_REG (DR_REG_RTC_BASE + 0x60) +#define RTC_I2C_CMD10_REG (DR_REG_RTC_I2C_BASE + 0x60) /** RTC_I2C_COMMAND10 : R/W; bitpos: [13:0]; default: 257; * command10 */ @@ -764,7 +764,7 @@ extern "C" { /** RTC_I2C_CMD11_REG register * i2c commond11 register */ -#define RTC_I2C_CMD11_REG (DR_REG_RTC_BASE + 0x64) +#define RTC_I2C_CMD11_REG (DR_REG_RTC_I2C_BASE + 0x64) /** RTC_I2C_COMMAND11 : R/W; bitpos: [13:0]; default: 2305; * command11 */ @@ -783,7 +783,7 @@ extern "C" { /** RTC_I2C_CMD12_REG register * i2c commond12 register */ -#define RTC_I2C_CMD12_REG (DR_REG_RTC_BASE + 0x68) +#define RTC_I2C_CMD12_REG (DR_REG_RTC_I2C_BASE + 0x68) /** RTC_I2C_COMMAND12 : R/W; bitpos: [13:0]; default: 5889; * command12 */ @@ -802,7 +802,7 @@ extern "C" { /** RTC_I2C_CMD13_REG register * i2c commond13 register */ -#define RTC_I2C_CMD13_REG (DR_REG_RTC_BASE + 0x6c) +#define RTC_I2C_CMD13_REG (DR_REG_RTC_I2C_BASE + 0x6c) /** RTC_I2C_COMMAND13 : R/W; bitpos: [13:0]; default: 6401; * command13 */ @@ -821,7 +821,7 @@ extern "C" { /** RTC_I2C_CMD14_REG register * i2c commond14 register */ -#define RTC_I2C_CMD14_REG (DR_REG_RTC_BASE + 0x70) +#define RTC_I2C_CMD14_REG (DR_REG_RTC_I2C_BASE + 0x70) /** RTC_I2C_COMMAND14 : R/W; bitpos: [13:0]; default: 0; * command14 */ @@ -840,7 +840,7 @@ extern "C" { /** RTC_I2C_CMD15_REG register * i2c commond15 register */ -#define RTC_I2C_CMD15_REG (DR_REG_RTC_BASE + 0x74) +#define RTC_I2C_CMD15_REG (DR_REG_RTC_I2C_BASE + 0x74) /** RTC_I2C_COMMAND15 : R/W; bitpos: [13:0]; default: 0; * command15 */ @@ -859,7 +859,7 @@ extern "C" { /** RTC_I2C_DATE_REG register * version register */ -#define RTC_I2C_DATE_REG (DR_REG_RTC_BASE + 0xfc) +#define RTC_I2C_DATE_REG (DR_REG_RTC_I2C_BASE + 0xfc) /** RTC_I2C_I2C_DATE : R/W; bitpos: [27:0]; default: 26235664; * version */ diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc.h index b16809779a3..f63b3ec7621 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc.h @@ -284,6 +284,10 @@ #define SOC_DIRAM_DRAM_LOW 0x3FC88000 #define SOC_DIRAM_DRAM_HIGH 0x3FCF0000 +#define SOC_I_D_OFFSET (SOC_DIRAM_IRAM_LOW - SOC_DIRAM_DRAM_LOW) +#define MAP_DRAM_TO_IRAM(addr) (addr + SOC_I_D_OFFSET) +#define MAP_IRAM_TO_DRAM(addr) (addr - SOC_I_D_OFFSET) + // Region of memory accessible via DMA in internal memory. See esp_ptr_dma_capable(). #define SOC_DMA_LOW 0x3FC88000 #define SOC_DMA_HIGH 0x3FD00000 @@ -303,7 +307,8 @@ #define SOC_MEM_INTERNAL_HIGH 0x403E2000 // Start (highest address) of ROM boot stack, only relevant during early boot -#define SOC_ROM_STACK_START 0x3fcebf10 +#define SOC_ROM_STACK_START 0x3fceb710 +#define SOC_ROM_STACK_SIZE 0x2000 //interrupt cpu using table, Please see the core-isa.h /************************************************************************************************************* diff --git a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc_caps.h b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc_caps.h index 6234e5c0581..9028c37ac6b 100644 --- a/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc_caps.h +++ b/tools/sdk/esp32s3/include/soc/esp32s3/include/soc/soc_caps.h @@ -58,7 +58,9 @@ /*!< Digital */ #define SOC_ADC_DIGI_CONTROLLER_NUM (2) #define SOC_ADC_PATT_LEN_MAX (24) //Two pattern table, each contains 12 items. Each item takes 1 byte -#define SOC_ADC_DIGI_MAX_BITWIDTH (13) +#define SOC_ADC_DIGI_MAX_BITWIDTH (12) +#define SOC_ADC_DIGI_RESULT_BYTES (4) +#define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4) /*!< F_sample = F_digi_con / 2 / interval. F_digi_con = 5M for now. 30 <= interva <= 4095 */ #define SOC_ADC_SAMPLE_FREQ_THRES_HIGH 83333 #define SOC_ADC_SAMPLE_FREQ_THRES_LOW 611 @@ -179,6 +181,7 @@ #define SOC_LCD_RGB_PANELS (1) /*!< Support one RGB LCD panel */ #define SOC_LCD_I80_BUS_WIDTH (16) /*!< Intel 8080 bus width */ #define SOC_LCD_RGB_DATA_WIDTH (16) /*!< Number of LCD data lines */ +#define SOC_LCD_SUPPORT_RGB_YUV_CONV (1) /*!< Support color format conversion between RGB and YUV */ /*-------------------------- RTC CAPS --------------------------------------*/ #define SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH (128) @@ -206,6 +209,7 @@ #define SOC_SPI_PERIPH_NUM 3 #define SOC_SPI_DMA_CHAN_NUM 3 #define SOC_SPI_PERIPH_CS_NUM(i) 3 +#define SOC_SPI_MAX_CS_NUM 6 #define SOC_SPI_MAXIMUM_BUFFER_SIZE 64 #define SOC_SPI_SUPPORT_DDRCLK 1 #define SOC_SPI_SLAVE_SUPPORT_SEG_TRANS 1 diff --git a/tools/sdk/esp32s3/include/soc/include/soc/spi_periph.h b/tools/sdk/esp32s3/include/soc/include/soc/spi_periph.h index 7aa38650356..d93abf87ef4 100644 --- a/tools/sdk/esp32s3/include/soc/include/soc/spi_periph.h +++ b/tools/sdk/esp32s3/include/soc/include/soc/spi_periph.h @@ -66,7 +66,7 @@ typedef struct { const uint8_t spid6_in; const uint8_t spid7_in; #endif // SOC_SPI_SUPPORT_OCT - const uint8_t spics_out[3]; // /CS GPIO output mux signals + const uint8_t spics_out[SOC_SPI_MAX_CS_NUM]; // /CS GPIO output mux signals const uint8_t spics_in; const uint8_t spidqs_out; const uint8_t spicd_out; diff --git a/tools/sdk/esp32s3/include/spi_flash/include/esp_private/spi_flash_os.h b/tools/sdk/esp32s3/include/spi_flash/include/esp_private/spi_flash_os.h index e73511bc117..996606dbcee 100644 --- a/tools/sdk/esp32s3/include/spi_flash/include/esp_private/spi_flash_os.h +++ b/tools/sdk/esp32s3/include/spi_flash/include/esp_private/spi_flash_os.h @@ -34,11 +34,32 @@ #endif #include "esp_flash.h" #include "hal/spi_flash_hal.h" +#include "soc/soc_caps.h" #ifdef __cplusplus extern "C" { #endif +// Type of MSPI IO +typedef enum { + ESP_MSPI_IO_CLK = 0, + ESP_MSPI_IO_Q, + ESP_MSPI_IO_D, + ESP_MSPI_IO_CS0, /* cs for spi flash */ + ESP_MSPI_IO_HD, + ESP_MSPI_IO_WP, +#if SOC_SPI_MEM_SUPPORT_OPI_MODE + ESP_MSPI_IO_DQS, + ESP_MSPI_IO_D4, + ESP_MSPI_IO_D5, + ESP_MSPI_IO_D6, + ESP_MSPI_IO_D7, +#endif // SOC_SPI_MEM_SUPPORT_OPI_MODE +#if CONFIG_SPIRAM + ESP_MSPI_IO_CS1 /* cs for spi ram */ +#endif +} esp_mspi_io_t; + /** * @brief To setup Flash chip */ @@ -80,6 +101,15 @@ void spi_timing_psram_tuning(void); */ void esp_mspi_pin_init(void); +/** + * @brief Get the number of the GPIO corresponding to the given MSPI io + * + * @param[in] io MSPI io + * + * @return MSPI IO number + */ +uint8_t esp_mspi_get_io(esp_mspi_io_t io); + /** * @brief Set SPI1 registers to make ROM functions work * @note This function is used for setting SPI1 registers to the state that ROM SPI functions work diff --git a/tools/sdk/esp32s3/include/tcp_transport/include/esp_transport.h b/tools/sdk/esp32s3/include/tcp_transport/include/esp_transport.h index 5c7f2f77ed2..979bd7130c8 100644 --- a/tools/sdk/esp32s3/include/tcp_transport/include/esp_transport.h +++ b/tools/sdk/esp32s3/include/tcp_transport/include/esp_transport.h @@ -32,7 +32,7 @@ typedef struct esp_transport_keepalive { int keep_alive_count; /*!< Keep-alive packet retry send count */ } esp_transport_keep_alive_t; -typedef struct esp_transport_internal* esp_transport_list_handle_t; +typedef struct esp_transport_list_t* esp_transport_list_handle_t; typedef struct esp_transport_item_t* esp_transport_handle_t; typedef int (*connect_func)(esp_transport_handle_t t, const char *host, int port, int timeout_ms); @@ -45,6 +45,10 @@ typedef esp_transport_handle_t (*payload_transfer_func)(esp_transport_handle_t); typedef struct esp_tls_last_error* esp_tls_error_handle_t; +/** + * @brief Error types for TCP connection issues not covered in socket's errno + */ + /** * @brief Create transport list * @@ -340,6 +344,7 @@ esp_tls_error_handle_t esp_transport_get_error_handle(esp_transport_handle_t t); */ int esp_transport_get_errno(esp_transport_handle_t t); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s3/include/ulp/include/esp32s3/ulp_riscv_adc.h b/tools/sdk/esp32s3/include/ulp/include/esp32s3/ulp_riscv_adc.h new file mode 100644 index 00000000000..27f53efbfa0 --- /dev/null +++ b/tools/sdk/esp32s3/include/ulp/include/esp32s3/ulp_riscv_adc.h @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "hal/adc_types.h" +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + adc_channel_t channel; // ADC channel + adc_atten_t atten; // ADC channel attenuation + adc_bits_width_t width; // ADC bit width, only used for ADC unit 1 +} ulp_riscv_adc_cfg_t; // ULP Riscv ADC configuration parameters + +/** + * @brief Initialize and calibrate the ADC1 for use by ULP RISCV + * + * @param cfg Configuration parameters + * @return esp_err_t ESP_OK for successful. + */ +esp_err_t ulp_riscv_adc_init(const ulp_riscv_adc_cfg_t *cfg); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s3/include/wpa_supplicant/port/include/supplicant_opt.h b/tools/sdk/esp32s3/include/wpa_supplicant/port/include/supplicant_opt.h index 59b428d5462..da753327694 100644 --- a/tools/sdk/esp32s3/include/wpa_supplicant/port/include/supplicant_opt.h +++ b/tools/sdk/esp32s3/include/wpa_supplicant/port/include/supplicant_opt.h @@ -29,9 +29,6 @@ #define DEBUG_PRINT #endif -#if CONFIG_WPA_11KV_SUPPORT -#define ROAMING_SUPPORT 1 -#endif #if CONFIG_WPA_SCAN_CACHE #define SCAN_CACHE_SUPPORTED diff --git a/tools/sdk/esp32s3/include/xtensa/include/xt_instr_macros.h b/tools/sdk/esp32s3/include/xtensa/include/xt_instr_macros.h index e7931f4bf41..efcdbd4a78c 100644 --- a/tools/sdk/esp32s3/include/xtensa/include/xt_instr_macros.h +++ b/tools/sdk/esp32s3/include/xtensa/include/xt_instr_macros.h @@ -1,19 +1,13 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#include "xtensa/xtruntime.h" + #define RSR(reg, at) asm volatile ("rsr %0, %1" : "=r" (at) : "i" (reg)) #define WSR(reg, at) asm volatile ("wsr %0, %1" : : "r" (at), "i" (reg)) #define XSR(reg, at) asm volatile ("xsr %0, %1" : "+r" (at) : "i" (reg)) @@ -23,14 +17,27 @@ #define WITLB(at, as) asm volatile ("witlb %0, %1; \n isync \n " : : "r" (at), "r" (as)) #define WDTLB(at, as) asm volatile ("wdtlb %0, %1; \n dsync \n " : : "r" (at), "r" (as)) +#define EXTRA_SAVE_AREA_SIZE 32 +#define BASE_SAVE_AREA_SIZE 16 +#define SAVE_AREA_OFFSET (EXTRA_SAVE_AREA_SIZE + BASE_SAVE_AREA_SIZE) +#define BASE_AREA_SP_OFFSET 12 + /* The SET_STACK implements a setting a new stack pointer (sp or a1). * to do this the need reset PS_WOE, reset WINDOWSTART, update SP, and return PS_WOE. * + * In addition, if a windowOverflow8/12 happens the exception handler expects to be able to look at + * the previous frames stackpointer to find the extra save area. So this function will reserve space + * for this area as well as initialise the previous sp that points to it + * * Note: It has 2 implementations one for using in assembler files (*.S) and one for using in C. * * C code prototype for SET_STACK: * uint32_t ps_reg; * uint32_t w_base; + * + * uint32_t sp = (uint32_t)new_sp - SAVE_AREA_OFFSET; \ + *(uint32_t*)(sp - 12) = (uint32_t)new_sp; \ + * RSR(PS, ps_reg); * ps_reg &= ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK); * WSR(PS, ps_reg); @@ -46,6 +53,10 @@ */ #ifdef __ASSEMBLER__ .macro SET_STACK new_sp tmp1 tmp2 + addi tmp1, new_sp, -SAVE_AREA_OFFSET + addi tmp2, tmp1, -BASE_AREA_SP_OFFSET + s32i new_sp, tmp2, 0 + addi new_sp, tmp1, 0 rsr.ps \tmp1 movi \tmp2, ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK) and \tmp1, \tmp1, \tmp2 @@ -68,8 +79,11 @@ rsync .endm #else + #define SET_STACK(new_sp) \ do { \ + uint32_t sp = (uint32_t)new_sp - SAVE_AREA_OFFSET; \ + *(uint32_t*)(sp - BASE_AREA_SP_OFFSET) = (uint32_t)new_sp; \ uint32_t tmp1 = 0, tmp2 = 0; \ asm volatile ( \ "rsr.ps %1 \n"\ @@ -93,6 +107,6 @@ "or %1, %1, %2 \n"\ "wsr.ps %1 \n"\ "rsync \n"\ - : "+r"(new_sp), "+r"(tmp1), "+r"(tmp2)); \ + : "+r"(sp), "+r"(tmp1), "+r"(tmp2)); \ } while (0); #endif // __ASSEMBLER__ diff --git a/tools/sdk/esp32s3/include/xtensa/include/xtensa-debug-module.h b/tools/sdk/esp32s3/include/xtensa/include/xtensa-debug-module.h index d1aca40d5b7..17e5a2e3557 100644 --- a/tools/sdk/esp32s3/include/xtensa/include/xtensa-debug-module.h +++ b/tools/sdk/esp32s3/include/xtensa/include/xtensa-debug-module.h @@ -1,6 +1,8 @@ #ifndef XTENSA_DEBUG_MODULE_H #define XTENSA_DEBUG_MODULE_H +#include + /* ERI registers / OCD offsets and field definitions */ diff --git a/tools/sdk/esp32s3/ld/esp32s3.rom.ld b/tools/sdk/esp32s3/ld/esp32s3.rom.ld index e3dc51463ea..7259d1b452f 100644 --- a/tools/sdk/esp32s3/ld/esp32s3.rom.ld +++ b/tools/sdk/esp32s3/ld/esp32s3.rom.ld @@ -1804,7 +1804,7 @@ RC_GetBlockAckTime = 0x4000525c; ebuf_list_remove = 0x40005268; esf_buf_alloc = 0x40005274; esf_buf_alloc_dynamic = 0x40005280; -esf_buf_recycle = 0x4000528c; +/*esf_buf_recycle = 0x4000528c;*/ GetAccess = 0x40005298; hal_mac_is_low_rate_enabled = 0x400052a4; hal_mac_tx_get_blockack = 0x400052b0; @@ -1850,7 +1850,7 @@ pm_set_beacon_filter = 0x40005484; pm_is_in_wifi_slice_threshold = 0x40005490; pm_is_waked = 0x4000549c; pm_keep_alive = 0x400054a8; -pm_on_beacon_rx = 0x400054b4; +/* pm_on_beacon_rx = 0x400054b4; */ pm_on_data_rx = 0x400054c0; pm_on_tbtt = 0x400054cc; pm_parse_beacon = 0x400054d8; @@ -1859,7 +1859,7 @@ pm_process_tim = 0x400054e4; pm_rx_data_process = 0x400054fc; /*pm_sleep = 0x40005508;*/ pm_sleep_for = 0x40005514; -pm_tbtt_process = 0x40005520; +/* pm_tbtt_process = 0x40005520; */ ppAMPDU2Normal = 0x4000552c; ppAssembleAMPDU = 0x40005538; ppCalFrameTimes = 0x40005544; @@ -1890,7 +1890,7 @@ ppSearchTxQueue = 0x40005670; ppSearchTxframe = 0x4000567c; ppSelectNextQueue = 0x40005688; ppSubFromAMPDU = 0x40005694; -ppTask = 0x400056a0; +/* ppTask = 0x400056a0; */ ppTxPkt = 0x400056ac; ppTxProtoProc = 0x400056b8; ppTxqUpdateBitmap = 0x400056c4; @@ -1942,7 +1942,7 @@ wdev_mac_special_reg_store = 0x400058e0; wdev_mac_wakeup = 0x400058ec; wdev_mac_sleep = 0x400058f8; hal_mac_is_dma_enable = 0x40005904; -wDev_ProcessFiq = 0x40005910; +/* wDev_ProcessFiq = 0x40005910; */ wDev_ProcessRxSucData = 0x4000591c; wdevProcessRxSucDataAll = 0x40005928; wdev_csi_len_align = 0x40005934; diff --git a/tools/sdk/esp32s3/ld/libbtdm_app.a b/tools/sdk/esp32s3/ld/libbtdm_app.a index 7bcc56d1b25..1981e575b76 100644 Binary files a/tools/sdk/esp32s3/ld/libbtdm_app.a and b/tools/sdk/esp32s3/ld/libbtdm_app.a differ diff --git a/tools/sdk/esp32s3/ld/libc_speech_features.a b/tools/sdk/esp32s3/ld/libc_speech_features.a index 9a0bfcdaf33..a5bffe2e636 100644 Binary files a/tools/sdk/esp32s3/ld/libc_speech_features.a and b/tools/sdk/esp32s3/ld/libc_speech_features.a differ diff --git a/tools/sdk/esp32s3/ld/libcat_face_detect.a b/tools/sdk/esp32s3/ld/libcat_face_detect.a index d02a60713ba..d21ea79c800 100644 Binary files a/tools/sdk/esp32s3/ld/libcat_face_detect.a and b/tools/sdk/esp32s3/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32s3/ld/libcolor_detect.a b/tools/sdk/esp32s3/ld/libcolor_detect.a index 563b575e0f6..88fdaf4f9b8 100644 Binary files a/tools/sdk/esp32s3/ld/libcolor_detect.a and b/tools/sdk/esp32s3/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32s3/ld/libdl.a b/tools/sdk/esp32s3/ld/libdl.a index 99d593fd1ee..76abdd52e36 100644 Binary files a/tools/sdk/esp32s3/ld/libdl.a and b/tools/sdk/esp32s3/ld/libdl.a differ diff --git a/tools/sdk/esp32s3/ld/libdl_lib.a b/tools/sdk/esp32s3/ld/libdl_lib.a index be7b121be2e..18e31309558 100644 Binary files a/tools/sdk/esp32s3/ld/libdl_lib.a and b/tools/sdk/esp32s3/ld/libdl_lib.a differ diff --git a/tools/sdk/esp32s3/ld/libesp-dsp.a b/tools/sdk/esp32s3/ld/libesp-dsp.a new file mode 100644 index 00000000000..3dd4511018d Binary files /dev/null and b/tools/sdk/esp32s3/ld/libesp-dsp.a differ diff --git a/tools/sdk/esp32s3/ld/libesp_tts_chinese.a b/tools/sdk/esp32s3/ld/libesp_tts_chinese.a index f9749dd0fc8..53521ac069c 100644 Binary files a/tools/sdk/esp32s3/ld/libesp_tts_chinese.a and b/tools/sdk/esp32s3/ld/libesp_tts_chinese.a differ diff --git a/tools/sdk/esp32s3/ld/libhuman_face_detect.a b/tools/sdk/esp32s3/ld/libhuman_face_detect.a index 3da8016abc1..43e24e99a28 100644 Binary files a/tools/sdk/esp32s3/ld/libhuman_face_detect.a and b/tools/sdk/esp32s3/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32s3/ld/libmfn.a b/tools/sdk/esp32s3/ld/libmfn.a index beccb735b1a..1c2a47a8e64 100644 Binary files a/tools/sdk/esp32s3/ld/libmfn.a and b/tools/sdk/esp32s3/ld/libmfn.a differ diff --git a/tools/sdk/esp32s3/ld/libvoice_set_xiaole.a b/tools/sdk/esp32s3/ld/libvoice_set_xiaole.a index 6461b08ad46..0291e6a7b98 100644 Binary files a/tools/sdk/esp32s3/ld/libvoice_set_xiaole.a and b/tools/sdk/esp32s3/ld/libvoice_set_xiaole.a differ diff --git a/tools/sdk/esp32s3/lib/libapp_trace.a b/tools/sdk/esp32s3/lib/libapp_trace.a index 50cafa63fbc..478c9d0d86f 100644 Binary files a/tools/sdk/esp32s3/lib/libapp_trace.a and b/tools/sdk/esp32s3/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32s3/lib/libapp_update.a b/tools/sdk/esp32s3/lib/libapp_update.a index 687c8215169..1ce5a286803 100644 Binary files a/tools/sdk/esp32s3/lib/libapp_update.a and b/tools/sdk/esp32s3/lib/libapp_update.a differ diff --git a/tools/sdk/esp32s3/lib/libarduino_tinyusb.a b/tools/sdk/esp32s3/lib/libarduino_tinyusb.a index f4c7c4cf718..22c6413bde5 100644 Binary files a/tools/sdk/esp32s3/lib/libarduino_tinyusb.a and b/tools/sdk/esp32s3/lib/libarduino_tinyusb.a differ diff --git a/tools/sdk/esp32s3/lib/libasio.a b/tools/sdk/esp32s3/lib/libasio.a index f4a51a5336a..11bd48fb018 100644 Binary files a/tools/sdk/esp32s3/lib/libasio.a and b/tools/sdk/esp32s3/lib/libasio.a differ diff --git a/tools/sdk/esp32s3/lib/libbt.a b/tools/sdk/esp32s3/lib/libbt.a index cd258ea1af1..30a961396fc 100644 Binary files a/tools/sdk/esp32s3/lib/libbt.a and b/tools/sdk/esp32s3/lib/libbt.a differ diff --git a/tools/sdk/esp32s3/lib/libcbor.a b/tools/sdk/esp32s3/lib/libcbor.a index dedc967bc48..b1ed52b2970 100644 Binary files a/tools/sdk/esp32s3/lib/libcbor.a and b/tools/sdk/esp32s3/lib/libcbor.a differ diff --git a/tools/sdk/esp32s3/lib/libcmock.a b/tools/sdk/esp32s3/lib/libcmock.a index 75808b38cab..5b64ec60081 100644 Binary files a/tools/sdk/esp32s3/lib/libcmock.a and b/tools/sdk/esp32s3/lib/libcmock.a differ diff --git a/tools/sdk/esp32s3/lib/libcoap.a b/tools/sdk/esp32s3/lib/libcoap.a index d8ed8d8e9d5..bd66a1583e1 100644 Binary files a/tools/sdk/esp32s3/lib/libcoap.a and b/tools/sdk/esp32s3/lib/libcoap.a differ diff --git a/tools/sdk/esp32s3/lib/libcoexist.a b/tools/sdk/esp32s3/lib/libcoexist.a index 65da06cb8ee..51efa9db0a4 100644 Binary files a/tools/sdk/esp32s3/lib/libcoexist.a and b/tools/sdk/esp32s3/lib/libcoexist.a differ diff --git a/tools/sdk/esp32s3/lib/libconsole.a b/tools/sdk/esp32s3/lib/libconsole.a index 7bfe0b3e708..6aba93836f5 100644 Binary files a/tools/sdk/esp32s3/lib/libconsole.a and b/tools/sdk/esp32s3/lib/libconsole.a differ diff --git a/tools/sdk/esp32s3/lib/libcore.a b/tools/sdk/esp32s3/lib/libcore.a index 1e43e7c89a7..85019bb2d9f 100644 Binary files a/tools/sdk/esp32s3/lib/libcore.a and b/tools/sdk/esp32s3/lib/libcore.a differ diff --git a/tools/sdk/esp32s3/lib/libcxx.a b/tools/sdk/esp32s3/lib/libcxx.a index 529147f6049..0039cb7662b 100644 Binary files a/tools/sdk/esp32s3/lib/libcxx.a and b/tools/sdk/esp32s3/lib/libcxx.a differ diff --git a/tools/sdk/esp32s3/lib/libdriver.a b/tools/sdk/esp32s3/lib/libdriver.a index ac90017ef21..ddf2530b401 100644 Binary files a/tools/sdk/esp32s3/lib/libdriver.a and b/tools/sdk/esp32s3/lib/libdriver.a differ diff --git a/tools/sdk/esp32s3/lib/libefuse.a b/tools/sdk/esp32s3/lib/libefuse.a index 34dbdb84918..c7a02b5768e 100644 Binary files a/tools/sdk/esp32s3/lib/libefuse.a and b/tools/sdk/esp32s3/lib/libefuse.a differ diff --git a/tools/sdk/esp32s3/lib/libesp-dsp.a b/tools/sdk/esp32s3/lib/libesp-dsp.a index 1d654f61753..000c832fe74 100644 Binary files a/tools/sdk/esp32s3/lib/libesp-dsp.a and b/tools/sdk/esp32s3/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32s3/lib/libesp-sr.a b/tools/sdk/esp32s3/lib/libesp-sr.a index 51d6dedfe36..e57506eb3d6 100644 Binary files a/tools/sdk/esp32s3/lib/libesp-sr.a and b/tools/sdk/esp32s3/lib/libesp-sr.a differ diff --git a/tools/sdk/esp32s3/lib/libesp-tls.a b/tools/sdk/esp32s3/lib/libesp-tls.a index 0ecfff20a8a..bde9487cd7f 100644 Binary files a/tools/sdk/esp32s3/lib/libesp-tls.a and b/tools/sdk/esp32s3/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32s3/lib/libesp32-camera.a b/tools/sdk/esp32s3/lib/libesp32-camera.a index dde00f2d08e..3bcbd92bbb1 100644 Binary files a/tools/sdk/esp32s3/lib/libesp32-camera.a and b/tools/sdk/esp32s3/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_adc_cal.a b/tools/sdk/esp32s3/lib/libesp_adc_cal.a index 6fe50fd845b..1ec6a78ac6d 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_adc_cal.a and b/tools/sdk/esp32s3/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_audio_front_end.a b/tools/sdk/esp32s3/lib/libesp_audio_front_end.a index 15968000a9e..b78f84f474d 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_audio_front_end.a and b/tools/sdk/esp32s3/lib/libesp_audio_front_end.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_audio_processor.a b/tools/sdk/esp32s3/lib/libesp_audio_processor.a index 503bd902a8d..7f2271fc5ec 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_audio_processor.a and b/tools/sdk/esp32s3/lib/libesp_audio_processor.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_common.a b/tools/sdk/esp32s3/lib/libesp_common.a index d6cfe2cdb04..89180be84a2 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_common.a and b/tools/sdk/esp32s3/lib/libesp_common.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_eth.a b/tools/sdk/esp32s3/lib/libesp_eth.a index 895f4a832c4..5f073d67b54 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_eth.a and b/tools/sdk/esp32s3/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_event.a b/tools/sdk/esp32s3/lib/libesp_event.a index 82d8f7a8329..63b6c681331 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_event.a and b/tools/sdk/esp32s3/lib/libesp_event.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_gdbstub.a b/tools/sdk/esp32s3/lib/libesp_gdbstub.a index 63b1153c4d5..5866efbe3fd 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_gdbstub.a and b/tools/sdk/esp32s3/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_hid.a b/tools/sdk/esp32s3/lib/libesp_hid.a index 1495c8b0289..c130db20ef0 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_hid.a and b/tools/sdk/esp32s3/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_http_client.a b/tools/sdk/esp32s3/lib/libesp_http_client.a index 01cd73c2178..40f848ac297 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_http_client.a and b/tools/sdk/esp32s3/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_http_server.a b/tools/sdk/esp32s3/lib/libesp_http_server.a index 2f210f2712b..55dcd914159 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_http_server.a and b/tools/sdk/esp32s3/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_https_ota.a b/tools/sdk/esp32s3/lib/libesp_https_ota.a index bf5fd109af9..efea68f5973 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_https_ota.a and b/tools/sdk/esp32s3/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_https_server.a b/tools/sdk/esp32s3/lib/libesp_https_server.a index 833288e913c..1741ed3fea9 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_https_server.a and b/tools/sdk/esp32s3/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_ipc.a b/tools/sdk/esp32s3/lib/libesp_ipc.a index c4f9d111902..25c496bed1d 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_ipc.a and b/tools/sdk/esp32s3/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_lcd.a b/tools/sdk/esp32s3/lib/libesp_lcd.a index 76a1e618fcf..73269adfcfb 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_lcd.a and b/tools/sdk/esp32s3/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_littlefs.a b/tools/sdk/esp32s3/lib/libesp_littlefs.a index d9d3b52333f..39058b5c7f0 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_littlefs.a and b/tools/sdk/esp32s3/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_local_ctrl.a b/tools/sdk/esp32s3/lib/libesp_local_ctrl.a index 1fe6af4bd22..4b2b6b5e511 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_local_ctrl.a and b/tools/sdk/esp32s3/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_netif.a b/tools/sdk/esp32s3/lib/libesp_netif.a index ff90e45ef97..e1626fb26ed 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_netif.a and b/tools/sdk/esp32s3/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_phy.a b/tools/sdk/esp32s3/lib/libesp_phy.a index 3e963824ef2..71017e9c8bf 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_phy.a and b/tools/sdk/esp32s3/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_pm.a b/tools/sdk/esp32s3/lib/libesp_pm.a index f4e4cf9f549..76ea0acdf8f 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_pm.a and b/tools/sdk/esp32s3/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_rainmaker.a b/tools/sdk/esp32s3/lib/libesp_rainmaker.a index 84d74d2d862..2db4e1b4485 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_rainmaker.a and b/tools/sdk/esp32s3/lib/libesp_rainmaker.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_ringbuf.a b/tools/sdk/esp32s3/lib/libesp_ringbuf.a index 85a3c1a729d..014ccd9ec6f 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_ringbuf.a and b/tools/sdk/esp32s3/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_rom.a b/tools/sdk/esp32s3/lib/libesp_rom.a index f3a95165993..5db4c731d8f 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_rom.a and b/tools/sdk/esp32s3/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_schedule.a b/tools/sdk/esp32s3/lib/libesp_schedule.a index 0b3b59c1acb..0aed857be87 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_schedule.a and b/tools/sdk/esp32s3/lib/libesp_schedule.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_serial_slave_link.a b/tools/sdk/esp32s3/lib/libesp_serial_slave_link.a index 532e730c993..062a8e2b6c3 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32s3/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_timer.a b/tools/sdk/esp32s3/lib/libesp_timer.a index 37c11f02026..c5814981e94 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_timer.a and b/tools/sdk/esp32s3/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_websocket_client.a b/tools/sdk/esp32s3/lib/libesp_websocket_client.a index a8502fe4e28..af71b4e5200 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_websocket_client.a and b/tools/sdk/esp32s3/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32s3/lib/libesp_wifi.a b/tools/sdk/esp32s3/lib/libesp_wifi.a index 96a7bbb6876..e58eb9b0afa 100644 Binary files a/tools/sdk/esp32s3/lib/libesp_wifi.a and b/tools/sdk/esp32s3/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32s3/lib/libespcoredump.a b/tools/sdk/esp32s3/lib/libespcoredump.a index 0bbba3277a6..b268f09455b 100644 Binary files a/tools/sdk/esp32s3/lib/libespcoredump.a and b/tools/sdk/esp32s3/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32s3/lib/libespnow.a b/tools/sdk/esp32s3/lib/libespnow.a index db1a5caa8c7..a151f90b7eb 100644 Binary files a/tools/sdk/esp32s3/lib/libespnow.a and b/tools/sdk/esp32s3/lib/libespnow.a differ diff --git a/tools/sdk/esp32s3/lib/libexpat.a b/tools/sdk/esp32s3/lib/libexpat.a index cdd15b8b146..eee5157a1f2 100644 Binary files a/tools/sdk/esp32s3/lib/libexpat.a and b/tools/sdk/esp32s3/lib/libexpat.a differ diff --git a/tools/sdk/esp32s3/lib/libfatfs.a b/tools/sdk/esp32s3/lib/libfatfs.a index 72aae0884a3..11c31ff35a8 100644 Binary files a/tools/sdk/esp32s3/lib/libfatfs.a and b/tools/sdk/esp32s3/lib/libfatfs.a differ diff --git a/tools/sdk/esp32s3/lib/libfb_gfx.a b/tools/sdk/esp32s3/lib/libfb_gfx.a index 50fc5b069a8..1118b6f5680 100644 Binary files a/tools/sdk/esp32s3/lib/libfb_gfx.a and b/tools/sdk/esp32s3/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32s3/lib/libfreemodbus.a b/tools/sdk/esp32s3/lib/libfreemodbus.a index 6b386964dc3..7eb59357f9c 100644 Binary files a/tools/sdk/esp32s3/lib/libfreemodbus.a and b/tools/sdk/esp32s3/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32s3/lib/libgpio_button.a b/tools/sdk/esp32s3/lib/libgpio_button.a index 120689d1020..efd7f57c978 100644 Binary files a/tools/sdk/esp32s3/lib/libgpio_button.a and b/tools/sdk/esp32s3/lib/libgpio_button.a differ diff --git a/tools/sdk/esp32s3/lib/libhal.a b/tools/sdk/esp32s3/lib/libhal.a index 5748ebf850d..0d559ddf767 100644 Binary files a/tools/sdk/esp32s3/lib/libhal.a and b/tools/sdk/esp32s3/lib/libhal.a differ diff --git a/tools/sdk/esp32s3/lib/libheap.a b/tools/sdk/esp32s3/lib/libheap.a index e5650c53093..bfdd7b1dad1 100644 Binary files a/tools/sdk/esp32s3/lib/libheap.a and b/tools/sdk/esp32s3/lib/libheap.a differ diff --git a/tools/sdk/esp32s3/lib/libhufzip.a b/tools/sdk/esp32s3/lib/libhufzip.a index 01d110bc4b0..38dfe122708 100644 Binary files a/tools/sdk/esp32s3/lib/libhufzip.a and b/tools/sdk/esp32s3/lib/libhufzip.a differ diff --git a/tools/sdk/esp32s3/lib/libjsmn.a b/tools/sdk/esp32s3/lib/libjsmn.a index d390c7beb89..14343e7dc7e 100644 Binary files a/tools/sdk/esp32s3/lib/libjsmn.a and b/tools/sdk/esp32s3/lib/libjsmn.a differ diff --git a/tools/sdk/esp32s3/lib/libjson.a b/tools/sdk/esp32s3/lib/libjson.a index ac0e6fbac3b..b4a93744c91 100644 Binary files a/tools/sdk/esp32s3/lib/libjson.a and b/tools/sdk/esp32s3/lib/libjson.a differ diff --git a/tools/sdk/esp32s3/lib/libjson_generator.a b/tools/sdk/esp32s3/lib/libjson_generator.a index 1416ad3b10e..8d25faaea1a 100644 Binary files a/tools/sdk/esp32s3/lib/libjson_generator.a and b/tools/sdk/esp32s3/lib/libjson_generator.a differ diff --git a/tools/sdk/esp32s3/lib/libjson_parser.a b/tools/sdk/esp32s3/lib/libjson_parser.a index b58c20edba2..0db8f3a37c3 100644 Binary files a/tools/sdk/esp32s3/lib/libjson_parser.a and b/tools/sdk/esp32s3/lib/libjson_parser.a differ diff --git a/tools/sdk/esp32s3/lib/liblibsodium.a b/tools/sdk/esp32s3/lib/liblibsodium.a index 782ed6d68ef..0e1aa3f6326 100644 Binary files a/tools/sdk/esp32s3/lib/liblibsodium.a and b/tools/sdk/esp32s3/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32s3/lib/liblog.a b/tools/sdk/esp32s3/lib/liblog.a index 1ab3549f5d7..38ac4b581ff 100644 Binary files a/tools/sdk/esp32s3/lib/liblog.a and b/tools/sdk/esp32s3/lib/liblog.a differ diff --git a/tools/sdk/esp32s3/lib/liblwip.a b/tools/sdk/esp32s3/lib/liblwip.a index 049353326be..32fad5c9552 100644 Binary files a/tools/sdk/esp32s3/lib/liblwip.a and b/tools/sdk/esp32s3/lib/liblwip.a differ diff --git a/tools/sdk/esp32s3/lib/libmbedcrypto.a b/tools/sdk/esp32s3/lib/libmbedcrypto.a index e1c802a8bb4..dd7ab4a452d 100644 Binary files a/tools/sdk/esp32s3/lib/libmbedcrypto.a and b/tools/sdk/esp32s3/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32s3/lib/libmbedtls.a b/tools/sdk/esp32s3/lib/libmbedtls.a index 24f40c8b6a1..9a93d307596 100644 Binary files a/tools/sdk/esp32s3/lib/libmbedtls.a and b/tools/sdk/esp32s3/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32s3/lib/libmbedtls_2.a b/tools/sdk/esp32s3/lib/libmbedtls_2.a index 682c912e19f..0bf5b91c3bf 100644 Binary files a/tools/sdk/esp32s3/lib/libmbedtls_2.a and b/tools/sdk/esp32s3/lib/libmbedtls_2.a differ diff --git a/tools/sdk/esp32s3/lib/libmbedx509.a b/tools/sdk/esp32s3/lib/libmbedx509.a index 712a59e2a3f..3b92fd1c38d 100644 Binary files a/tools/sdk/esp32s3/lib/libmbedx509.a and b/tools/sdk/esp32s3/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32s3/lib/libmdns.a b/tools/sdk/esp32s3/lib/libmdns.a index 213cec5d63a..35f9dc6f175 100644 Binary files a/tools/sdk/esp32s3/lib/libmdns.a and b/tools/sdk/esp32s3/lib/libmdns.a differ diff --git a/tools/sdk/esp32s3/lib/libmesh.a b/tools/sdk/esp32s3/lib/libmesh.a index a03894c39de..890e314beaa 100644 Binary files a/tools/sdk/esp32s3/lib/libmesh.a and b/tools/sdk/esp32s3/lib/libmesh.a differ diff --git a/tools/sdk/esp32s3/lib/libmqtt.a b/tools/sdk/esp32s3/lib/libmqtt.a index 03976837883..ad027213653 100644 Binary files a/tools/sdk/esp32s3/lib/libmqtt.a and b/tools/sdk/esp32s3/lib/libmqtt.a differ diff --git a/tools/sdk/esp32s3/lib/libmultinet.a b/tools/sdk/esp32s3/lib/libmultinet.a index 38106415920..55683270c79 100644 Binary files a/tools/sdk/esp32s3/lib/libmultinet.a and b/tools/sdk/esp32s3/lib/libmultinet.a differ diff --git a/tools/sdk/esp32s3/lib/libnet80211.a b/tools/sdk/esp32s3/lib/libnet80211.a index 62170654f6a..d32a1716ac5 100644 Binary files a/tools/sdk/esp32s3/lib/libnet80211.a and b/tools/sdk/esp32s3/lib/libnet80211.a differ diff --git a/tools/sdk/esp32s3/lib/libnewlib.a b/tools/sdk/esp32s3/lib/libnewlib.a index 2fab14d9247..9ea842c8cba 100644 Binary files a/tools/sdk/esp32s3/lib/libnewlib.a and b/tools/sdk/esp32s3/lib/libnewlib.a differ diff --git a/tools/sdk/esp32s3/lib/libnghttp.a b/tools/sdk/esp32s3/lib/libnghttp.a index fe768cdc6b1..565fca56722 100644 Binary files a/tools/sdk/esp32s3/lib/libnghttp.a and b/tools/sdk/esp32s3/lib/libnghttp.a differ diff --git a/tools/sdk/esp32s3/lib/libnvs_flash.a b/tools/sdk/esp32s3/lib/libnvs_flash.a index 395da7266b4..78c3342f569 100644 Binary files a/tools/sdk/esp32s3/lib/libnvs_flash.a and b/tools/sdk/esp32s3/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32s3/lib/libopenssl.a b/tools/sdk/esp32s3/lib/libopenssl.a index 1af1d16a728..409188e8cb3 100644 Binary files a/tools/sdk/esp32s3/lib/libopenssl.a and b/tools/sdk/esp32s3/lib/libopenssl.a differ diff --git a/tools/sdk/esp32s3/lib/libperfmon.a b/tools/sdk/esp32s3/lib/libperfmon.a index eb599083ba5..37878c5f03f 100644 Binary files a/tools/sdk/esp32s3/lib/libperfmon.a and b/tools/sdk/esp32s3/lib/libperfmon.a differ diff --git a/tools/sdk/esp32s3/lib/libpp.a b/tools/sdk/esp32s3/lib/libpp.a index 601e39dbca2..9f96fa5c2b3 100644 Binary files a/tools/sdk/esp32s3/lib/libpp.a and b/tools/sdk/esp32s3/lib/libpp.a differ diff --git a/tools/sdk/esp32s3/lib/libprotobuf-c.a b/tools/sdk/esp32s3/lib/libprotobuf-c.a index 0a109896048..4651a18fb4b 100644 Binary files a/tools/sdk/esp32s3/lib/libprotobuf-c.a and b/tools/sdk/esp32s3/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32s3/lib/libprotocomm.a b/tools/sdk/esp32s3/lib/libprotocomm.a index e69194b9fe3..2b63e288e67 100644 Binary files a/tools/sdk/esp32s3/lib/libprotocomm.a and b/tools/sdk/esp32s3/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32s3/lib/libpthread.a b/tools/sdk/esp32s3/lib/libpthread.a index 91de4192be2..c7fdd775320 100644 Binary files a/tools/sdk/esp32s3/lib/libpthread.a and b/tools/sdk/esp32s3/lib/libpthread.a differ diff --git a/tools/sdk/esp32s3/lib/libqrcode.a b/tools/sdk/esp32s3/lib/libqrcode.a index cc4a3d69fc5..cf8d24639fd 100644 Binary files a/tools/sdk/esp32s3/lib/libqrcode.a and b/tools/sdk/esp32s3/lib/libqrcode.a differ diff --git a/tools/sdk/esp32s3/lib/librmaker_common.a b/tools/sdk/esp32s3/lib/librmaker_common.a index 26a2df9dc82..4e9bff84d42 100644 Binary files a/tools/sdk/esp32s3/lib/librmaker_common.a and b/tools/sdk/esp32s3/lib/librmaker_common.a differ diff --git a/tools/sdk/esp32s3/lib/libsdmmc.a b/tools/sdk/esp32s3/lib/libsdmmc.a index 462602d2ab7..740f058c495 100644 Binary files a/tools/sdk/esp32s3/lib/libsdmmc.a and b/tools/sdk/esp32s3/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32s3/lib/libsmartconfig.a b/tools/sdk/esp32s3/lib/libsmartconfig.a index 2c4894ae6c4..6f2a0b73f90 100644 Binary files a/tools/sdk/esp32s3/lib/libsmartconfig.a and b/tools/sdk/esp32s3/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32s3/lib/libsoc.a b/tools/sdk/esp32s3/lib/libsoc.a index fb9aea73da0..b379a6f4014 100644 Binary files a/tools/sdk/esp32s3/lib/libsoc.a and b/tools/sdk/esp32s3/lib/libsoc.a differ diff --git a/tools/sdk/esp32s3/lib/libspiffs.a b/tools/sdk/esp32s3/lib/libspiffs.a index 0ac91464b98..d8523d89ebd 100644 Binary files a/tools/sdk/esp32s3/lib/libspiffs.a and b/tools/sdk/esp32s3/lib/libspiffs.a differ diff --git a/tools/sdk/esp32s3/lib/libtcp_transport.a b/tools/sdk/esp32s3/lib/libtcp_transport.a index 72265c7f2f9..590bf7e822d 100644 Binary files a/tools/sdk/esp32s3/lib/libtcp_transport.a and b/tools/sdk/esp32s3/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32s3/lib/libtcpip_adapter.a b/tools/sdk/esp32s3/lib/libtcpip_adapter.a index 9a19f50c49c..f922b737860 100644 Binary files a/tools/sdk/esp32s3/lib/libtcpip_adapter.a and b/tools/sdk/esp32s3/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32s3/lib/libulp.a b/tools/sdk/esp32s3/lib/libulp.a index bbab04599ec..a5020e360d6 100644 Binary files a/tools/sdk/esp32s3/lib/libulp.a and b/tools/sdk/esp32s3/lib/libulp.a differ diff --git a/tools/sdk/esp32s3/lib/libunity.a b/tools/sdk/esp32s3/lib/libunity.a index 7e2158374b9..827b5066836 100644 Binary files a/tools/sdk/esp32s3/lib/libunity.a and b/tools/sdk/esp32s3/lib/libunity.a differ diff --git a/tools/sdk/esp32s3/lib/libusb.a b/tools/sdk/esp32s3/lib/libusb.a index 9f826c19e86..2086eee575f 100644 Binary files a/tools/sdk/esp32s3/lib/libusb.a and b/tools/sdk/esp32s3/lib/libusb.a differ diff --git a/tools/sdk/esp32s3/lib/libvfs.a b/tools/sdk/esp32s3/lib/libvfs.a index 34bf2848fd8..5349eb5ebed 100644 Binary files a/tools/sdk/esp32s3/lib/libvfs.a and b/tools/sdk/esp32s3/lib/libvfs.a differ diff --git a/tools/sdk/esp32s3/lib/libwakenet.a b/tools/sdk/esp32s3/lib/libwakenet.a index 9d51a43d3c9..a0c8c54e318 100644 Binary files a/tools/sdk/esp32s3/lib/libwakenet.a and b/tools/sdk/esp32s3/lib/libwakenet.a differ diff --git a/tools/sdk/esp32s3/lib/libwapi.a b/tools/sdk/esp32s3/lib/libwapi.a index 37e34dc152d..c0e762d4900 100644 Binary files a/tools/sdk/esp32s3/lib/libwapi.a and b/tools/sdk/esp32s3/lib/libwapi.a differ diff --git a/tools/sdk/esp32s3/lib/libwear_levelling.a b/tools/sdk/esp32s3/lib/libwear_levelling.a index 8fa7f34b50d..e4b0d74dbd0 100644 Binary files a/tools/sdk/esp32s3/lib/libwear_levelling.a and b/tools/sdk/esp32s3/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32s3/lib/libwifi_provisioning.a b/tools/sdk/esp32s3/lib/libwifi_provisioning.a index 1da8a553a90..94d678f1a82 100644 Binary files a/tools/sdk/esp32s3/lib/libwifi_provisioning.a and b/tools/sdk/esp32s3/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32s3/lib/libwpa_supplicant.a b/tools/sdk/esp32s3/lib/libwpa_supplicant.a index 699f4d5818e..41e107bd273 100644 Binary files a/tools/sdk/esp32s3/lib/libwpa_supplicant.a and b/tools/sdk/esp32s3/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32s3/lib/libws2812_led.a b/tools/sdk/esp32s3/lib/libws2812_led.a index adb925a0117..1e094cdb764 100644 Binary files a/tools/sdk/esp32s3/lib/libws2812_led.a and b/tools/sdk/esp32s3/lib/libws2812_led.a differ diff --git a/tools/sdk/esp32s3/lib/libxtensa.a b/tools/sdk/esp32s3/lib/libxtensa.a index 36fb7be41d2..cb2726e8bc8 100644 Binary files a/tools/sdk/esp32s3/lib/libxtensa.a and b/tools/sdk/esp32s3/lib/libxtensa.a differ diff --git a/tools/sdk/esp32s3/opi_opi/include/sdkconfig.h b/tools/sdk/esp32s3/opi_opi/include/sdkconfig.h index 4c6c3eeaaa2..f39c4f26f11 100644 --- a/tools/sdk/esp32s3/opi_opi/include/sdkconfig.h +++ b/tools/sdk/esp32s3/opi_opi/include/sdkconfig.h @@ -64,11 +64,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -553,7 +555,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -625,6 +627,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -727,6 +730,9 @@ #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 @@ -1084,6 +1090,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -1213,5 +1220,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s3/opi_opi/libbootloader_support.a b/tools/sdk/esp32s3/opi_opi/libbootloader_support.a index 5fc8d553d3f..acbb302fce6 100644 Binary files a/tools/sdk/esp32s3/opi_opi/libbootloader_support.a and b/tools/sdk/esp32s3/opi_opi/libbootloader_support.a differ diff --git a/tools/sdk/esp32s3/opi_opi/libesp_hw_support.a b/tools/sdk/esp32s3/opi_opi/libesp_hw_support.a index bbb57865983..559b13977d8 100644 Binary files a/tools/sdk/esp32s3/opi_opi/libesp_hw_support.a and b/tools/sdk/esp32s3/opi_opi/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s3/opi_opi/libesp_system.a b/tools/sdk/esp32s3/opi_opi/libesp_system.a index 8f702c65682..50398c252b6 100644 Binary files a/tools/sdk/esp32s3/opi_opi/libesp_system.a and b/tools/sdk/esp32s3/opi_opi/libesp_system.a differ diff --git a/tools/sdk/esp32s3/opi_opi/libfreertos.a b/tools/sdk/esp32s3/opi_opi/libfreertos.a index 7fd9af5d45f..23cb239e1e0 100644 Binary files a/tools/sdk/esp32s3/opi_opi/libfreertos.a and b/tools/sdk/esp32s3/opi_opi/libfreertos.a differ diff --git a/tools/sdk/esp32s3/opi_opi/libspi_flash.a b/tools/sdk/esp32s3/opi_opi/libspi_flash.a index 3e4e9b9d3da..81cb993451d 100644 Binary files a/tools/sdk/esp32s3/opi_opi/libspi_flash.a and b/tools/sdk/esp32s3/opi_opi/libspi_flash.a differ diff --git a/tools/sdk/esp32s3/opi_opi/sections.ld b/tools/sdk/esp32s3/opi_opi/sections.ld index b9b740e0e3c..2c078b29215 100644 --- a/tools/sdk/esp32s3/opi_opi/sections.ld +++ b/tools/sdk/esp32s3/opi_opi/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -411,7 +411,7 @@ SECTIONS *(.wifislprxiram .wifislprxiram.*) *libesp_event.a:default_event_loop.*(.literal.esp_event_handler_instance_register .literal.esp_event_handler_instance_unregister .literal.esp_event_handler_register .literal.esp_event_handler_unregister .literal.esp_event_loop_create_default .literal.esp_event_loop_delete_default .literal.esp_event_post .literal.esp_event_send_to_default_loop .text .text.esp_event_handler_instance_register .text.esp_event_handler_instance_unregister .text.esp_event_handler_register .text.esp_event_handler_unregister .text.esp_event_loop_create_default .text.esp_event_loop_delete_default .text.esp_event_post .text.esp_event_send_to_default_loop) *libesp_event.a:esp_event.*(.literal.base_node_add_handler .literal.esp_event_handler_instance_register_with .literal.esp_event_handler_instance_unregister_with .literal.esp_event_handler_register_with .literal.esp_event_handler_register_with_internal .literal.esp_event_handler_unregister_with .literal.esp_event_handler_unregister_with_internal .literal.esp_event_loop_create .literal.esp_event_loop_delete .literal.esp_event_loop_run .literal.esp_event_loop_run_task .literal.esp_event_post_to .literal.handler_instances_add .literal.handler_instances_remove .literal.handler_instances_remove_all$isra$1 .literal.loop_node_add_handler .text .text.base_node_add_handler .text.esp_event_dump .text.esp_event_handler_instance_register_with .text.esp_event_handler_instance_unregister_with .text.esp_event_handler_register_with .text.esp_event_handler_register_with_internal .text.esp_event_handler_unregister_with .text.esp_event_handler_unregister_with_internal .text.esp_event_loop_create .text.esp_event_loop_delete .text.esp_event_loop_run .text.esp_event_loop_run_task .text.esp_event_post_to .text.handler_instances_add .text.handler_instances_remove .text.handler_instances_remove_all$isra$1 .text.loop_node_add_handler) - *libesp_hw_support.a:rtc_init.*(.literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.rtc_init .text.rtc_vddsdio_get_config) + *libesp_hw_support.a:rtc_init.*(.literal.get_rtc_dbias_by_efuse$constprop$3 .literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.get_rtc_dbias_by_efuse$constprop$3 .text.rtc_init .text.rtc_vddsdio_get_config) *libesp_system.a:esp_system.*(.literal.esp_get_free_heap_size .literal.esp_get_free_internal_heap_size .literal.esp_get_idf_version .literal.esp_get_minimum_free_heap_size .literal.esp_register_shutdown_handler .literal.esp_unregister_shutdown_handler .text .text.esp_get_free_heap_size .text.esp_get_free_internal_heap_size .text.esp_get_idf_version .text.esp_get_minimum_free_heap_size .text.esp_register_shutdown_handler .text.esp_unregister_shutdown_handler) *libfreertos.a:port.*(.literal.esp_startup_start_app .text.esp_startup_start_app) *libfreertos.a:port.*(.literal.esp_startup_start_app_other_cores .text.esp_startup_start_app_other_cores) @@ -478,8 +478,8 @@ SECTIONS { _flash_rodata_start = ABSOLUTE(.); - *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) *(.rodata_wlog_error .rodata_wlog_error.*) + *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_oct_flash_init.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ *(.gnu.linkonce.r.*) @@ -585,6 +585,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s3/opi_qspi/include/sdkconfig.h b/tools/sdk/esp32s3/opi_qspi/include/sdkconfig.h index 0c0287ea070..3e1c2dd2448 100644 --- a/tools/sdk/esp32s3/opi_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s3/opi_qspi/include/sdkconfig.h @@ -64,11 +64,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -553,7 +555,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -625,6 +627,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -725,6 +728,9 @@ #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 @@ -1082,6 +1088,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -1211,5 +1218,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s3/opi_qspi/libbootloader_support.a b/tools/sdk/esp32s3/opi_qspi/libbootloader_support.a index 5fc8d553d3f..acbb302fce6 100644 Binary files a/tools/sdk/esp32s3/opi_qspi/libbootloader_support.a and b/tools/sdk/esp32s3/opi_qspi/libbootloader_support.a differ diff --git a/tools/sdk/esp32s3/opi_qspi/libesp_hw_support.a b/tools/sdk/esp32s3/opi_qspi/libesp_hw_support.a index 35156aaf6d8..b69c167534e 100644 Binary files a/tools/sdk/esp32s3/opi_qspi/libesp_hw_support.a and b/tools/sdk/esp32s3/opi_qspi/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s3/opi_qspi/libesp_system.a b/tools/sdk/esp32s3/opi_qspi/libesp_system.a index 1e103b5187d..3c85fa39ae6 100644 Binary files a/tools/sdk/esp32s3/opi_qspi/libesp_system.a and b/tools/sdk/esp32s3/opi_qspi/libesp_system.a differ diff --git a/tools/sdk/esp32s3/opi_qspi/libfreertos.a b/tools/sdk/esp32s3/opi_qspi/libfreertos.a index 7fd9af5d45f..23cb239e1e0 100644 Binary files a/tools/sdk/esp32s3/opi_qspi/libfreertos.a and b/tools/sdk/esp32s3/opi_qspi/libfreertos.a differ diff --git a/tools/sdk/esp32s3/opi_qspi/libspi_flash.a b/tools/sdk/esp32s3/opi_qspi/libspi_flash.a index c6a07c2a37b..85254b19e0e 100644 Binary files a/tools/sdk/esp32s3/opi_qspi/libspi_flash.a and b/tools/sdk/esp32s3/opi_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s3/opi_qspi/sections.ld b/tools/sdk/esp32s3/opi_qspi/sections.ld index a11d2915b17..50a1df4e537 100644 --- a/tools/sdk/esp32s3/opi_qspi/sections.ld +++ b/tools/sdk/esp32s3/opi_qspi/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -411,7 +411,7 @@ SECTIONS *(.wifislprxiram .wifislprxiram.*) *libesp_event.a:default_event_loop.*(.literal.esp_event_handler_instance_register .literal.esp_event_handler_instance_unregister .literal.esp_event_handler_register .literal.esp_event_handler_unregister .literal.esp_event_loop_create_default .literal.esp_event_loop_delete_default .literal.esp_event_post .literal.esp_event_send_to_default_loop .text .text.esp_event_handler_instance_register .text.esp_event_handler_instance_unregister .text.esp_event_handler_register .text.esp_event_handler_unregister .text.esp_event_loop_create_default .text.esp_event_loop_delete_default .text.esp_event_post .text.esp_event_send_to_default_loop) *libesp_event.a:esp_event.*(.literal.base_node_add_handler .literal.esp_event_handler_instance_register_with .literal.esp_event_handler_instance_unregister_with .literal.esp_event_handler_register_with .literal.esp_event_handler_register_with_internal .literal.esp_event_handler_unregister_with .literal.esp_event_handler_unregister_with_internal .literal.esp_event_loop_create .literal.esp_event_loop_delete .literal.esp_event_loop_run .literal.esp_event_loop_run_task .literal.esp_event_post_to .literal.handler_instances_add .literal.handler_instances_remove .literal.handler_instances_remove_all$isra$1 .literal.loop_node_add_handler .text .text.base_node_add_handler .text.esp_event_dump .text.esp_event_handler_instance_register_with .text.esp_event_handler_instance_unregister_with .text.esp_event_handler_register_with .text.esp_event_handler_register_with_internal .text.esp_event_handler_unregister_with .text.esp_event_handler_unregister_with_internal .text.esp_event_loop_create .text.esp_event_loop_delete .text.esp_event_loop_run .text.esp_event_loop_run_task .text.esp_event_post_to .text.handler_instances_add .text.handler_instances_remove .text.handler_instances_remove_all$isra$1 .text.loop_node_add_handler) - *libesp_hw_support.a:rtc_init.*(.literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.rtc_init .text.rtc_vddsdio_get_config) + *libesp_hw_support.a:rtc_init.*(.literal.get_rtc_dbias_by_efuse$constprop$3 .literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.get_rtc_dbias_by_efuse$constprop$3 .text.rtc_init .text.rtc_vddsdio_get_config) *libesp_system.a:esp_system.*(.literal.esp_get_free_heap_size .literal.esp_get_free_internal_heap_size .literal.esp_get_idf_version .literal.esp_get_minimum_free_heap_size .literal.esp_register_shutdown_handler .literal.esp_unregister_shutdown_handler .text .text.esp_get_free_heap_size .text.esp_get_free_internal_heap_size .text.esp_get_idf_version .text.esp_get_minimum_free_heap_size .text.esp_register_shutdown_handler .text.esp_unregister_shutdown_handler) *libfreertos.a:port.*(.literal.esp_startup_start_app .text.esp_startup_start_app) *libfreertos.a:port.*(.literal.esp_startup_start_app_other_cores .text.esp_startup_start_app_other_cores) @@ -585,6 +585,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s3/qio_opi/include/sdkconfig.h b/tools/sdk/esp32s3/qio_opi/include/sdkconfig.h index 607a8ac6f7d..0d3e1cff8f1 100644 --- a/tools/sdk/esp32s3/qio_opi/include/sdkconfig.h +++ b/tools/sdk/esp32s3/qio_opi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -552,7 +554,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -624,6 +626,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -726,6 +729,9 @@ #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 @@ -1083,6 +1089,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -1213,5 +1220,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s3/qio_opi/libbootloader_support.a b/tools/sdk/esp32s3/qio_opi/libbootloader_support.a index 01b4403624d..1e22e6881c8 100644 Binary files a/tools/sdk/esp32s3/qio_opi/libbootloader_support.a and b/tools/sdk/esp32s3/qio_opi/libbootloader_support.a differ diff --git a/tools/sdk/esp32s3/qio_opi/libesp_hw_support.a b/tools/sdk/esp32s3/qio_opi/libesp_hw_support.a index bbb57865983..559b13977d8 100644 Binary files a/tools/sdk/esp32s3/qio_opi/libesp_hw_support.a and b/tools/sdk/esp32s3/qio_opi/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s3/qio_opi/libesp_system.a b/tools/sdk/esp32s3/qio_opi/libesp_system.a index 1d745a30d1b..fbbf64d4ad4 100644 Binary files a/tools/sdk/esp32s3/qio_opi/libesp_system.a and b/tools/sdk/esp32s3/qio_opi/libesp_system.a differ diff --git a/tools/sdk/esp32s3/qio_opi/libfreertos.a b/tools/sdk/esp32s3/qio_opi/libfreertos.a index 7fd9af5d45f..23cb239e1e0 100644 Binary files a/tools/sdk/esp32s3/qio_opi/libfreertos.a and b/tools/sdk/esp32s3/qio_opi/libfreertos.a differ diff --git a/tools/sdk/esp32s3/qio_opi/libspi_flash.a b/tools/sdk/esp32s3/qio_opi/libspi_flash.a index 591aecfe1bd..400175bace8 100644 Binary files a/tools/sdk/esp32s3/qio_opi/libspi_flash.a and b/tools/sdk/esp32s3/qio_opi/libspi_flash.a differ diff --git a/tools/sdk/esp32s3/qio_opi/sections.ld b/tools/sdk/esp32s3/qio_opi/sections.ld index 0da52a9bfbe..ed712f70297 100644 --- a/tools/sdk/esp32s3/qio_opi/sections.ld +++ b/tools/sdk/esp32s3/qio_opi/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -409,7 +409,7 @@ SECTIONS *(.wifislprxiram .wifislprxiram.*) *libesp_event.a:default_event_loop.*(.literal.esp_event_handler_instance_register .literal.esp_event_handler_instance_unregister .literal.esp_event_handler_register .literal.esp_event_handler_unregister .literal.esp_event_loop_create_default .literal.esp_event_loop_delete_default .literal.esp_event_post .literal.esp_event_send_to_default_loop .text .text.esp_event_handler_instance_register .text.esp_event_handler_instance_unregister .text.esp_event_handler_register .text.esp_event_handler_unregister .text.esp_event_loop_create_default .text.esp_event_loop_delete_default .text.esp_event_post .text.esp_event_send_to_default_loop) *libesp_event.a:esp_event.*(.literal.base_node_add_handler .literal.esp_event_handler_instance_register_with .literal.esp_event_handler_instance_unregister_with .literal.esp_event_handler_register_with .literal.esp_event_handler_register_with_internal .literal.esp_event_handler_unregister_with .literal.esp_event_handler_unregister_with_internal .literal.esp_event_loop_create .literal.esp_event_loop_delete .literal.esp_event_loop_run .literal.esp_event_loop_run_task .literal.esp_event_post_to .literal.handler_instances_add .literal.handler_instances_remove .literal.handler_instances_remove_all$isra$1 .literal.loop_node_add_handler .text .text.base_node_add_handler .text.esp_event_dump .text.esp_event_handler_instance_register_with .text.esp_event_handler_instance_unregister_with .text.esp_event_handler_register_with .text.esp_event_handler_register_with_internal .text.esp_event_handler_unregister_with .text.esp_event_handler_unregister_with_internal .text.esp_event_loop_create .text.esp_event_loop_delete .text.esp_event_loop_run .text.esp_event_loop_run_task .text.esp_event_post_to .text.handler_instances_add .text.handler_instances_remove .text.handler_instances_remove_all$isra$1 .text.loop_node_add_handler) - *libesp_hw_support.a:rtc_init.*(.literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.rtc_init .text.rtc_vddsdio_get_config) + *libesp_hw_support.a:rtc_init.*(.literal.get_rtc_dbias_by_efuse$constprop$3 .literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.get_rtc_dbias_by_efuse$constprop$3 .text.rtc_init .text.rtc_vddsdio_get_config) *libesp_system.a:esp_system.*(.literal.esp_get_free_heap_size .literal.esp_get_free_internal_heap_size .literal.esp_get_idf_version .literal.esp_get_minimum_free_heap_size .literal.esp_register_shutdown_handler .literal.esp_unregister_shutdown_handler .text .text.esp_get_free_heap_size .text.esp_get_free_internal_heap_size .text.esp_get_idf_version .text.esp_get_minimum_free_heap_size .text.esp_register_shutdown_handler .text.esp_unregister_shutdown_handler) *libfreertos.a:port.*(.literal.esp_startup_start_app .text.esp_startup_start_app) *libfreertos.a:port.*(.literal.esp_startup_start_app_other_cores .text.esp_startup_start_app_other_cores) @@ -476,8 +476,8 @@ SECTIONS { _flash_rodata_start = ABSOLUTE(.); - *(.rodata_wlog_error .rodata_wlog_error.*) *(EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .rodata.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2 EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .sdata2.* EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata EXCLUDE_FILE(*libgcov.a *libphy.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libesp_hw_support.a:opiram_psram.* *libesp_hw_support.a:rtc_clk.* *libesp_system.a:esp_err.* *libesp_system.a:ubsan.* *libgcc.a:_divsf3.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_gpspi.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:systimer_hal.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *libnewlib.a:abort.* *libnewlib.a:assert.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_boya.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_mxic_opi.* *libspi_flash.a:spi_flash_chip_th.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libspi_flash.a:spi_flash_timing_tuning.* *libspi_flash.a:spi_timing_config.*) .srodata.*) + *(.rodata_wlog_error .rodata_wlog_error.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ *(.gnu.linkonce.r.*) @@ -583,6 +583,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s3/qio_qspi/include/sdkconfig.h b/tools/sdk/esp32s3/qio_qspi/include/sdkconfig.h index dff69e8b638..8f43fda681a 100644 --- a/tools/sdk/esp32s3/qio_qspi/include/sdkconfig.h +++ b/tools/sdk/esp32s3/qio_qspi/include/sdkconfig.h @@ -63,11 +63,13 @@ #define CONFIG_ESP_RMAKER_USE_CERT_BUNDLE 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH 1 #define CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD 0 +#define CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK 1 #define CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE 1024 #define CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD 90 #define CONFIG_ESP_RMAKER_SCHEDULING_MAX_SCHEDULES 10 #define CONFIG_ESP_RMAKER_SCENES_MAX_SCENES 10 #define CONFIG_ESP_RMAKER_CMD_RESP_ENABLE 1 +#define CONFIG_ARDUINO_VARIANT "esp32s3" #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -552,7 +554,7 @@ #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0 1 #define CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF 0 #define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 1 -#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 10 +#define CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF 9 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 @@ -624,6 +626,7 @@ #define CONFIG_BT_MULTI_CONNECTION_ENBALE 1 #define CONFIG_BT_SMP_ENABLE 1 #define CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT 30 +#define CONFIG_BT_MAX_DEVICE_NAME_LEN 32 #define CONFIG_BT_BLE_RPA_SUPPORTED 1 #define CONFIG_BT_BLE_50_FEATURES_SUPPORTED 1 #define CONFIG_BT_BLE_42_FEATURES_SUPPORTED 1 @@ -724,6 +727,9 @@ #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO 1 #define CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES 2 #define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND 1 +#define CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU 1 #define CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB 1 #define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024 #define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1 @@ -1081,6 +1087,7 @@ #define CONFIG_SCCB_HARDWARE_I2C_PORT1 1 #define CONFIG_SCCB_CLK_FREQ 100000 #define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1 +#define CONFIG_CAMERA_TASK_STACK_SIZE 2048 #define CONFIG_CAMERA_CORE0 1 #define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768 #define CONFIG_LITTLEFS_MAX_PARTITIONS 3 @@ -1211,5 +1218,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "ce1fde4b3b" +#define CONFIG_ARDUINO_IDF_COMMIT "" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s3/qio_qspi/libbootloader_support.a b/tools/sdk/esp32s3/qio_qspi/libbootloader_support.a index 01b4403624d..1e22e6881c8 100644 Binary files a/tools/sdk/esp32s3/qio_qspi/libbootloader_support.a and b/tools/sdk/esp32s3/qio_qspi/libbootloader_support.a differ diff --git a/tools/sdk/esp32s3/qio_qspi/libesp_hw_support.a b/tools/sdk/esp32s3/qio_qspi/libesp_hw_support.a index 35156aaf6d8..537d2ff9f80 100644 Binary files a/tools/sdk/esp32s3/qio_qspi/libesp_hw_support.a and b/tools/sdk/esp32s3/qio_qspi/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s3/qio_qspi/libesp_system.a b/tools/sdk/esp32s3/qio_qspi/libesp_system.a index c5a4399330e..1bc198de0d0 100644 Binary files a/tools/sdk/esp32s3/qio_qspi/libesp_system.a and b/tools/sdk/esp32s3/qio_qspi/libesp_system.a differ diff --git a/tools/sdk/esp32s3/qio_qspi/libfreertos.a b/tools/sdk/esp32s3/qio_qspi/libfreertos.a index 7fd9af5d45f..23cb239e1e0 100644 Binary files a/tools/sdk/esp32s3/qio_qspi/libfreertos.a and b/tools/sdk/esp32s3/qio_qspi/libfreertos.a differ diff --git a/tools/sdk/esp32s3/qio_qspi/libspi_flash.a b/tools/sdk/esp32s3/qio_qspi/libspi_flash.a index 81a824d0a0c..6b731483fcc 100644 Binary files a/tools/sdk/esp32s3/qio_qspi/libspi_flash.a and b/tools/sdk/esp32s3/qio_qspi/libspi_flash.a differ diff --git a/tools/sdk/esp32s3/qio_qspi/sections.ld b/tools/sdk/esp32s3/qio_qspi/sections.ld index fda5831163a..42f620ccb9a 100644 --- a/tools/sdk/esp32s3/qio_qspi/sections.ld +++ b/tools/sdk/esp32s3/qio_qspi/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in */ +/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -409,7 +409,7 @@ SECTIONS *(.wifislprxiram .wifislprxiram.*) *libesp_event.a:default_event_loop.*(.literal.esp_event_handler_instance_register .literal.esp_event_handler_instance_unregister .literal.esp_event_handler_register .literal.esp_event_handler_unregister .literal.esp_event_loop_create_default .literal.esp_event_loop_delete_default .literal.esp_event_post .literal.esp_event_send_to_default_loop .text .text.esp_event_handler_instance_register .text.esp_event_handler_instance_unregister .text.esp_event_handler_register .text.esp_event_handler_unregister .text.esp_event_loop_create_default .text.esp_event_loop_delete_default .text.esp_event_post .text.esp_event_send_to_default_loop) *libesp_event.a:esp_event.*(.literal.base_node_add_handler .literal.esp_event_handler_instance_register_with .literal.esp_event_handler_instance_unregister_with .literal.esp_event_handler_register_with .literal.esp_event_handler_register_with_internal .literal.esp_event_handler_unregister_with .literal.esp_event_handler_unregister_with_internal .literal.esp_event_loop_create .literal.esp_event_loop_delete .literal.esp_event_loop_run .literal.esp_event_loop_run_task .literal.esp_event_post_to .literal.handler_instances_add .literal.handler_instances_remove .literal.handler_instances_remove_all$isra$1 .literal.loop_node_add_handler .text .text.base_node_add_handler .text.esp_event_dump .text.esp_event_handler_instance_register_with .text.esp_event_handler_instance_unregister_with .text.esp_event_handler_register_with .text.esp_event_handler_register_with_internal .text.esp_event_handler_unregister_with .text.esp_event_handler_unregister_with_internal .text.esp_event_loop_create .text.esp_event_loop_delete .text.esp_event_loop_run .text.esp_event_loop_run_task .text.esp_event_post_to .text.handler_instances_add .text.handler_instances_remove .text.handler_instances_remove_all$isra$1 .text.loop_node_add_handler) - *libesp_hw_support.a:rtc_init.*(.literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.rtc_init .text.rtc_vddsdio_get_config) + *libesp_hw_support.a:rtc_init.*(.literal.get_rtc_dbias_by_efuse$constprop$3 .literal.rtc_init .literal.rtc_vddsdio_get_config .text .text.get_rtc_dbias_by_efuse$constprop$3 .text.rtc_init .text.rtc_vddsdio_get_config) *libesp_system.a:esp_system.*(.literal.esp_get_free_heap_size .literal.esp_get_free_internal_heap_size .literal.esp_get_idf_version .literal.esp_get_minimum_free_heap_size .literal.esp_register_shutdown_handler .literal.esp_unregister_shutdown_handler .text .text.esp_get_free_heap_size .text.esp_get_free_internal_heap_size .text.esp_get_idf_version .text.esp_get_minimum_free_heap_size .text.esp_register_shutdown_handler .text.esp_unregister_shutdown_handler) *libfreertos.a:port.*(.literal.esp_startup_start_app .text.esp_startup_start_app) *libfreertos.a:port.*(.literal.esp_startup_start_app_other_cores .text.esp_startup_start_app_other_cores) @@ -583,6 +583,25 @@ SECTIONS . = ALIGN (8); _heap_start = ABSOLUTE(.); } > dram0_0_seg + + /** This section will be used by the debugger and disassembler to get more information + * about raw data present in the code. + * Indeed, it may be required to add some padding at some points in the code + * in order to align a branch/jump destination on a particular bound. + * Padding these instructions will generate null bytes that shall be + * interpreted as data, and not code by the debugger or disassembler. + * This section will only be present in the ELF file, not in the final binary + * For more details, check GCC-212 + */ + .xt.prop 0 : + { + KEEP (*(.xt.prop .gnu.linkonce.prop.*)) + } + + .xt.lit 0 : + { + KEEP (*(.xt.lit .gnu.linkonce.p.*)) + } } ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)), diff --git a/tools/sdk/esp32s3/sdkconfig b/tools/sdk/esp32s3/sdkconfig index ee00fda71ea..2ccdf3efec5 100644 --- a/tools/sdk/esp32s3/sdkconfig +++ b/tools/sdk/esp32s3/sdkconfig @@ -172,10 +172,11 @@ CONFIG_ESP_RMAKER_USE_CERT_BUNDLE=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH=y CONFIG_ESP_RMAKER_OTA_AUTOFETCH_PERIOD=0 # CONFIG_ESP_RMAKER_SKIP_COMMON_NAME_CHECK is not set -# CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK is not set +CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y # CONFIG_ESP_RMAKER_SKIP_PROJECT_NAME_CHECK is not set CONFIG_ESP_RMAKER_OTA_HTTP_RX_BUFFER_SIZE=1024 CONFIG_ESP_RMAKER_OTA_ROLLBACK_WAIT_PERIOD=90 +# CONFIG_ESP_RMAKER_OTA_DISABLE_AUTO_REBOOT is not set # end of ESP RainMaker OTA Config # @@ -202,6 +203,7 @@ CONFIG_ESP_RMAKER_CMD_RESP_ENABLE=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32s3" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y # CONFIG_ARDUINO_RUN_CORE0 is not set @@ -332,12 +334,13 @@ CONFIG_SR_WN_WN9_HILEXIN=y # CONFIG_SR_WN_WN9_ALEXA is not set # CONFIG_SR_WN_WN9_HIESP is not set # CONFIG_SR_WN_WN9_NIHAOXIAOZHI is not set -# CONFIG_SR_WN_CUSTOMIZED_WORD is not set +# CONFIG_SR_WN_WN9_CUSTOMWORD is not set # CONFIG_SR_WN_LOAD_MULIT_WORD is not set CONFIG_USE_MULTINET=y # CONFIG_SR_MN_CN_NONE is not set CONFIG_SR_MN_CN_MULTINET4_5_SINGLE_RECOGNITION=y # CONFIG_SR_MN_CN_MULTINET4_5_SINGLE_RECOGNITION_QUANT8 is not set +# CONFIG_SR_MN_CN_MULTINET5_RECOGNITION_QUANT8 is not set # CONFIG_SR_MN_EN_NONE is not set CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8=y @@ -829,7 +832,6 @@ CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y # CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N27 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set @@ -845,7 +847,7 @@ CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=10 +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -1080,6 +1082,7 @@ CONFIG_BT_MULTI_CONNECTION_ENBALE=y # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 +CONFIG_BT_MAX_DEVICE_NAME_LEN=32 CONFIG_BT_BLE_RPA_SUPPORTED=y CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y @@ -1331,6 +1334,7 @@ CONFIG_DEFAULT_PSRAM_CS_IO=26 # CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set # CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set # CONFIG_SPIRAM_SPEED_120M is not set CONFIG_SPIRAM_SPEED_80M=y # CONFIG_SPIRAM_SPEED_40M is not set @@ -1457,8 +1461,9 @@ CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=2 # CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y # CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set -# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set -# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y # end of Sleep Config # @@ -1515,6 +1520,13 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -1608,6 +1620,7 @@ CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -2296,6 +2309,7 @@ CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 CONFIG_WIFI_PROV_BLE_BONDING=y CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y +# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set # end of Wi-Fi Provisioning Manager # @@ -2381,11 +2395,13 @@ CONFIG_BF3005_SUPPORT=y CONFIG_BF20A6_SUPPORT=y # CONFIG_SC101IOT_SUPPORT is not set CONFIG_SC030IOT_SUPPORT=y +# CONFIG_SC031GS_SUPPORT is not set # CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set CONFIG_SCCB_HARDWARE_I2C_PORT1=y CONFIG_SCCB_CLK_FREQ=100000 # CONFIG_GC_SENSOR_WINDOWING_MODE is not set CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y +CONFIG_CAMERA_TASK_STACK_SIZE=2048 CONFIG_CAMERA_CORE0=y # CONFIG_CAMERA_CORE1 is not set # CONFIG_CAMERA_NO_AFFINITY is not set diff --git a/tools/sdk/versions.txt b/tools/sdk/versions.txt new file mode 100644 index 00000000000..3103f53c6f1 --- /dev/null +++ b/tools/sdk/versions.txt @@ -0,0 +1,9 @@ +esp-idf: 6407ecb3f8 +arduino: master bd714499 +esp-dl: master f3006d7 +esp-dsp: master 5824900 +esp-rainmaker: master 75bfd9f +esp-sr: master 380b8a4 +esp32-camera: master 5c8349f +esp_littlefs: master 485a037 +tinyusb: master e434a1dc0 diff --git a/variants/adafruit_feather_esp32s3/partitions.csv b/variants/adafruit_feather_esp32s3/partitions.csv deleted file mode 100644 index 164ba0d5965..00000000000 --- a/variants/adafruit_feather_esp32s3/partitions.csv +++ /dev/null @@ -1,11 +0,0 @@ -# ESP-IDF Partition Table -# Name, Type, SubType, Offset, Size, Flags -# bootloader.bin,, 0x1000, 32K -# partition table, 0x8000, 4K - -nvs, data, nvs, 0x9000, 20K, -otadata, data, ota, 0xe000, 8K, -ota_0, 0, ota_0, 0x10000, 1408K, -ota_1, 0, ota_1, 0x170000, 1408K, -uf2, app, factory,0x2d0000, 256K, -ffat, data, fat, 0x310000, 960K, diff --git a/variants/adafruit_feather_esp32s3_tft/partitions.csv b/variants/adafruit_feather_esp32s3_tft/partitions.csv deleted file mode 100644 index 164ba0d5965..00000000000 --- a/variants/adafruit_feather_esp32s3_tft/partitions.csv +++ /dev/null @@ -1,11 +0,0 @@ -# ESP-IDF Partition Table -# Name, Type, SubType, Offset, Size, Flags -# bootloader.bin,, 0x1000, 32K -# partition table, 0x8000, 4K - -nvs, data, nvs, 0x9000, 20K, -otadata, data, ota, 0xe000, 8K, -ota_0, 0, ota_0, 0x10000, 1408K, -ota_1, 0, ota_1, 0x170000, 1408K, -uf2, app, factory,0x2d0000, 256K, -ffat, data, fat, 0x310000, 960K, diff --git a/variants/adafruit_itsybitsy_esp32/pins_arduino.h b/variants/adafruit_itsybitsy_esp32/pins_arduino.h new file mode 100644 index 00000000000..d81c077c91d --- /dev/null +++ b/variants/adafruit_itsybitsy_esp32/pins_arduino.h @@ -0,0 +1,58 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 40 +#define NUM_ANALOG_INPUTS 16 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) +#define digitalPinHasPWM(p) (p < 34) + +static const uint8_t LED_BUILTIN = 13; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN + +// Neopixel +static const uint8_t PIN_NEOPIXEL = 0; +static const uint8_t NEOPIXEL_POWER = 2; + +static const uint8_t TX = 20; +static const uint8_t RX = 8; + +#define TX1 TX +#define RX1 RX + +static const uint8_t SDA = 15; +static const uint8_t SCL = 27; + +static const uint8_t SS = 32; +static const uint8_t MOSI = 21; +static const uint8_t MISO = 22; +static const uint8_t SCK = 19; + +static const uint8_t A0 = 25; +static const uint8_t A1 = 26; +static const uint8_t A2 = 4; +static const uint8_t A3 = 38; +static const uint8_t A4 = 37; +static const uint8_t A5 = 36; + +// internal switch +static const uint8_t BUTTON = 35; + +static const uint8_t T0 = 4; +static const uint8_t T3 = 15; +static const uint8_t T4 = 13; +static const uint8_t T5 = 12; +static const uint8_t T6 = 14; +static const uint8_t T7 = 27; +static const uint8_t T8 = 33; +static const uint8_t T9 = 32; + +static const uint8_t DAC1 = 25; +static const uint8_t DAC2 = 26; + +#endif /* Pins_Arduino_h */ diff --git a/variants/adafruit_itsybitsy_esp32/variant.cpp b/variants/adafruit_itsybitsy_esp32/variant.cpp new file mode 100644 index 00000000000..726ec8fa483 --- /dev/null +++ b/variants/adafruit_itsybitsy_esp32/variant.cpp @@ -0,0 +1,40 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "esp32-hal-gpio.h" +#include "pins_arduino.h" + +extern "C" { + +// Initialize variant/board, called before setup() +void initVariant(void) +{ + // This board has a power control pin, and we must set it to output and high + // in order to enable the NeoPixels. + pinMode(NEOPIXEL_POWER, OUTPUT); + digitalWrite(NEOPIXEL_POWER, HIGH); +} + +} diff --git a/variants/bpi_leaf_s3/pins_arduino.h b/variants/bpi_leaf_s3/pins_arduino.h new file mode 100644 index 00000000000..56876ce9c9d --- /dev/null +++ b/variants/bpi_leaf_s3/pins_arduino.h @@ -0,0 +1,77 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define USB_VID 0x303a +#define USB_PID 0x80df +#define USB_MANUFACTURER "Banana Pi" +#define USB_PRODUCT "BPI-Leaf-S3" +#define USB_SERIAL "" + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +// Some boards have too low voltage on this pin (board design bug) +// Use different pin with 3V and connect with 48 +// and change this setup for the chosen pin (for example 38) +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 25 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +static const uint8_t SDA = 15; +static const uint8_t SCL = 16; + +static const uint8_t SS = 10; +static const uint8_t MOSI = 11; +static const uint8_t MISO = 13; +static const uint8_t SCK = 12; + +static const uint8_t A0 = 1; +static const uint8_t A1 = 2; +static const uint8_t A2 = 3; +static const uint8_t A3 = 4; +static const uint8_t A4 = 5; +static const uint8_t A5 = 6; +static const uint8_t A6 = 7; +static const uint8_t A7 = 8; +static const uint8_t A8 = 9; +static const uint8_t A9 = 10; +static const uint8_t A10 = 11; +static const uint8_t A11 = 12; +static const uint8_t A12 = 13; +static const uint8_t A13 = 14; +static const uint8_t A14 = 15; +static const uint8_t A15 = 16; +static const uint8_t A16 = 17; +static const uint8_t A17 = 18; +static const uint8_t A18 = 19; +static const uint8_t A19 = 20; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T3 = 3; +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +#endif /* Pins_Arduino_h */ diff --git a/variants/cytron_maker_feather_aiot_s3/bootloader-tinyuf2.bin b/variants/cytron_maker_feather_aiot_s3/bootloader-tinyuf2.bin new file mode 100644 index 00000000000..6e7ea8a275e Binary files /dev/null and b/variants/cytron_maker_feather_aiot_s3/bootloader-tinyuf2.bin differ diff --git a/variants/cytron_maker_feather_aiot_s3/partitions-8MB-tinyuf2.csv b/variants/cytron_maker_feather_aiot_s3/partitions-8MB-tinyuf2.csv new file mode 100644 index 00000000000..4026378b6fb --- /dev/null +++ b/variants/cytron_maker_feather_aiot_s3/partitions-8MB-tinyuf2.csv @@ -0,0 +1,10 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 2048K, +ota_1, 0, ota_1, 0x210000, 2048K, +uf2, app, factory,0x410000, 256K, +ffat, data, fat, 0x450000, 3776K, diff --git a/variants/cytron_maker_feather_aiot_s3/pins_arduino.h b/variants/cytron_maker_feather_aiot_s3/pins_arduino.h new file mode 100644 index 00000000000..bd3e9c278c9 --- /dev/null +++ b/variants/cytron_maker_feather_aiot_s3/pins_arduino.h @@ -0,0 +1,81 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define USB_VID 0x303A +#define USB_PID 0x80F8 +#define USB_MANUFACTURER "Cytron" +#define USB_PRODUCT "Maker Feather AIoT S3" +#define USB_SERIAL "" + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 20 +#define NUM_ANALOG_INPUTS 12 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + + + +static const uint8_t LED_BUILTIN = 2; // Status LED. +static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT + 46; // RGB LED. + +#define BUILTIN_LED LED_BUILTIN // Backward compatibility +#define LED_BUILTIN LED_BUILTIN +#define LED LED_BUILTIN +#define RGB_BUILTIN RGB_BUILTIN +#define RGB RGB_BUILTIN +#define NEOPIXEL RGB_BUILTIN +#define RGB_BRIGHTNESS 65 + + + +#define VP_EN 11 // V Peripheral Enable. +#define BUZZER 12 // Piezo Buzzer. +#define BOOT 0 // Boot Button. +#define BUTTON 3 // User Button. + +#define VIN 13 // Vin Sense. +#define VBATT 13 +#define VOLTAGE_MONITOR 13 + + +static const uint8_t TX = 15; +static const uint8_t RX = 16; + +static const uint8_t SDA = 42; +static const uint8_t SCL = 41; + +static const uint8_t SS = 7; +static const uint8_t MOSI = 8; +static const uint8_t SCK = 17; +static const uint8_t MISO = 18; + +static const uint8_t A0 = 10; +static const uint8_t A1 = 9; +static const uint8_t A2 = 6; +static const uint8_t A3 = 5; +static const uint8_t A4 = 4; +static const uint8_t A5 = 7; + +static const uint8_t A6 = 17; +static const uint8_t A7 = 8; +static const uint8_t A8 = 18; +static const uint8_t A9 = 16; +static const uint8_t A10 = 15; +static const uint8_t A11 = 14; +static const uint8_t A12 = 13; + +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T14 = 14; + +#endif /* Pins_Arduino_h */ diff --git a/variants/cytron_maker_feather_aiot_s3/tinyuf2.bin b/variants/cytron_maker_feather_aiot_s3/tinyuf2.bin new file mode 100644 index 00000000000..a43bff014da Binary files /dev/null and b/variants/cytron_maker_feather_aiot_s3/tinyuf2.bin differ diff --git a/variants/cytron_maker_feather_aiot_s3/variant.cpp b/variants/cytron_maker_feather_aiot_s3/variant.cpp new file mode 100644 index 00000000000..d90883480b3 --- /dev/null +++ b/variants/cytron_maker_feather_aiot_s3/variant.cpp @@ -0,0 +1,38 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022 Wai Weng for Cytron Technologies + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "esp32-hal-gpio.h" +#include "pins_arduino.h" + +extern "C" { + +// Initialize variant/board, called before setup() +void initVariant(void) +{ + // Turn on VPeripheral by default. + pinMode(VP_EN, OUTPUT); + digitalWrite(VP_EN, HIGH); +} +} diff --git a/variants/d32_pro/pins_arduino.h b/variants/d32_pro/pins_arduino.h index f19efb977ba..ce36f21bc08 100644 --- a/variants/d32_pro/pins_arduino.h +++ b/variants/d32_pro/pins_arduino.h @@ -9,7 +9,6 @@ static const uint8_t LED_BUILTIN = 5; #define LED_BUILTIN LED_BUILTIN static const uint8_t _VBAT = 35; // battery voltage - #define TF_CS 4 // TF (Micro SD Card) CS pin #define TS_CS 12 // Touch Screen CS pin #define TFT_CS 14 // TFT CS pin diff --git a/variants/deneyapkart/pins_arduino.h b/variants/deneyapkart/pins_arduino.h index 3dd496843a7..e1ed685f3d7 100644 --- a/variants/deneyapkart/pins_arduino.h +++ b/variants/deneyapkart/pins_arduino.h @@ -11,6 +11,18 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) +static const uint8_t LEDR = 3; +static const uint8_t LEDG = 1; +static const uint8_t LEDB = 4; +static const uint8_t GPKEY = 0; + +#define BUILTIN_LED LEDB +#define LED_BUILTIN BUILTIN_LED // backward compatibility +//#define RGB_BUILTIN LED_BUILTIN + +#define KEY_BUILTIN GPKEY +#define BUILTIN_KEY KEY_BUILTIN + static const uint8_t TX = 1; static const uint8_t RX = 3; @@ -87,12 +99,6 @@ static const uint8_t CAMXC = 32; static const uint8_t CAMH = 39; static const uint8_t CAMV = 36; -static const uint8_t LEDR = 3; -static const uint8_t LEDG = 1; -static const uint8_t LEDB = 4; -static const uint8_t BUILTIN_KEY = 0; -static const uint8_t GPKEY = 0; - static const uint8_t PWM0 = 23; static const uint8_t PWM1 = 22; diff --git a/variants/deneyapkart1A/pins_arduino.h b/variants/deneyapkart1A/pins_arduino.h index b97a0f3a33b..6e35c8ef9b8 100644 --- a/variants/deneyapkart1A/pins_arduino.h +++ b/variants/deneyapkart1A/pins_arduino.h @@ -11,6 +11,15 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) +static const uint8_t RGBLED = 13; +static const uint8_t GPKEY = 0; + +#define RGB_BUILTIN RGBLED +#define RGB_BRIGHTNESS 64 + +#define KEY_BUILTIN GPKEY +#define BUILTIN_KEY KEY_BUILTIN + static const uint8_t TX = 1; static const uint8_t RX = 3; @@ -87,10 +96,6 @@ static const uint8_t CAMXC = 32; static const uint8_t CAMH = 39; static const uint8_t CAMV = 36; -static const uint8_t RGBLED = 13; -static const uint8_t BUILTIN_KEY = 0; -static const uint8_t GPKEY = 0; - static const uint8_t PWM0 = 23; static const uint8_t PWM1 = 22; diff --git a/variants/deneyapkartg/pins_arduino.h b/variants/deneyapkartg/pins_arduino.h new file mode 100644 index 00000000000..e8aef7cd182 --- /dev/null +++ b/variants/deneyapkartg/pins_arduino.h @@ -0,0 +1,52 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define EXTERNAL_NUM_INTERRUPTS 22 +#define NUM_DIGITAL_PINS 22 +#define NUM_ANALOG_INPUTS 6 + +#define analogInputToDigitalPin(p) (((p) +#include "soc/soc_caps.h" #define EXTERNAL_NUM_INTERRUPTS 46 #define NUM_DIGITAL_PINS 48 @@ -11,7 +12,17 @@ #define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinHasPWM(p) (p < 46) -static const uint8_t KEY_BUILTIN = 0; +static const uint8_t LEDR = 34; +static const uint8_t LEDG = 33; +static const uint8_t LEDB = 35; +static const uint8_t GPKEY = 0; + +#define KEY_BUILTIN GPKEY +#define BUILTIN_KEY KEY_BUILTIN + +#define BUILTIN_LED LEDB +#define LED_BUILTIN BUILTIN_LED // backward compatibility +//#define RGB_BUILTIN LED_BUILTIN static const uint8_t TX = 43; static const uint8_t RX = 44; @@ -24,43 +35,38 @@ static const uint8_t MOSI = 40; static const uint8_t MISO = 39; static const uint8_t SCK = 38; -static const uint8_t A0 = 1; -static const uint8_t A1 = 2; -static const uint8_t A2 = 3; -static const uint8_t A3 = 4; -static const uint8_t A4 = 5; -static const uint8_t A5 = 6; -static const uint8_t A6 = 7; -static const uint8_t A7 = 8; -static const uint8_t A8 = 9; -static const uint8_t A9 = 10; -static const uint8_t A10 = 11; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; -static const uint8_t A13 = 14; -static const uint8_t A14 = 15; -static const uint8_t A15 = 16; -static const uint8_t A16 = 17; -static const uint8_t A17 = 18; -static const uint8_t A18 = 19; -static const uint8_t A19 = 20; +static const uint8_t A0 = 8; +static const uint8_t A1 = 9; +static const uint8_t A2 = 10; +static const uint8_t A3 = 11; +static const uint8_t A4 = 12; +static const uint8_t A5 = 13; -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; -static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; +static const uint8_t T1 = 8; +static const uint8_t T2 = 9; +static const uint8_t T3 = 10; +static const uint8_t T4 = 11; +static const uint8_t T5 = 12; +static const uint8_t T6 = 13; static const uint8_t DAC1 = 17; static const uint8_t DAC2 = 18; -#endif /* Pins_Arduino_h */ \ No newline at end of file +static const uint8_t D1 = 44; +static const uint8_t D2 = 43; +static const uint8_t D3 = 42; +static const uint8_t D4 = 40; +static const uint8_t D5 = 39; +static const uint8_t D6 = 38; +static const uint8_t D7 = 37; +static const uint8_t D8 = 36; +static const uint8_t D9 = 26; +static const uint8_t D10 = 21; +static const uint8_t D11 = 18; +static const uint8_t D12 = 17; +static const uint8_t D13 = 0; +static const uint8_t D14 = 35; +static const uint8_t D15 = 33; +static const uint8_t D16 = 34; + +#endif /* Pins_Arduino_h */ diff --git a/variants/metro_esp-32/pins_arduino.h b/variants/metro_esp-32/pins_arduino.h index aedf2fb1f71..6675823c50e 100644 --- a/variants/metro_esp-32/pins_arduino.h +++ b/variants/metro_esp-32/pins_arduino.h @@ -22,4 +22,9 @@ static const uint8_t SCL = 22; static const uint8_t ADR = 12; +static const uint8_t SS = 5; +static const uint8_t MOSI = 23; +static const uint8_t MISO = 19; +static const uint8_t SCK = 18; + #endif /* Pins_Arduino_h */ diff --git a/variants/nora_w10/pins_arduino.h b/variants/nora_w10/pins_arduino.h new file mode 100644 index 00000000000..ccf4556dcfc --- /dev/null +++ b/variants/nora_w10/pins_arduino.h @@ -0,0 +1,93 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +// The pin assignments in this file are based on u-blox EVK-NORA-W1, a Arduino compatible board. +// For your own module design you can freely chose the pins available on the module module pins + +static const uint8_t TX = 43; +static const uint8_t RX = 44; +static const uint8_t RTS = 45; +static const uint8_t CTS = 6; +static const uint8_t DTR = 1; +static const uint8_t DSR = 7; + +static const uint8_t SW1 = 46; +static const uint8_t SW2 = 0; // BOOT +static const uint8_t SW3 = 47; +static const uint8_t SW4 = 48; + +static const uint8_t LED_RED = 5; +static const uint8_t LED_GREEN = 2; +static const uint8_t LED_BLUE = 8; +#define BUILTIN_LED LED_BLUE // backward compatibility +#define LED_BUILTIN LED_BLUE + +static const uint8_t SS = 34; +static const uint8_t MOSI = 35; +static const uint8_t MISO = 37; +static const uint8_t SCK = 36; + +static const uint8_t A0 = 11; +static const uint8_t A1 = 12; +static const uint8_t A2 = 13; +static const uint8_t A3 = 5; +static const uint8_t A4 = 15; +static const uint8_t A5 = 16; + +static const uint8_t D0 = 44; // RX0 +static const uint8_t D1 = 43; // TX0 +static const uint8_t D2 = 46; +static const uint8_t D3 = 4; +static const uint8_t D4 = 3; +static const uint8_t D5 = 2; +static const uint8_t D6 = 14; +static const uint8_t D7 = 10; + +static const uint8_t D8 = 33; +static const uint8_t D9 = 38; +static const uint8_t D10 = 34; // SS +static const uint8_t D11 = 35; // MOSI +static const uint8_t D12 = 37; // MISO +static const uint8_t D13 = 36; // SCK +static const uint8_t SDA1 = 21; +static const uint8_t SCL1 = 0; + +static const uint8_t D14 = 45; // RTS +static const uint8_t D15 = 6; // CTS +static const uint8_t D16 = 1; // DTR +static const uint8_t D17 = 7; // DSR +static const uint8_t D18 = 47; +static const uint8_t D19 = 48; +static const uint8_t SDA = 18; +static const uint8_t SCL = 17; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T3 = 3; +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +#endif /* Pins_Arduino_h */ diff --git a/variants/tamc_termod_s3/pins_arduino.h b/variants/tamc_termod_s3/pins_arduino.h new file mode 100644 index 00000000000..ca86f85469f --- /dev/null +++ b/variants/tamc_termod_s3/pins_arduino.h @@ -0,0 +1,117 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +// Some boards have too low voltage on this pin (board design bug) +// Use different pin with 3V and connect with 48 +// and change this setup for the chosen pin (for example 38) +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN +#define RGB_BUILTIN LED_BUILTIN +#define RGB_BRIGHTNESS 64 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +static const uint8_t SDA = 8; +static const uint8_t SCL = 9; + +static const uint8_t SS = 10; +static const uint8_t MOSI = 11; +static const uint8_t MISO = 13; +static const uint8_t SCK = 12; + +static const uint8_t A0 = 1; +static const uint8_t A1 = 2; +static const uint8_t A2 = 3; +static const uint8_t A3 = 4; +static const uint8_t A4 = 5; +static const uint8_t A5 = 6; +static const uint8_t A6 = 7; +static const uint8_t A7 = 8; +static const uint8_t A8 = 9; +static const uint8_t A9 = 10; +static const uint8_t A10 = 11; +static const uint8_t A11 = 12; +static const uint8_t A12 = 13; +static const uint8_t A13 = 14; +static const uint8_t A14 = 15; +static const uint8_t A15 = 16; +static const uint8_t A16 = 17; +static const uint8_t A17 = 18; +static const uint8_t A18 = 19; +static const uint8_t A19 = 20; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T3 = 3; +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +static const uint8_t BAT_LV = 1; +static const uint8_t CHG = 2; +static const uint8_t TFT_CS = 10; +static const uint8_t TFT_DC = 18; +static const uint8_t TFT_RST = 14; +static const uint8_t TFT_BCKL = 48; // TFT Backlight is enabled by soldering JP2 together +static const uint8_t SD_CS = 21; +static const uint8_t SD_CD = 47; // uSD Card Detect is enabled by soldering JP1 together. + +#define DISPLAY_PORTRAIT 2 +#define DISPLAY_LANDSCAPE 3 +#define DISPLAY_PORTRAIT_FLIP 0 +#define DISPLAY_LANDSCAPE_FLIP 1 + +#define DISPLAY_WIDTH 240 +#define DISPLAY_HEIGHT 320 + +/** + * Get battery voltage in volts + * @return Battery voltage in volts + */ +float getBatteryVoltage(); +/** + * Get battery level in percent + * @return Battery level in percent(0-100) + */ +float getBatteryCapacity(); +/** + * Get battery charge state + * @return Battery charge state(true=charging, false=not charging) + */ +bool getChargingState(); +/** + * Set on charge start callback + * @param func On charge start Callback function + */ +void setOnChargeStart(void (*func)()); +/** + * Set on charge end callback + * @param func On charge end Callback function + */ +void setOnChargeEnd(void (*func)()); + +#endif /* Pins_Arduino_h */ diff --git a/variants/tamc_termod_s3/variant.cpp b/variants/tamc_termod_s3/variant.cpp new file mode 100644 index 00000000000..72bbf62614d --- /dev/null +++ b/variants/tamc_termod_s3/variant.cpp @@ -0,0 +1,38 @@ +#include "Arduino.h" + +float getBatteryVoltage() { + int analogVolt = analogReadMilliVolts(1); + float voltage = analogVolt / 1000.0; + voltage = voltage * (100.0+200.0) / 200.0; + return voltage; +} + +float getBatteryCapacity() { + float voltage = getBatteryVoltage(); + float capacity = (voltage - 3.3) / (4.2 - 3.3) * 100.0; + capacity = constrain(capacity, 0, 100); + return capacity; +} + +bool getChargingState() { + return !digitalRead(CHG); +} + +void (*__onChargeStart__)(); +void (*__onChargeEnd__)(); +void setOnChargeStart(void (*func)()) { __onChargeStart__ = func; } +void setOnChargeEnd(void (*func)()) { __onChargeEnd__ = func; } + +void ARDUINO_ISR_ATTR chargeIsr() { + if (getChargingState()) { + __onChargeStart__(); + } else { + __onChargeEnd__(); + } +} + +extern "C" void initVariant(void){ + pinMode(CHG, INPUT_PULLUP); + attachInterrupt(CHG, chargeIsr, CHANGE); + analogReadResolution(12); +} diff --git a/variants/ttgo-t-oi-plus/pins_arduino.h b/variants/ttgo-t-oi-plus/pins_arduino.h index 689f16c9a4f..16cac90bdaf 100644 --- a/variants/ttgo-t-oi-plus/pins_arduino.h +++ b/variants/ttgo-t-oi-plus/pins_arduino.h @@ -11,6 +11,8 @@ #define digitalPinToInterrupt(p) (((p) +#include "soc/soc_caps.h" + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +// Some boards have too low voltage on this pin (board design bug) +// Use different pin with 3V and connect with 48 +// and change this setup for the chosen pin (for example 38) +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN +#define BOARD_HAS_NEOPIXEL +#define LED_BRIGHTNESS 64 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +static const uint8_t TX = 45; +static const uint8_t RX = 44; + +static const uint8_t SDA = 4; +static const uint8_t SCL = 5; + +static const uint8_t SS = 46; +static const uint8_t MOSI = 3; +static const uint8_t MISO = 20; +static const uint8_t SCK = 19; + +static const uint8_t A0 = 7; +static const uint8_t A1 = 6; +static const uint8_t A2 = 2; +static const uint8_t A3 = 1; +static const uint8_t A4 = 4; +static const uint8_t A5 = 5; + +static const uint8_t D0 = 44; +static const uint8_t D1 = 45; +static const uint8_t D2 = 42; +static const uint8_t D3 = 41; +static const uint8_t D4 = 0; +static const uint8_t D5 = 45; +static const uint8_t D6 = 48; +static const uint8_t D7 = 47; +static const uint8_t D8 = 21; +static const uint8_t D9 = 14; +static const uint8_t D10 = 46; +static const uint8_t D11 = 3; +static const uint8_t D12 = 20; +static const uint8_t D13 = 19; + +#endif /* Pins_Arduino_h */ diff --git a/variants/wifiduinov2/pins_arduino.h b/variants/wifiduinov2/pins_arduino.h new file mode 100644 index 00000000000..4eb83a7c3ae --- /dev/null +++ b/variants/wifiduinov2/pins_arduino.h @@ -0,0 +1,54 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include "soc/soc_caps.h" + +#define EXTERNAL_NUM_INTERRUPTS 22 +#define NUM_DIGITAL_PINS 22 +#define NUM_ANALOG_INPUTS 6 + +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+13; +#define BUILTIN_LED LED_BUILTIN // backward compatibility +#define LED_BUILTIN LED_BUILTIN +#define BOARD_HAS_NEOPIXEL +#define LED_BRIGHTNESS 64 + +#define analogInputToDigitalPin(p) (((p)