Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade ESP32 IDF to v5.2.2 #2991

Merged
merged 15 commits into from
Jul 30, 2024
Merged

Conversation

AdrianSoundy
Copy link
Member

@AdrianSoundy AdrianSoundy commented Jul 30, 2024

Description

  • Minor changes to update IDF form v5.1.4 to v5.2.2
    • Uart defines changed to enum so serialport needed to be updated
    • Other typing issues
  • Bump dev containers versions.
  • Bump version to 1.12.0
  • Reset revision counters for targets.

Motivation and Context

Needed to be done.

How Has This Been Tested?

Run builds on Esp32, ESp32_S3, ESp32_C6

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Upgraded the ESP-IDF version from 5.1.4 to 5.2.2 across various components, enhancing functionality and compatibility.
    • Improved caching mechanism for ESP32 tools in Azure Pipelines, ensuring the use of the latest version.
  • Bug Fixes

    • Enhanced type safety and configuration handling in the UART and interrupt systems for improved reliability.
  • Chores

    • Updated version numbers in configuration files to reflect the new release version (1.12.0).

Copy link

coderabbitai bot commented Jul 30, 2024

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files selected but had no reviewable changes (1)
  • azure-pipelines.yml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates focus on upgrading the ESP-IDF version from v5.1.4 to v5.2.2 across multiple Dockerfiles and related configuration files. These enhancements may introduce new features, improvements, and bug fixes. Additionally, there are refinements to FreeRTOS configurations and type safety adjustments, particularly concerning UART handling, ensuring better compatibility and maintainability in the ESP32 development environment.

Changes

File Change Summary
.devcontainer/*/Dockerfile.*.SRC Updated base images and ESP-IDF version from v5.1.4 to v5.2.2.
azure-pipelines*.yml Changed reference tag for ESP-IDF from v5.1.4 to v5.2.2 in pipeline configurations; incremented REVISION variables to 1.12.0.
targets/ESP32/CMakeLists.txt Updated ESP32 IDF tag from "5.1.4" to "5.2.2".
CMake/Modules/FindESP32_IDF.cmake Added include directories for FreeRTOS configuration specific to ESP32.
CMake/binutils.ESP32.cmake Removed properties related to the IDF component manager, indicating a shift in component handling.
targets/ESP32/_Network/NF_ESP32_OpenThread.cpp Enhanced type safety with explicit casting and updated interrupt handling to align with new SDK practices.
targets/ESP32/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp Added a boolean parameter to timer_conf structure for better configuration.
targets/ESP32/_nanoCLR/System.Device.Spi/cpu_spi.cpp Modified ISR configuration to use ESP_INTR_CPU_AFFINITY_AUTO for improved dynamic handling.
targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp Updated UART instance declarations based on SOC_UART_HP_NUM for enhanced hardware flexibility.
targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_Hardware_Esp32_Sleep.cpp Changed uartNum type from int to uart_port_t for better type safety.
targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_nanoFramework_Hardware_Esp32_Touch_TouchPad.cpp Introduced explicit type casting for interrupt mask functions to enhance correctness.
azure-pipelines-templates/download-install-esp32-build-components.yml Updated cached version identifiers for ESP32 tools from 5_1_4 to 5_2_2.
azure-pipelines-templates/build-espressif-esp32-targets.yml Changed cache key for IDF components to `esp-idf-components-cache
version.json Updated version number from "1.11.0" to "1.12.0" to reflect the new release version.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant ESP32_IDF
    participant Build_System

    Developer->>ESP32_IDF: Upgrade to v5.2.2
    ESP32_IDF->>Build_System: New features and bug fixes
    Build_System->>Developer: Enhanced compatibility and functionality
Loading
sequenceDiagram
    participant UART_Config
    participant Interrupt_Service

    UART_Config->>Interrupt_Service: Update ISR CPU ID handling
    Interrupt_Service->>UART_Config: Improved load balancing for interrupts
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between aa925c9 and b0f842a.

Files selected for processing (13)
  • .devcontainer/All/Dockerfile.All.SRC (1 hunks)
  • .devcontainer/ESP32/Dockerfile.ESP32.SRC (1 hunks)
  • CMake/Modules/FindESP32_IDF.cmake (1 hunks)
  • CMake/binutils.ESP32.cmake (1 hunks)
  • azure-pipelines-nightly.yml (1 hunks)
  • azure-pipelines.yml (1 hunks)
  • targets/ESP32/CMakeLists.txt (1 hunks)
  • targets/ESP32/_Network/NF_ESP32_OpenThread.cpp (3 hunks)
  • targets/ESP32/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp (2 hunks)
  • targets/ESP32/_nanoCLR/System.Device.Spi/cpu_spi.cpp (1 hunks)
  • targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp (3 hunks)
  • targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_Hardware_Esp32_Sleep.cpp (1 hunks)
  • targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_nanoFramework_Hardware_Esp32_Touch_TouchPad.cpp (2 hunks)
Files skipped from review due to trivial changes (1)
  • CMake/binutils.ESP32.cmake
Additional comments not posted (22)
.devcontainer/ESP32/Dockerfile.ESP32.SRC (1)

51-51: LGTM!

The ESP-IDF version has been correctly updated to v5.2.2.

targets/ESP32/CMakeLists.txt (1)

63-63: LGTM!

The ESP-IDF version has been correctly updated to v5.2.2.

.devcontainer/All/Dockerfile.All.SRC (1)

93-93: LGTM!

The ESP-IDF version has been correctly updated to v5.2.2.

CMake/Modules/FindESP32_IDF.cmake (1)

117-119: Ensure consistency in FreeRTOS include paths.

The added paths for FreeRTOS configuration include directories are consistent with the existing structure and enhance the build configuration.

targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_Hardware_Esp32_Sleep.cpp (1)

242-246: Enhance type safety with uart_port_t.

The change to use uart_port_t for uartNum improves type safety and clarity. Ensure that all related code correctly handles this type.

targets/ESP32/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp (2)

163-163: Verify the addition of the boolean parameter in timer_conf.

The new boolean parameter added to the timer_conf initialization should be verified to ensure it aligns with the intended functionality and does not introduce any unintended side effects.


319-319: Verify the addition of the boolean parameter in timer_conf.

The new boolean parameter added to the timer_conf initialization should be verified to ensure it aligns with the intended functionality and does not introduce any unintended side effects.

targets/ESP32/_Network/NF_ESP32_OpenThread.cpp (2)

46-46: Enhance type safety with explicit type casting.

Explicitly casting the integer 0 to uart_port_t improves type safety and prevents potential runtime issues.


75-75: Update interrupt CPU affinity constant.

Changing the isr_cpu_id field to use ESP_INTR_CPU_AFFINITY_0 aligns with updated ESP32 SDK practices for interrupt handling.

targets/ESP32/_nanoCLR/System.Device.Spi/cpu_spi.cpp (1)

177-177: Enhance ISR CPU affinity handling.

Changing the isr_cpu_id field to use ESP_INTR_CPU_AFFINITY_AUTO allows for dynamic CPU affinity handling, potentially improving load balancing and resource assignment during SPI operations.

azure-pipelines-nightly.yml (1)

20-20: Upgrade ESP-IDF version.

Updating the reference tag from v5.1.4 to v5.2.2 ensures compatibility with the latest ESP-IDF version, potentially bringing in bug fixes, new features, and improvements.

targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_nanoFramework_Hardware_Esp32_Touch_TouchPad.cpp (2)

41-41: Type casting improves type safety.

The explicit type casting for the touch_pad_intr_clear function parameter ensures the bitwise OR operation on the interrupt mask constants is correctly interpreted. This enhances type safety.


74-74: Type casting improves type safety.

The explicit type casting for the touch_pad_intr_disable function parameter ensures the bitwise OR operation on the interrupt mask constants is correctly interpreted. This enhances type safety.

targets/ESP32/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp (8)

23-23: Conditional compilation enhances flexibility.

The conditional compilation for declaring Uart2_PAL based on SOC_UART_HP_NUM > 2 ensures the code adapts to a broader range of hardware configurations.


26-28: Conditional compilation enhances flexibility.

The conditional compilation for declaring Uart3_PAL based on SOC_UART_HP_NUM > 3 ensures the code adapts to a broader range of hardware configurations.


42-42: Conditional compilation enhances flexibility.

The conditional compilation for handling UART_NUM_2 based on SOC_UART_HP_NUM > 2 ensures the code adapts to a broader range of hardware configurations.


48-52: Conditional compilation enhances flexibility.

The conditional compilation for handling UART_NUM_3 based on SOC_UART_HP_NUM > 3 ensures the code adapts to a broader range of hardware configurations.


1445-1445: Conditional compilation enhances flexibility.

The conditional compilation for including COM2 in the device selector string based on SOC_UART_HP_NUM > 1 ensures the string accurately reflects the available UART ports.


1448-1450: Conditional compilation enhances flexibility.

The conditional compilation for including COM3 in the device selector string based on SOC_UART_HP_NUM > 2 ensures the string accurately reflects the available UART ports.


1451-1452: Conditional compilation enhances flexibility.

The conditional compilation for including COM4 in the device selector string based on SOC_UART_HP_NUM > 3 ensures the string accurately reflects the available UART ports.


49-51: Conditional compilation enhances flexibility.

The conditional compilation for handling UART_NUM_3 based on SOC_UART_HP_NUM > 3 ensures the code adapts to a broader range of hardware configurations.

azure-pipelines.yml (1)

51-51: LGTM! But verify compatibility with the new ESP-IDF version.

The reference tag for the espressif/esp-idf repository has been updated to refs/tags/v5.2.2. Ensure that this new version is compatible and does not introduce any breaking changes.

…556-b2cc-4095-88a8-435b87cc5735

Code style fixes for nanoframework/nf-interpreter PR#2991
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b0f842a and 4cfa7f9.

Files selected for processing (1)
  • azure-pipelines-templates/download-install-esp32-build-components.yml (1 hunks)
Additional comments not posted (2)
azure-pipelines-templates/download-install-esp32-build-components.yml (2)

9-9: Cache key updated to new version.

The cache key for ESP32 tools has been correctly updated from 5_1_4 to 5_2_2.


10-10: Restore key updated to new version.

The restore key for ESP32 tools has been correctly updated from 5_1_4 to 5_2_2.

@AdrianSoundy
Copy link
Member Author

@josesimoes
Not sure if I got all the dev container changes required

@nfbot nfbot added Area: Config-and-Build Type: dependencies Pull requests that update a dependency file(s) or version labels Jul 30, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4cfa7f9 and fd206b5.

Files selected for processing (2)
  • targets/ESP32/_nanoCLR/System.Device.Spi/cpu_spi.cpp (6 hunks)
  • targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_nanoFramework_Hardware_Esp32_Touch_TouchPad.cpp (4 hunks)
Files skipped from review due to trivial changes (1)
  • targets/ESP32/_nanoCLR/nanoFramework.Hardware.ESP32/nanoFramework_hardware_esp32_native_nanoFramework_Hardware_Esp32_Touch_TouchPad.cpp
Files skipped from review as they are similar to previous changes (1)
  • targets/ESP32/_nanoCLR/System.Device.Spi/cpu_spi.cpp

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I've just bumped the dev containers versions and the components cache. All the rest was OK.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
azure-pipelines-templates/build-espressif-esp32-targets.yml (1)

50-50: Fix trailing spaces.

There are trailing spaces on this line.

-          eq(variables['TargetSeries'], 'esp32s3')       
+          eq(variables['TargetSeries'], 'esp32s3')
Tools
yamllint

[error] 50-50: trailing spaces

(trailing-spaces)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fd206b5 and ecba136.

Files selected for processing (3)
  • .devcontainer/All/Dockerfile.All (1 hunks)
  • .devcontainer/ESP32/Dockerfile.ESP32 (1 hunks)
  • azure-pipelines-templates/build-espressif-esp32-targets.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .devcontainer/ESP32/Dockerfile.ESP32
Additional context used
yamllint
azure-pipelines-templates/build-espressif-esp32-targets.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)


[error] 50-50: trailing spaces

(trailing-spaces)

Additional comments not posted (2)
.devcontainer/All/Dockerfile.All (1)

1-1: LGTM! Verify the compatibility of the new base image.

The update to the base image version from v2.49 to v2.50 looks good.

Ensure that the new base image version is compatible and doesn't introduce any breaking changes.

azure-pipelines-templates/build-espressif-esp32-targets.yml (1)

20-20: LGTM! Verify the build process with the updated cache key.

The update to the cache key for IDF components looks good.

Ensure that the build process works correctly with the updated cache key.

Verification successful

Verification successful: The cache key update is present and consistent across the relevant YAML files.

The updated cache key "esp-idf-components-cache | 5_2_2" has been correctly applied in the azure-pipelines-templates/build-espressif-esp32-targets.yml file. Additionally, related cache keys are updated in other relevant files, ensuring consistency.

  • azure-pipelines-templates/build-espressif-esp32-targets.yml
  • azure-pipelines-templates/download-install-esp32-build-components.yml
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the build process with the updated cache key.

# Test: Trigger the build process and check for any issues.
az pipelines run --name <pipeline_name> --branch <branch_name>

Length of output: 205


Script:

#!/bin/bash
# Search for the updated cache key in Azure Pipelines YAML files to verify its presence and correctness.
rg "esp-idf-components-cache | 5_2_2" -A 5 --glob "*.yml"

Length of output: 1308

- CLR version is now passed to CLI job so there is a version numbering consistency between the DLL published to CloudSmith repo and the one distributed with the CLR nupkg.

***NO_CI***
- Reset target revision counter
@josesimoes josesimoes added the Platform: ESP32 Everything related specifically with ESP32 platform label Jul 30, 2024
@josesimoes josesimoes enabled auto-merge (squash) July 30, 2024 12:53
josesimoes added a commit to nanoframework/nf-Community-Targets that referenced this pull request Jul 30, 2024
- Reset revision counter variables.
- Fix IDF version.
- All these following nanoframework/nf-interpreter#2991.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ecba136 and a693f1a.

Files selected for processing (3)
  • azure-pipelines-nightly.yml (5 hunks)
  • azure-pipelines.yml (7 hunks)
  • version.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • version.json
Files skipped from review as they are similar to previous changes (2)
  • azure-pipelines-nightly.yml
  • azure-pipelines.yml

- CLR version is now passed to CLI job so there is a version numbering consistency between the DLL published to CloudSmith repo and the one distributed with the CLR nupkg.

***NO_CI***
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a693f1a and ed65afc.

Files selected for processing (3)
  • .devcontainer/All/Dockerfile.All.SRC (1 hunks)
  • .devcontainer/ESP32/Dockerfile.ESP32.SRC (1 hunks)
  • azure-pipelines.yml (8 hunks)
Files skipped from review as they are similar to previous changes (3)
  • .devcontainer/All/Dockerfile.All.SRC
  • .devcontainer/ESP32/Dockerfile.ESP32.SRC
  • azure-pipelines.yml

@josesimoes josesimoes merged commit a384668 into nanoframework:main Jul 30, 2024
36 of 38 checks passed
@AdrianSoundy
Copy link
Member Author

@josesimoes
Thanks for completing this overnight :-)

@AdrianSoundy AdrianSoundy deleted the idf_5.2.2 branch July 30, 2024 22:28
@josesimoes
Copy link
Member

@AdrianSoundy no problem! Thank YOU for making it happen. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Config-and-Build Area: Dev-Containers Platform: ESP32 Everything related specifically with ESP32 platform Type: dependencies Pull requests that update a dependency file(s) or version Type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants