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

ESP-IDF v5.1 #7733

Merged
merged 179 commits into from
Oct 5, 2023
Merged

ESP-IDF v5.1 #7733

merged 179 commits into from
Oct 5, 2023

Conversation

me-no-dev
Copy link
Member

@me-no-dev me-no-dev commented Jan 19, 2023

This is very much work in progress. For now it's used only to update everything necessary and use the CI.

Changes that need to be done:

  • Replace all FreeRTOS handles to the new API to allow running as component when compatibility is disabled
  • Refactor platform.txt to not use components installed through the board manager when running from git
  • Create Peripheral Manager to keep track of bus drivers and pins

Warnings left to be fixed:

ESP-IDF Driver Deprecations

  • ADC
In file included from cores/esp32/esp32-hal-adc.c:16:
tools/sdk/esp32/include/driver/deprecated/driver/adc.h:19
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~

In file included from cores/esp32/esp32-hal-adc.c:17:
tools/sdk/esp32/include/esp_adc/deprecated/include/esp_adc_cal.h:17
   17 | #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h"
      |  ^~~~~~~
  • DAC
In file included from cores/esp32/esp32-hal-dac.c:22:
tools/sdk/esp32/include/driver/deprecated/driver/dac.h:16
   16 | #warning "The legacy DAC driver is deprecated, please use `driver/dac_oneshot.h`, `driver/dac_cosine.h` or `driver/dac_continuous.h` instead"
      |  ^~~~~~~
  • RMT
In file included from cores/esp32/esp32-hal-rmt.c:16:
tools/sdk/esp32/include/driver/deprecated/driver/rmt.h:18
   18 | #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h"
      |  ^~~~~~~
  • Sigma Delta
In file included from cores/esp32/esp32-hal-sigmadelta.c:19:
tools/sdk/esp32/include/driver/deprecated/driver/sigmadelta.h:15
   15 | #warning "The legacy sigma-delta driver is deprecated, please use driver/sdm.h"
      |  ^~~~~~~
  • HW Timer
In file included from cores/esp32/esp32-hal-timer.c:16:
tools/sdk/esp32/include/driver/deprecated/driver/timer.h:16
   16 | #warning "legacy timer group driver is deprecated, please migrate to driver/gptimer.h"
      |  ^~~~~~~
  • I2S
In file included from tools/sdk/esp32/include/driver/deprecated/driver/i2s.h:23,
                 from libraries/I2S/src/I2S.h:26:
tools/sdk/esp32/include/driver/deprecated/driver/adc.h:19
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~

In file included from libraries/I2S/src/I2S.h:26:
tools/sdk/esp32/include/driver/deprecated/driver/i2s.h:27
   27 | #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead.
      |  ^~~~~~~

libraries/I2S/src/I2S.cpp:148
  148 |     #warning The following values are new and need to be checked
      |      ^~~~~~~
  • I2S Example
In file included from tools/sdk/esp32/include/driver/deprecated/driver/i2s.h:23,
                 from libraries/ESP32/examples/I2S/HiFreq_ADC/HiFreq_ADC.ino:23:
tools/sdk/esp32/include/driver/deprecated/driver/adc.h:19
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~

In file included from libraries/ESP32/examples/I2S/HiFreq_ADC/HiFreq_ADC.ino:23:
tools/sdk/esp32/include/driver/deprecated/driver/i2s.h:27
   27 | #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead.
      |  ^~~~~~~

Upstream warnings that can not be silenced

Insights
In file included from tools/sdk/esp32/include/esp_insights/include/esp_insights.h:18,
                 from libraries/Insights/src/Insights.cpp:8:
tools/sdk/esp32/include/esp_diagnostics/include/esp_diagnostics.h:241:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
  241 |     esp_diag_log_event(tag, "EV (%"PRIu32") %s: " format, esp_log_timestamp(), tag, ##__VA_ARGS__); \
      |      

@VojtechBartoska VojtechBartoska added this to the 3.0.0 milestone Jan 23, 2023
@VojtechBartoska
Copy link
Contributor

VojtechBartoska commented Jan 23, 2023

To-Do list till Wednesday 25.1.:

  • @SuGlider & @P-R-O-C-H-Y - please check related drivers and think about possible approach for porting them
  • @PilnyTomas - please check out this branch and update new toolchain and test WiFI & Bluetooth (run some examples)

@VojtechBartoska VojtechBartoska added the Status: In Progress Issue is in progress label Jan 23, 2023
@SuGlider
Copy link
Collaborator

RMT Report

All the Arduino ESP32 RMT examples compiled and worked as expected using ESP32 and ESP32C3 (using IDF 5.1 Legacy Driver)

New IDF 5.1 RMT is quite different when compared with IDF 4.4 (which has the same API as the IDF 5.1 Legacy Driver)
Refactoring RMT to use new API from IDF 5.1 will demand some effort and time.

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

P-R-O-C-H-Y commented Jan 24, 2023

Report from peripherals testing:

ADC:

  • Found BUG analogRead -> line 178 (return) is wrong, should be 0 because error occured (not related to IDF 5.x)
  • ADC not working on all chips using IDF 5.1 legacy driver
  • New ADC driver, split ADC source files to Continuous / OneShot, refactoring needed.
  • side note for migration guide - Hall sensor read REMOVED from IDF 5.X (Hristo removed that already)

DAC:

  • DAC tested using IDF 5.1 legacy driver, working on ESP32 but broken on ESP32-S2
  • new DAC driver have been redesigned, need to be refactored.

Sigma-Delta:

  • Example compiled and working using IDF 5.1 legacy driver
  • Tested on ESP32, ESP32-C3, ESP32-S2 and ESP32-S3
  • New SigmaDelta driver have new API, refactoring is needed (not that complicated)

Timer:

  • HW test compiled and working using IDF 5.1 legacy driver
  • Tested on ESP32, pytest seems to not work properly, compiling working on all chips, but running test doesn’t accept other chips than ESP32
  • New Timer driver (GPTimer) have new API, refactoring is needed
  • New driver seems to be allowed to run within ISR context (should fix some related issues)

@PilnyTomas
Copy link
Contributor

PilnyTomas commented Jan 24, 2023

Branch esp-idf-v5.1-libs SoC ESP32
WiFi examples:

  • SimpleWiFiServer
  • WiFiAccessPoint - problems with SSID - after flashing code with new SSID it does not appear -old one is used
  • WiFiClient
  • WiFiClientConnect
  • WiFiScan

WiFi Client Secure examples:

  • WiFiClientInsecure
  • WiFiClientPSK (failed to connect to the server)
  • WiFiClientSecure
  • WiFiClientShowPeerCredentials (server connection failed, followed by abort())

BT examples:

  • bt_classic_device_discovery
  • bt_remove_paired_devices

me-no-dev and others added 7 commits July 4, 2023 10:45
* update tests requirements

* remove already handled components

* Update version of pytest

* Add missing ESP32-H2 to hil.yml
* add C6/H2 to tests cfg.json

* remove ,

* workflow runs-on runner by matrix

* Add need for arduino tag to select runner

* Add cryptography to requirements.txt
@hansmbakker
Copy link

hansmbakker commented Jul 18, 2023

Hi! I’m really looking forward to this new version of arduino-esp32! Is there any indication on when we can start trying it?

@me-no-dev
Copy link
Member Author

Hi! I’m really looking forward to this new version of arduino-esp32! Is there any indication on when we can start trying it?

you can start now if you install it through github. Just make sure you pull the correct branch and then execute tools/get.exe or tools/get.py

SuGlider and others added 18 commits July 20, 2023 12:31
* Fixes Filter and Idle parameter to uint32

* Fixes Filter and Idle setup

* Fixes it to 5.1Libs branch

* fix RMT CLK source and Filter API

* fixes missing ;

* fixes missing ;

* fixes RMT example
* Add workflow to build executables from python scripts

* Push binary to tools

* Enable executable signing on Windows

* Update get.py

* Push binary to tools

* Try with multiple files

* Try more actions

* Try powershell

* Restore tools so they do not get rebuilt

* Finalize scripts

* Push binary to tools
…ntation. Previous pin use works but is inconsistent with C6 docs.
* fixes preprocessor test

When using `#define USE_SOFT_AP` 
Change
`&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)`

* Adds any BLE capable device in WiFiProv.ino

Removing ESP32 restriction for BLE Provisioning.
Fixing UART1 pins for esp-idf-v5.1-libs
* Updated SD_MMC lib and examples

* Removed getter implementation and commented usage in examples

* squashed updates
@me-no-dev me-no-dev merged commit 6f7a1ca into master Oct 5, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.