Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates the esp32 port to use IDF 5.4.2 (instead of 5.4.1).
The CI will now use IDF 5.4.2, and the README recommends this as the officially supported version. Downloads will also use the new version.
Thanks to @projectgus, here is a summary of the change in firmware size and RAM usage moving from 5.4.1 to 5.4.2:
Comparing with 5.4.1, firmware size is up by about 1.5k on ESP32 and 9k on ESP32-S3. But IRAM usage (of the IDF) is down by about 500 byte on ESP32 and DRAM usage is down by about 20k on ESP32 and 10k on ESP32-S3.
Testing
I ran the full test suite (Python, .mpy, native, hardware, BLE, WiFi) on ESP32, ESP32-S2, ESP32-S3 and ESP32-C3. I did not see any regressions.
However, I did see a change in BLE event behaviour which makes
tests/multi_bluetooth/ble_mtu.py
andtests/multi_bluetooth/ble_mtu_peripheral.py
now fail on ESP32 with IDF 5.4.2. The change in behaviour is that MTU_EXCHANGE events can now occur before CENTRAL_CONNECT/PERIPHERAL_CONNECT events. That seems a bit strange, because the MTU exchange occurs after the connection. And looking at the timing of the events there is exactly 100ms between them, ie MTU_EXCHANGE fires and then exactly 100ms later CENTRAL_CONNECT/PERIPHERAL_CONNECT fires.I don't know if this is a bug in (Espressif's) NimBLE, a subtle change in scheduling with still valid behaviour, an intended change, a change allowed under the BLE spec, or something else. But I doubt we can fix that (easily) on our side and so in order to move forward with updating to IDF 5.4.2 I have adjusted the relevant tests so they can pass (basically, the test just needs to wait a bit between doing the connect and doing the MTU exchange, so the other side sees the original/correct ordering of events).
I have tested the modified tests on PYBD_SF6, RPI_PICO_W, ESP32 (IDF 5.4.1 and IDF 5.4.2) and ESP32-S3 (IDF 5.4.1 and IDF 5.4.2). They pass.
Trade-offs and Alternatives