-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32: Switch to IDF v5.0 #11528
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
esp32: Switch to IDF v5.0 #11528
Conversation
Code size report:
|
Codecov Report
@@ Coverage Diff @@
## master #11528 +/- ##
=======================================
Coverage 98.40% 98.40%
=======================================
Files 155 155
Lines 20543 20543
=======================================
Hits 20215 20215
Misses 328 328
|
8d5c49b
to
44f4b13
Compare
For the table above: I just tested this branch on both the ESP32-S2 and the ESP32-S3 and the ULP-FSM works correctly. (To test, I used this sample code: #11761 (comment)). I still want to test the same on the original ESP32 and will then let you know my result. |
Now I tested this branch on the original ESP32 too and the ULP-FSM works correctly. |
Thank you @wnienhaus ! I have updated the table. |
c65d0d5
to
a70fb7a
Compare
I am using this on ESP32-S3 and can confirm SPIRAM works great there (gc.mem_free() shows me 4MB heap and it works), and UART REPL is fine. I have also tested WIFI STA and it works. It's a huge help for my project, so thank you! |
@bwhitman did you delete a comment about LFS2 partitions not working? I just want to make sure everything is OK with that (it would be a show-stopper if it didn't work). |
I did. I thought it was due to the new MP or IDF, but it was because the new IDF gave me a new env where I re-installed |
No worries. But, yes, definitely best to update your comment instead of deleting 😄 |
Tested: GPIO, I2C, SPI, RMT, NeoPixel, ADC, PWM across OG,S2,S3,C3. Also added REPL UART+USB on S2,S3, and Ethernet (IP101) on OG. |
SD card code has been updated for IDF v5, and tested working on ESP32. |
Tested PPP on OG/S3/C3, SDCard on S3. |
Thanks @dpgeorge , creating the filesystem manually works.
|
In this case (programming with a UF2) it's assumed that the previous firmware has created the FAT filesystem. To improve this situation we need to modify |
Ok makes sense thanks. I just tested this board without the bootloader.
again probably doing something wrong but the usb doesn't enumerate and a loadstore error is repeated on uart0. Could it be related?
|
I had this exact same error (LoadStoreError), when I used the wrong offset for the |
I've run our main project on this PR built with
|
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
To prevent warnings when building with ESP IDF v5. Signed-off-by: Damien George <damien@micropython.org>
Allows registering UART interrupt again. Signed-off-by: Angus Gratton <angus@redyak.com.au>
This function was made private/static in IDF commit c67f4c2, so it add back here. Signed-off-by: Damien George <damien@micropython.org>
The hall sensor is no longer supported by IDF v5. Signed-off-by: Damien George <damien@micropython.org>
This commit updates the esp32 port to work exclusively with ESP-IDF v5. IDF v5 is needed for some of the newer ESP32 SoCs to work, and it also cleans up a lot of the inconsistencies between existing SoCs (eg S2, S3, and C3). Support for IDF v4 is dropped because it's a lot of effort to maintain both versions at the same time. The following components have been verified to work on the various SoCs: ESP32 ESP32-S2 ESP32-S3 ESP32-C3 build pass pass pass pass SPIRAM pass pass pass N/A REPL (UART) pass pass pass pass REPL (USB) N/A pass pass N/A filesystem pass pass pass pass GPIO pass pass pass pass SPI pass pass pass pass I2C pass pass pass pass PWM pass pass pass pass ADC pass pass pass pass WiFi STA pass pass pass pass WiFi AP pass pass pass pass BLE pass N/A pass pass ETH pass -- -- -- PPP pass pass pass -- sockets pass pass pass pass SSL pass ENOMEM pass pass RMT pass pass pass pass NeoPixel pass pass pass pass I2S pass pass pass N/A ESPNow pass pass pass pass ULP-FSM pass pass pass N/A SDCard pass N/A N/A pass WDT pass pass pass pass Signed-off-by: Damien George <damien@micropython.org> Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
IDF v5.0 provides access to rssi value for received espnow packets via recv_info arg to recv_cb(). Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
And change erase_flash to erase-flash, because the former is deprecated since IDF 4.4. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Very good, thanks for the additional testing! I have also tested |
Merged! |
Thanks. That was surely a lot of work. Time for a relaxed weekend. |
@dpgeorge I've managed to rebase #8968 to include these changes and everything seems to be working but I've noticed that |
https://github.com/orgs/micropython/discussions/9961#discussioncomment-6227871 I've put my code up for this. Would I submit a PR? |
I thought I left mDNS as is... but maybe I missed something there. For the custom mbedtls errors, yes, I did not update that. The only downside there is that the error messages will be longer/take up more flash (and be different to other mbedtls ports...). For example what used to be:
Is now (on esp32 with IDF 5):
I would like to eventually fix this (feel free to try!) but it's not a high priority at the moment.
Maybe... you already did update to v2.28.3 in 61b8e1b and it would be good to have that in the next release which is scheduled for the end of this month (!). Then we can update to v3.3.0 after the release. |
Yes, for some reason Espressif decided to move
I agree
Yes, this is probably the best option 🤔 |
If you have time, that would be great. |
For the esp32 port, MicroPython currently supports IDF v4.x (from 4.0.2 up to the latest 4.4.4). There is now a new major version of IDF v5.x, with a release v5.0.1.
IDF 5 is needed for some of the newer esp32 SoCs to work. It also cleans up a lot of the inconsistencies between existing SoCs (eg S2, S3, C3).
I propose to switch entirely to IDF v5, ie drop support for IDF v4. Mainly because it's a lot of effort to maintain both at the same time, and that effort is better spent elsewhere.
This PR gets basic IDF v5. support working. Current status: