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

Support ESP32-S2 #85

Closed
wnienhaus opened this issue Sep 4, 2022 · 8 comments · Fixed by #91
Closed

Support ESP32-S2 #85

wnienhaus opened this issue Sep 4, 2022 · 8 comments · Fixed by #91
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@wnienhaus
Copy link
Collaborator

wnienhaus commented Sep 4, 2022

Support for the S2 should not be that difficult, because the ULP in the ESP32-S2 has only a slightly different binary format than the ULP of the original ESP32.

(Note the S2 has both a RISC-V based and FSM based ULP - this issue is about adding support for the FSM based ULP)

When implementing this, we should ensure that we have a clean and clear way of selecting which ESP32 variant to use as the target.

@wnienhaus wnienhaus added enhancement New feature or request help wanted Extra attention is needed labels Sep 4, 2022
@rkagerer
Copy link

Not sure if this belongs in the same issue, but I'd love to see it working on the S3 as well.

@wnienhaus
Copy link
Collaborator Author

A quick glance at the Technical Reference Manuals for the S2 and S3 suggests that the binary formats of the ULP-FSM are identical across both variants. Thus S2 support should also result in S3 support.

@wnienhaus
Copy link
Collaborator Author

I have started working on this - already have our counter.py example working, but will need to make my way through all the opcodes to add the new binary format.

Micropython will also need to be built against at least v4.4.2 of the ESP-IDF (currently it builds against 4.4.0) because some important fixes related to the ULP-FSM on S2/S3 have been made in the ESP-IDF since 4.4.0. I will submit a PR to Micropython for that change.

@mattytrentini
Copy link
Sponsor

Worth noting that Damien is planning to move to 5.x. See #11528 for more detail.

Somewhat related - it would be great to test the ULP from a build from the branch on 11528!

@wnienhaus
Copy link
Collaborator Author

Great. Thanks for the pointer - I had not seen that PR.

I will definitely try the ULP with that branch.

@wnienhaus
Copy link
Collaborator Author

@mattytrentini I just tested the ULP (FSM) on both the S2 and S3 using the branch of micropython/micropython#11528 and it works perfectly.

The reasons seem to be:

  • because the same fixes from v4.4.2 are already included
  • and also because espressif seem to have unified/merged the ULP build config flags. In IDF v4.x those configs were per-each-target and so the sdkconfig.base file only enabled the ULP for the original ESP32, rather than for all variants that have a ULP.

So for anyone wanting to test the FSM ULP on the S2/S3 right now, either use Damien's draft PR for IDFv5.0 or my PR which fixes ULP support for S2/S3 against the current master branch.

@dpgeorge
Copy link
Member

Thanks @wnienhaus for testing the IDF 5 branch, that is very helpful. And I'm glad it works!

@wnienhaus
Copy link
Collaborator Author

ESP32-S2/S3 support is now implemented (in #91). It's not merged yet, but anyone that wants to try it can pull the s2s3_support branch from my fork.

Note, that you need to use a recent nightly build of Micropython, because the v1.20 release does not (yet) enable the ULP on S2/S3 devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants