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

Implement TIMG, UART, GPIO peripherals for all chips #2

Closed
4 tasks done
jessebraham opened this issue Nov 29, 2021 · 7 comments
Closed
4 tasks done

Implement TIMG, UART, GPIO peripherals for all chips #2

jessebraham opened this issue Nov 29, 2021 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@jessebraham
Copy link
Member

jessebraham commented Nov 29, 2021

As an MVP, we should have the TIMG, UART, and GPIO peripherals implemented for each chip, with working examples. Presently this is all implemented to some degree for the ESP32-C3.

The remaining chips should be able to use the TIMG and UART implementations with little to no modifications. GPIO will likely have to be device-specific.

  • ESP32
    • TIMG, UART, GPIO
  • ESP32-C3
    • TIMG, UART, GPIO
  • ESP32-S2
    • TIMG, UART, GPIO
  • ESP32-S3
    • TIMG, UART, GPIO
@jessebraham jessebraham added the help wanted Extra attention is needed label Nov 29, 2021
@bjoernQ
Copy link
Contributor

bjoernQ commented Dec 6, 2021

Thanks for your efforts - good to see something going on here 🙂

I was trying a bit with this here: https://github.com/bjoernQ/esp-hal/tree/esp32-local-pac

Basically, what I was trying is to have the GPIO module living in the esp-hal-common for ESP32C3 and ESP32 (don't have access to S2, S3 currently). Not sure if that will ever work but I have at least digital IO working for ESP32 and ESP32C3 (at least blinky blinks - not tested digital input yet)

I have a question btw about the evolution of the ESP32-PAC. In my fork I use the SVD from https://github.com/espressif/svd since that matches the other SVDs there more. However, it seems you are using the generated SVD from https://github.com/esp-rs/esp32 - are you avoiding the "official" SVD on purpose?

@jessebraham
Copy link
Member Author

jessebraham commented Dec 6, 2021

Thank you for working on this, it will be great to have a reasonable base to build from! I have hardware for the S2 and S3, so hopefully if you're able to get GPIO working for the ESP32 I should be able to get the aforementioned chips working too.

Long story short, the esp32 PAC was made using the SVD generated from idf2svd, aka the "community SVD". This has existed for some time. I have forked this repository, created a develop branch, and used the official SVD (from espressif/svd) instead. The esp-hal-common crate points to this fork and branch via a git dependency, so this repo is, in fact, using the "official" SVD.

All of these was done primarily to avoid breaking the existing esp32 PAC which is used by esp32-hal, but the hope is for this project to replace esp32-hal eventually, so at that point the official PAC can be updated as well.

Just to note, I have done the same fork/create develop branch for the remaining PACs as well, and have included them as git dependencies. This was so that we can just PR patches to the SVDs as needed, and then I can upstream the changes to the official SVDs in batches.

@bjoernQ
Copy link
Contributor

bjoernQ commented Dec 6, 2021

Thanks for the clarification regarding the SVD / PAC. I noticed the fork but didn't check the actual SVD file.
My spare time is currently a bit limited unfortunately but I hope to get the ESP32 GPIO working

@jessebraham
Copy link
Member Author

There's no rush, I appreciate the effort! If there's anything I can do to help expedite the process please let me know.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 5, 2022

I created a PR for the GPIO implementation in esp-hal-common: jessebraham#3

@jessebraham
Copy link
Member Author

jessebraham commented Jan 10, 2022

Regardless of our current lack of runtime support, I have begun implementing the GPIO peripheral for the ESP32-S2 and ESP32-S3 as well. I still need to add the various alternate functions, and verify that things build (PACs might needs some patching), but the work so far can be found in this branch:
https://github.com/jessebraham/esp-hal/tree/feature/gpio-s2-s3

TIMG and UART should in theory work for both these chips as well, however verification is still needed.

@jessebraham
Copy link
Member Author

The three aforementioned peripherals are now supported by all chips.

MabezDev added a commit that referenced this issue Jun 26, 2023
* implement embassy async uart read

* Add embassy async read support for uart

* changes based on review

* fix CI failures

* change review #2

* fixed re-opened PR number

* changes review no.3

---------

Co-authored-by: Scott Mabin <[email protected]>
SergioGasquez referenced this issue in SergioGasquez/esp-hal Jun 28, 2023
* implement embassy async uart read

* Add embassy async read support for uart

* changes based on review

* fix CI failures

* change review #2

* fixed re-opened PR number

* changes review no.3

---------

Co-authored-by: Scott Mabin <[email protected]>
MabezDev added a commit that referenced this issue Jul 12, 2023
* implement embassy async uart read

* Add embassy async read support for uart

* changes based on review

* fix CI failures

* change review #2

* fixed re-opened PR number

* changes review no.3

---------

Co-authored-by: Scott Mabin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants