Skip to content

Upgrade ESP32 IDF to v5.2.2 #2991

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/All/Dockerfile.All
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-all:v2.49
FROM ghcr.io/nanoframework/dev-container-all:v2.50
2 changes: 1 addition & 1 deletion .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip

# Clone ESP-IDF
RUN git clone --branch v5.1.4 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.2.2 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Clone what is needed for TI
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/ESP32/Dockerfile.ESP32
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-esp32:v2.31
FROM ghcr.io/nanoframework/dev-container-esp32:v2.32
2 changes: 1 addition & 1 deletion .devcontainer/ESP32/Dockerfile.ESP32.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RUN mkdir -p /usr/local/bin/gcc
RUN git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs

# Clone ESP-IDF
RUN git clone --branch v5.1.4 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.2.2 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Creating static link python for pyhton3
RUN ln -fs /usr/bin/python3 /usr/bin/python \
Expand Down
4 changes: 3 additions & 1 deletion CMake/Modules/FindESP32_IDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ include(${TARGET_SERIES}_GCC_options)
# freertos #
############

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/config/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/config/include/freertos)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/config/${ESP32_CPU_TYPE}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/FreeRTOS-Kernel/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/include/esp_additions)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/esp_additions/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/esp_additions/include/freertos)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/esp_additions/arch/${ESP32_CPU_TYPE}/include)
Expand Down
4 changes: 0 additions & 4 deletions CMake/binutils.ESP32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,6 @@ macro(nf_add_idf_as_library)

if(ESP32_USB_CDC)

#idf_build_set_property(IDF_COMPONENT_MANAGER 1)
#idf_build_set_property(__COMPONENT_MANAGER_INTERFACE_VERSION 2)
#message(STATUS "Support for component manager enabled")

# add IDF components specific to ESP32S2/S3 series
# They have to be added in a specific order so they compile/link ok
list(APPEND IDF_COMPONENTS_TO_ADD tinyusb)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: refs/tags/v5.1.4
ref: refs/tags/v5.2.2

# scheduled build
# the schedule is defined at the AZDO web interface because of inconsistencies with time zones
Expand Down
212 changes: 106 additions & 106 deletions azure-pipelines-templates/build-espressif-esp32-targets.yml
Original file line number Diff line number Diff line change
@@ -1,106 +1,106 @@
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.

parameters:
- name: repoDirectory
type: string
default: $(Build.SourcesDirectory)\nf-interpreter
- name: partitionsDirectory
type: string
default: $(Build.SourcesDirectory)\nf-interpreter\targets\ESP32\_IDF\$(IDF_Target)

steps:
- template: setup-cmake-user-presets.yml
parameters:
repoDirectory: ${{ parameters.repoDirectory }}

- task: Cache@2
displayName: Cache IDF components
inputs:
key: 'esp-idf-components-cache | 0'
path: $(Agent.BuildDirectory)/s/esp-idf/components
cacheHitVar: ESP32_COMPONENTS_RESTORED

- task: CMake@1
condition: succeeded()
displayName: Setup build with CMake
inputs:
cmakeArgs: "--preset $(CMakePreset) -DESP32_IDF_PATH=$(IDF_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions)"
workingDirectory: ${{ parameters.repoDirectory }}

- task: CMake@1
displayName: Build with CMake
condition: succeeded()
inputs:
cmakeArgs: "--build --preset $(CMakePreset) --target all --config MinSizeRel"
workingDirectory: ${{ parameters.repoDirectory }}

# because of permission issues (the python script isn't allowed to write on the output folder)
# we need to perform these steps by calling directly the python scripts

# 16MB partition table it's generated for ESP32 and ESP32_C3 only
- task: PythonScript@0
condition: >-
and(
succeeded(),
or(
eq(variables['TargetSeries'], 'esp32'),
eq(variables['TargetSeries'], 'esp32c6'),
eq(variables['TargetSeries'], 'esp32s2'),
eq(variables['TargetSeries'], 'esp32s3')
)
)
displayName: Generate ESP32 Partition tables for 16MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_16mb.csv ${{ parameters.repoDirectory }}\build\partitions_16mb.bin'

- task: PythonScript@0
condition: >-
and(
succeeded(),
or(
eq(variables['TargetSeries'], 'esp32'),
eq(variables['TargetSeries'], 'esp32s2')
)
)
displayName: Generate ESP32 Partition tables for 8MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_8mb.csv ${{ parameters.repoDirectory }}\build\partitions_8mb.bin'

- task: PythonScript@0
condition: succeeded()
displayName: Generate ESP32 Partition tables for 4MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_4mb.csv ${{ parameters.repoDirectory }}\build\partitions_4mb.bin'

- task: PythonScript@0
condition: >-
and(
succeeded(),
or(
eq(variables['TargetSeries'], 'esp32'),
eq(variables['TargetSeries'], 'esp32c3')
)
)
displayName: Generate ESP32 Partition tables for 2MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_2mb.csv ${{ parameters.repoDirectory }}\build\partitions_2mb.bin'

- task: CopyFiles@2
condition: succeeded()
displayName: Copy CSV partition files
inputs:
sourceFolder: ${{ parameters.partitionsDirectory }}
Contents: |
*.csv
TargetFolder: ${{ parameters.repoDirectory }}\build
flattenFolders: false
ignoreMakeDirErrors: true
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
parameters:
- name: repoDirectory
type: string
default: $(Build.SourcesDirectory)\nf-interpreter
- name: partitionsDirectory
type: string
default: $(Build.SourcesDirectory)\nf-interpreter\targets\ESP32\_IDF\$(IDF_Target)
steps:
- template: setup-cmake-user-presets.yml
parameters:
repoDirectory: ${{ parameters.repoDirectory }}
- task: Cache@2
displayName: Cache IDF components
inputs:
key: 'esp-idf-components-cache | 5_2_2'
path: $(Agent.BuildDirectory)/s/esp-idf/components
cacheHitVar: ESP32_COMPONENTS_RESTORED
- task: CMake@1
condition: succeeded()
displayName: Setup build with CMake
inputs:
cmakeArgs: "--preset $(CMakePreset) -DESP32_IDF_PATH=$(IDF_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_VersionMajor).$(NBGV_VersionMinor).$(NBGV_BuildNumber).$(TARGET_BUILD_COUNTER) -DTARGET_NAME=$(TargetPublishName) $(BuildOptions)"
workingDirectory: ${{ parameters.repoDirectory }}
- task: CMake@1
displayName: Build with CMake
condition: succeeded()
inputs:
cmakeArgs: "--build --preset $(CMakePreset) --target all --config MinSizeRel"
workingDirectory: ${{ parameters.repoDirectory }}
# because of permission issues (the python script isn't allowed to write on the output folder)
# we need to perform these steps by calling directly the python scripts
# 16MB partition table it's generated for ESP32 and ESP32_C3 only
- task: PythonScript@0
condition: >-
and(
succeeded(),
or(
eq(variables['TargetSeries'], 'esp32'),
eq(variables['TargetSeries'], 'esp32c6'),
eq(variables['TargetSeries'], 'esp32s2'),
eq(variables['TargetSeries'], 'esp32s3')
)
)
displayName: Generate ESP32 Partition tables for 16MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_16mb.csv ${{ parameters.repoDirectory }}\build\partitions_16mb.bin'
- task: PythonScript@0
condition: >-
and(
succeeded(),
or(
eq(variables['TargetSeries'], 'esp32'),
eq(variables['TargetSeries'], 'esp32s2')
)
)
displayName: Generate ESP32 Partition tables for 8MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_8mb.csv ${{ parameters.repoDirectory }}\build\partitions_8mb.bin'
- task: PythonScript@0
condition: succeeded()
displayName: Generate ESP32 Partition tables for 4MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_4mb.csv ${{ parameters.repoDirectory }}\build\partitions_4mb.bin'
- task: PythonScript@0
condition: >-
and(
succeeded(),
or(
eq(variables['TargetSeries'], 'esp32'),
eq(variables['TargetSeries'], 'esp32c3')
)
)
displayName: Generate ESP32 Partition tables for 2MB flash
inputs:
scriptSource: "filePath"
scriptPath: '$(IDF_PATH)\components\partition_table\gen_esp32part.py'
arguments: '--verify ${{ parameters.partitionsDirectory }}\partitions_nanoclr_2mb.csv ${{ parameters.repoDirectory }}\build\partitions_2mb.bin'
- task: CopyFiles@2
condition: succeeded()
displayName: Copy CSV partition files
inputs:
sourceFolder: ${{ parameters.partitionsDirectory }}
Contents: |
*.csv
TargetFolder: ${{ parameters.repoDirectory }}\build
flattenFolders: false
ignoreMakeDirErrors: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ steps:
- task: Cache@2
displayName: Cache ESP32 tools
inputs:
key: "esp32_tools | 5_1_4"
restoreKeys: 5_1_4
key: "esp32_tools | 5_2_2"
restoreKeys: 5_2_2
path: $(UserProfile)\.espressif\tools
cacheHitVar: ESP32_TOOLS_CACHE_RESTORED

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resources:
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: 'refs/tags/v5.1.4'
ref: 'refs/tags/v5.2.2'
- repository: mscorlib
type: github
name: nanoframework/CoreLibrary
Expand Down
2 changes: 1 addition & 1 deletion targets/ESP32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ endif()
# WHEN CHANGING THIS MAKE SURE TO UPDATE:
# 1. the dev containers
# 2. ref in AZDO pipeline yaml in Community Targets repo
set(ESP32_IDF_TAG "5.1.4" CACHE INTERNAL "ESP32 IDF tag")
set(ESP32_IDF_TAG "5.2.2" CACHE INTERNAL "ESP32 IDF tag")

if(NO_ESP32_IDF_PATH)
# no ESP32 IDF source specified, download it from official repo
Expand Down
6 changes: 3 additions & 3 deletions targets/ESP32/_Network/NF_ESP32_OpenThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern void ThreadSetInterfaceNumber(int networkInterfaceNumber);
.host_connection_mode = HOST_CONNECTION_MODE_RCP_UART, \
.host_uart_config = \
{ \
.port = 0, \
.port = (uart_port_t)0, \
.uart_config = \
{ \
.baud_rate = 460800, \
Expand Down Expand Up @@ -72,7 +72,7 @@ extern void ThreadSetInterfaceNumber(int networkInterfaceNumber);
.sclk_io_num = 0, \
.quadwp_io_num = -1, \
.quadhd_io_num = -1, \
.isr_cpu_id = INTR_CPU_ID_0, \
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_0, \
}, \
.slave_config = \
{ \
Expand Down Expand Up @@ -384,7 +384,7 @@ esp_err_t initOpenThread(ThreadDeviceType deviceType, esp_openthread_radio_mode_
config.host_config = ESP_OPENTHREAD_DEFAULT_UART_HOST_CONFIG();

// Set COM port using ESP32 configured pins
config.host_config.host_uart_config.port = port;
config.host_config.host_uart_config.port = (uart_port_t)port;

config.host_config.host_uart_config.uart_config.baud_rate = baud_rate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ HRESULT sys_dev_pwm_native_System_Device_Pwm_PwmChannelHelpers::ConfigureAndStar

duty_res = (ledc_timer_bit_t)optimumDutyResolution;

timer_conf = {mode, duty_res, timer_sel, (uint32_t)desiredFrequency, LEDC_AUTO_CLK};
timer_conf = {mode, duty_res, timer_sel, (uint32_t)desiredFrequency, LEDC_AUTO_CLK, true};

result = ledc_timer_config(&timer_conf);

Expand Down Expand Up @@ -316,7 +316,7 @@ HRESULT Library_sys_dev_pwm_native_System_Device_Pwm_PwmChannel::NativeSetDesire

duty_res = (ledc_timer_bit_t)optimumDutyResolution;

timer_conf = {mode, duty_res, timer, (uint32_t)desiredFrequency, LEDC_AUTO_CLK};
timer_conf = {mode, duty_res, timer, (uint32_t)desiredFrequency, LEDC_AUTO_CLK, true};

result = ledc_timer_config(&timer_conf);

Expand Down
Loading
Loading