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

espressif: Allow one build to work with psram & non-psram versions of a board #5678

Closed
wants to merge 2 commits into from

Conversation

jepler
Copy link
Member

@jepler jepler commented Dec 7, 2021

By setting CONFIG_SPIRAM_TYPE_AUTO=y and CONFIG_SPIRAM_IGNORE_NOTFOUND=y, the boot code will adapt to whatever PSRAM is present, or fall back to running without it if no psram is present. This means we don't need two (or more, for the 'M' version(s)) artifacts for the variants of the ESP32-S3 DevKit family

On a psram board (DevKitC-1-N8R2):

Adafruit CircuitPython 7.2.0-alpha.0-38-g121b22b0c-dirty on 2021-12-07; ESP32-S3-DevKitC-1 with ESP32S3
>>> import gc
>>> gc.mem_free()
2048144

On a non-psram board (actually the ESP32-S3-DevKitM-1-N8):

Adafruit CircuitPython 7.2.0-alpha.0-38-g121b22b0c-dirty on 2021-12-07; ESP32-S3-DevKitC-1 with ESP32S3
>>> import gc
>>> gc.mem_free()
46992

@jepler jepler changed the title Single build psram or not espressif: Allow one build to work with psram & non-psram versions of a board Dec 8, 2021
@jepler jepler added the espressif applies to multiple Espressif chips label Dec 8, 2021
@dhalbert dhalbert requested a review from microdev1 December 8, 2021 03:59
Copy link
Collaborator

@microdev1 microdev1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks @jepler. This sdkconfig should work for every board, would you like to modify the common skdconfig.defaults?

@jepler
Copy link
Member Author

jepler commented Dec 8, 2021

@microdev1 I thought about that. I can do it if there's agreement. Two possible reasons not to:

  • it's a change that would affect all espressif builds, not just this one (so more testing would be needed)
  • on a board where we "know" there's psram, do we want to continue without it?

@jepler
Copy link
Member Author

jepler commented Dec 8, 2021

one more wrinkle .. I noticed on the esp32s3-box that the 8MB PSRAM was also an octal chip, so swapping out different modules with different psram within the can ACTUALLY requires a different set of never-reset pins.

@tannewt
Copy link
Member

tannewt commented Dec 8, 2021

I'm ok with having a board for each variant. It can make it easier to debug if the board id matches an exact board.

@jepler jepler closed this Dec 9, 2021
@microdev1
Copy link
Collaborator

I still believe this is a good change. We should have a better way of building & communicating a board's flash & ram config.

Building:

make BOARD=... FLASH=... (defaults to lowest flash size) RAM=auto

Communicating:

# in boot_out
Adafruit CircuitPython 7.1.0 on 2021-12-02; MicroDev microS2 with ESP32-S2
Board ID:microdev_micro_s2_f16_r8

@tannewt
Copy link
Member

tannewt commented Dec 9, 2021

@microdev1 How many variations will exist do you think? Maybe we should only distinguish internal vs external ram and ignore flash size completely? That's how I'm handling boards in the broadcom port since both SD card and RAM sizes can vary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants