esp-faq icon indicating copy to clipboard operation
esp-faq copied to clipboard

ESP32 S3 Wroom Startup is too slow (IDFGH-14081)

Open weoiss1998 opened this issue 1 year ago • 11 comments

Answers checklist.

  • [X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [X] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

5.3.1 and 5.2.3

Espressif SoC revision.

ESP32S3 Wroom

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32 S3 Wroom Dev Kit

Power Supply used.

USB

What is the expected behavior?

https://docs.espressif.com/projects/esp-techpedia/en/latest/esp-friends/advanced-development/performance/reduce-boot-time.html says after optimizing the startup will be around 27ms.

What is the actual behavior?

In my tests it's at the minimum of 56ms.

Steps to reproduce.

Make optimizations of https://docs.espressif.com/projects/esp-techpedia/en/latest/esp-friends/advanced-development/performance/reduce-boot-time.html and check when a pin goes high.

Debug Logs.

No response

More Information.

I tried it with 5.2.3 and 5.3.1. There is practically no difference. Here is a picture of my logic analyzer: grafik

weoiss1998 avatar Nov 15 '24 15:11 weoiss1998

Hi @weoiss1998

May I know if you have done every optimization? Especially Disable Boot ROM Log Printing. Need to burn refuses : 企业微信截图_17318958393243

zztiger123 avatar Nov 18 '24 02:11 zztiger123

Hi @zztiger123 ,

yeah i did this aswell.

grafik

I have discovered that it is an ESP32 S3 WROOM 2, is this perhaps the reason?

weoiss1998 avatar Nov 18 '24 09:11 weoiss1998

hi @weoiss1998 here is my test result. I try the example/system/deep_sleep example, and set gpio 6 level to 1 on call_start_cpu0() ( as this function is the entry of appmain https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/startup.html#first-stage-rom-bootloader )and the top of app main, my setting GPIO code is like this:

image

image

I don't use the genneral GPIO API beacuse this it would be faster to directlty use lower apis.

企业微信截图_1731996401136 from the result you can use it takes 27.5 ms to entry the start cpu0 ,which I think is the flag to finish boot, enter application, and 40 ms to print in appmain.

however, it seems there are still some differences between your result and mine. I want to confirm the level change timing in your logic

Xiehanxin avatar Nov 19 '24 07:11 Xiehanxin

I will try it in the next few days. My measurement is from Power on to app_main. Maybe you can check this by your side aswell?

weoiss1998 avatar Nov 19 '24 07:11 weoiss1998

Yes, I have set the GPIO level on the top of app_main, I think it is same.

Xiehanxin avatar Nov 19 '24 08:11 Xiehanxin

My spontaneous guess is that the ESP32 S3 boots from deep sleep faster than if the power is completely disconnected.

weoiss1998 avatar Nov 19 '24 08:11 weoiss1998

Hi @Xiehanxin, how can I modify the cpu_start.c or where do you add void IRAM_ATTR call_start_cpu0(void)?

weoiss1998 avatar Nov 19 '24 19:11 weoiss1998

you can found in components/esp_system/port/cpu_start.c

Xiehanxin avatar Nov 20 '24 02:11 Xiehanxin

I found it but the Pin Output doesn't change on my side.

weoiss1998 avatar Nov 20 '24 07:11 weoiss1998

may I know which pin do you use?

Xiehanxin avatar Nov 20 '24 08:11 Xiehanxin

I tried it with 4 and 6, when I use your Implementation nothing Changes, when I use gpio_set_direction and gpio_set_level it works

weoiss1998 avatar Nov 20 '24 08:11 weoiss1998