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

ESP32C3 unmapped GPIOs #8

Closed
sehraf opened this issue Oct 26, 2021 · 4 comments · Fixed by #21
Closed

ESP32C3 unmapped GPIOs #8

sehraf opened this issue Oct 26, 2021 · 4 comments · Fixed by #21

Comments

@sehraf
Copy link

sehraf commented Oct 26, 2021

https://github.com/esp-rs/esp-idf-hal/blob/fb2c9f7657a302600494c44fc1c1073f62c49248/src/gpio.rs#L909..L924
Here the GPIOs 11-17 for the ESP32C3 are unmapped. Is this intentional?

@sehraf
Copy link
Author

sehraf commented Oct 26, 2021

SPI0/1: GPIO12-17 are usually used for SPI flash and PSRAM and not recommended for other uses.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/peripherals/gpio.html

ivmarkov pushed a commit that referenced this issue Oct 31, 2021
@georgik georgik added this to Future in esp-rs roadmap Nov 18, 2021
@jessebraham
Copy link
Member

I have some changes that I'll be PRing soon making a few small small corrections in the GPIO module. During my time digging through the various datasheets, I realized that all of the chips have a range of GPIO with the same recommendation made:

"The pins used for embedded flash are not recommended for other uses.".

I have listed the applicable pins below:

Chip GPIOs
ESP32 6 - 11, 16 - 17
ESP32-C3 12 - 17
ESP32-S2 26 - 32
ESP32-S3 26 - 32, 33 - 37*

* When using Octal Flash and/or Octal PSRAM

Presently these pins are unmapped when using the ESP32-C3, but for the remaining chips some or all of these pins are mapped. So my question is, do we want to:

  1. include all of these pins for every chip
  2. include none of these pins for for every chip
  3. include or exclude these pins on a per-chip basis

There also seem to be a number of unmapped GPIOs already for the ESP32, ESP32-S2, and ESP32-S3. I have not been able to find much information on why these are presently unmapped. Is there a specific reference which was used for these, or can they be added in as well?

@ivmarkov
Copy link
Collaborator

There also seem to be a number of unmapped GPIOs already for the ESP32, ESP32-S2, and ESP32-S3. I have not been able to find much information on why these are presently unmapped. Is there a specific reference which was used for these, or can they be added in as well?

I've just used a few sample boards as a reference without digging into the ESP32 data sheets

These pins were unmapped for that boards.
I know realize, that specific boards may not map some pins also due to missing space etc.

Given that modeling specific board layouts is not realistic, we should just map all of these missing pins.

Now, regarding what to do with the pins used for flash, I guess either (1) or (2), but definitely not (3).

I have a preference for (1) because if somebody wants to use those, I guess we should allow that, despite the strings attached?

@jessebraham
Copy link
Member

I've just used a few sample boards as a reference without digging into the ESP32 data sheets

These pins were unmapped for that boards.
I know realize, that specific boards may not map some pins also due to missing space etc.

Given that modeling specific board layouts is not realistic, we should just map all of these missing pins.

Sounds good, I will add all pins covered in the Pin Description sections of each datasheet.

Now, regarding what to do with the pins used for flash, I guess either (1) or (2), but definitely not (3).

I have a preference for (1) because if somebody wants to use those, I guess we should allow that, despite the strings attached?

I tend to agree, I don't feel it's our responsibility to hold people's hands too much. Breaking rules is fun sometimes :)

I have added comments in the source indicating the recommendations, and will add a note in the README as well. At least we'll have mentioned it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants