Dear all,
I want to wait a specific time in the wake stub of the ESP32 and I use:
ets_delay_us(200*1000);
for a 200ms delay. Unfortunately I measure 68ms delay.
The function "ets_get_cpu_frequency()" returns 13 in the wake stub, which seems to be wrong? I could not find any information about the default CPU speed in the wake stub, but would assume 40MHz. Is this correct?
How can I wait for a correct amount of time in the wake stub?
Best, Timm
ets_delay_us incorrect in wake stub
Re: ets_delay_us incorrect in wake stub
Hi Timm,
indeed the "CPU cycles per microsecond" value used by ets_delay_us is not initialized at the time when the deep sleep wake stub runs. You need to include a call to ets_update_cpu_frequency_rom before calling ets_delay_us:
ets_update_cpu_frequency_rom(ets_get_detected_xtal_freq() / 1000000)
indeed the "CPU cycles per microsecond" value used by ets_delay_us is not initialized at the time when the deep sleep wake stub runs. You need to include a call to ets_update_cpu_frequency_rom before calling ets_delay_us:
ets_update_cpu_frequency_rom(ets_get_detected_xtal_freq() / 1000000)
Re: ets_delay_us incorrect in wake stub
Hi ESP_igrr,
brilliant! Thanks for your support
Greetings,
Timm
brilliant! Thanks for your support
Greetings,
Timm
Re: ets_delay_us incorrect in wake stub
I've been trying to do similar on esp-idf v5.0.1. I have this in a component .cpp wake stub:
but build fails with undefined reference to `ets_update_cpu_frequency_rom'
The component has PRIV_REQUIRES esp_rom and I see that esp32.rom.ld includes the line:
How can I resolve this reference?
Code: Select all
ets_update_cpu_frequency_rom(ets_get_xtal_freq() / 1000000);
The component has PRIV_REQUIRES esp_rom and I see that esp32.rom.ld includes the line:
Code: Select all
PROVIDE ( ets_update_cpu_frequency_rom = 0x40008550 ); /* Updates g_ticks_per_us on the current CPU only; not on the other core */
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 77 guests