Skip to content

Modules with PSRAM take long to boot #5737

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

Closed
mcer12 opened this issue Oct 6, 2021 · 8 comments · Fixed by #6135
Closed

Modules with PSRAM take long to boot #5737

mcer12 opened this issue Oct 6, 2021 · 8 comments · Fixed by #6135
Assignees

Comments

@mcer12
Copy link

mcer12 commented Oct 6, 2021

Seems like PSRAM is tested during boot, which can be disabled in menuconfonfig ("Run memory test on SPI RAM initialization" option). This causes ~500ms delay in boot. It would be nice to be able to disable the PSRAM test in arduino environment as well.

It is mentioned here:
https://esp32.com/viewtopic.php?t=9448

@SuGlider SuGlider self-assigned this Oct 23, 2021
@SuGlider
Copy link
Collaborator

@mcer12
It seems disabled in sdkconfig. I tested a ESP32-WROVER and it boots instantaneously.
Could you provide us with some evidence of it?

@SuGlider
Copy link
Collaborator

SuGlider commented Oct 23, 2021

This seems something related IDF 3.3
SPIRAM_MEMTEST was set to Yes by default.
It only has an effect on Arduino Core 1.0.6

But in version 2.0.0, that uses IDF 4.4, this option doesn't exist anymore in sdkconfig.

What is the Arduino Core Version you are currently using?
Would you consider using 2.0.0?

@mcer12
Copy link
Author

mcer12 commented Oct 27, 2021

@SuGlider when you tried it, did you enable PSRAM in the board settings? It boots up instantaneously for me as well but only when the PSRAM is disabled. And yes, I am running the latest arduino core.

@SuGlider
Copy link
Collaborator

@mcer12
I just retested it with Core Debug Level as Verbose.
I got a message in UART that indicates that Arduino Core is actually testing PSRAM:
[ 841][D][esp32-hal-psram.c:84] psramInit(): PSRAM enabled

Looking into Arduino Core code I found
https://github.com/espressif/arduino-esp32/blob/mem-optimized/cores/esp32/esp32-hal-psram.c#L69-L73

This is the place where it tests PSRAM and takes 500ms after booting.

@me-no-dev, is PSRAM test mandatory for Arduino or it can be skipped?

@SuGlider SuGlider reopened this Oct 27, 2021
@mcer12
Copy link
Author

mcer12 commented Dec 1, 2021

Any news on this? I know 500ms doesn't seem like a big deal but on battery powered devices, it can mean weeks of extra deep sleep time :)

@SuGlider
Copy link
Collaborator

@mcer12
Sorry for the delay. I already have a solution for it.
Using BYPASS_SPIRAM_TEST(bool); will allow you to bypass PSRAM test and make the WROVER boot fast.

Example:

BYPASS_SPIRAM_TEST(true);

void setup() {
  Serial.begin(115200);
  Serial.println("\n Testing SPIRAM test bypass!");
  Serial.println("Check how long does it take to boot in a WROVER module.");
}

void loop() {
  static uint8_t count = 0;
  Serial.print("-");
  delay(500);
  if (++count == 32) {
    count = 0;
    Serial.println();
  }
}

@SuGlider
Copy link
Collaborator

The PR #6135 will solve your need.

@mcer12
Copy link
Author

mcer12 commented Jan 14, 2022

Thank you! Hope it gets approved soon.

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.

2 participants