While it's still pretty quick, that is a relatively huge increase in ROM latency. For context, this would mean the ESP32 can potentially get through the 1st and 2nd stage bootloaders and enter the app before the S3 can even crawl its way to a wakeup stub... Doesn't seem right.
Is there something markedly different in S3 ROM that might cause this? The USB stuff? Fingers crossed it's a configuration issue somewhere.
Code: Select all
/**
* ESP32: 1.27ms
* ESP32S3: 8.02ms
* ESP-IDF v5.0-dev-595-g98ad01e5fc
*/
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_sleep.h"
#include "driver/rtc_io.h"
#include "hal/rtc_io_ll.h"
#include "sdkconfig.h"
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define PIN_RTC_TRACE_GPIO 10
#define PIN_RTC_TRACE_RTCIO 10
#else
#define PIN_RTC_TRACE_GPIO 32
#define PIN_RTC_TRACE_RTCIO 9
#endif
#define PIN_WAKEUP 0
void RTC_IRAM_ATTR ram_stub(void)
{
rtcio_ll_set_level(PIN_RTC_TRACE_RTCIO, 1);
}
void app_main(void)
{
rtc_gpio_set_level(PIN_RTC_TRACE_GPIO, 0);
if(esp_reset_reason() != ESP_RST_DEEPSLEEP)
{
rtc_gpio_init(PIN_RTC_TRACE_GPIO);
rtc_gpio_set_direction(PIN_RTC_TRACE_GPIO, RTC_GPIO_MODE_OUTPUT_ONLY);
}
vTaskDelay(1000 / portTICK_PERIOD_MS);
esp_sleep_enable_ext0_wakeup(PIN_WAKEUP, 0);
esp_set_deep_sleep_wake_stub(ram_stub);
esp_deep_sleep_start();
}