Merge branch 'tests/esp32p4-console-support' into 'master'

test(console): add esp32p4 target support to console tests and example

Closes IDF-8105 and IDF-8078

See merge request espressif/esp-idf!28834
pull/13338/head
Guillaume Souchere 2024-03-06 10:09:03 +08:00
commit 32db5e4f6b
26 zmienionych plików z 119 dodań i 43 usunięć

Wyświetl plik

@ -12,8 +12,9 @@
#include "unity.h"
#include "esp_rom_sys.h"
#include "esp_sleep.h"
#include "soc/soc_caps.h"
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32P4) // TODO Light Sleep support - IDF-7528
#if SOC_LIGHT_SLEEP_SUPPORTED
static void timer_cb1(void *arg)
{
@ -53,4 +54,4 @@ TEST_CASE("Test the periodic timer does not handle lost events during light slee
TEST_ESP_OK(esp_timer_delete(periodic_timer));
}
#endif //#!TEMPORARY_DISABLED_FOR_TARGETS(ESP32P4)
#endif // SOC_SLEEP_SUPPORTED

Wyświetl plik

@ -171,6 +171,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL
int
default 5

Wyświetl plik

@ -100,6 +100,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
#if SOC_CAPS_ECO_VER < 200
#define SOC_DPORT_WORKAROUND 1

Wyświetl plik

@ -115,6 +115,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_XTAL_SUPPORT_26M
bool
default y

Wyświetl plik

@ -45,6 +45,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_26M 1

Wyświetl plik

@ -167,6 +167,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_XTAL_SUPPORT_40M
bool
default y

Wyświetl plik

@ -61,6 +61,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_40M 1

Wyświetl plik

@ -72,6 +72,8 @@
// #define SOC_ECDSA_SUPPORTED 1 // TODO: [ESP32C5] IDF-8618
// #define SOC_KEY_MANAGER_SUPPORTED 1 // TODO: [ESP32C5] IDF-8621
// #define SOC_HUK_SUPPORTED 1 // TODO: [ESP32C5] IDF-8617
// #define SOC_LIGHT_SLEEP_SUPPORTED 1 // TODO: [ESP32C5] IDF-8640
// #define SOC_DEEP_SLEEP_SUPPORTED 1 // TODO: [ESP32C5] IDF-8638
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_40M 1

Wyświetl plik

@ -223,6 +223,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_XTAL_SUPPORT_40M
bool
default y

Wyświetl plik

@ -72,6 +72,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_40M 1

Wyświetl plik

@ -211,6 +211,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_XTAL_SUPPORT_32M
bool
default y

Wyświetl plik

@ -69,6 +69,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_32M 1

Wyświetl plik

@ -86,6 +86,8 @@
// #define SOC_RNG_SUPPORTED 1 //TODO: IDF-6522
#define SOC_MULTI_USAGE_LDO_SUPPORTED 1
// #define SOC_PPA_SUPPORTED 1 //TODO: IDF-6878
// #define SOC_LIGHT_SLEEP_SUPPORTED 1 //TODO: IDF-7528
// #define SOC_DEEP_SLEEP_SUPPORTED 1 //TODO: IDF-7529
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_40M 1

Wyświetl plik

@ -195,6 +195,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_XTAL_SUPPORT_40M
bool
default y

Wyświetl plik

@ -85,6 +85,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_40M 1

Wyświetl plik

@ -235,6 +235,14 @@ config SOC_RNG_SUPPORTED
bool
default y
config SOC_LIGHT_SLEEP_SUPPORTED
bool
default y
config SOC_DEEP_SLEEP_SUPPORTED
bool
default y
config SOC_XTAL_SUPPORT_40M
bool
default y

Wyświetl plik

@ -75,6 +75,8 @@
#define SOC_WDT_SUPPORTED 1
#define SOC_SPI_FLASH_SUPPORTED 1
#define SOC_RNG_SUPPORTED 1
#define SOC_LIGHT_SLEEP_SUPPORTED 1
#define SOC_DEEP_SLEEP_SUPPORTED 1
/*-------------------------- XTAL CAPS ---------------------------------------*/
#define SOC_XTAL_SUPPORT_40M 1

Wyświetl plik

@ -11,10 +11,6 @@ examples/system/base_mac_address:
- esp_hw_support
examples/system/console/advanced:
disable:
- if: IDF_TARGET == "esp32p4"
temporary: true
reason: not supported on p4 # TODO: IDF-8078
disable_test:
- if: IDF_TARGET not in ["esp32", "esp32c3"]
reason: Sufficient to run this app on one chip with each architecture
@ -30,10 +26,6 @@ examples/system/console/advanced_usb_cdc:
- vfs
examples/system/console/basic:
disable:
- if: IDF_TARGET == "esp32p4"
temporary: true
reason: not supported on p4 # TODO: IDF-8078
disable_test:
- if: IDF_TARGET not in ["esp32", "esp32c3"]
reason: Sufficient to run this app on one chip with each architecture
@ -43,9 +35,7 @@ examples/system/console/basic:
examples/system/deep_sleep:
disable:
- if: IDF_TARGET in ["esp32p4"]
temporary: true
reason: target(s) is not supported yet # TODO: IDF-7529
- if: SOC_DEEP_SLEEP_SUPPORTED != 1
examples/system/deep_sleep_wake_stub:
disable:
@ -63,9 +53,7 @@ examples/system/efuse:
examples/system/esp_timer:
disable:
- if: IDF_TARGET in ["esp32p4"]
temporary: true
reason: Light Sleep support TBD # TODO: IDF-7528
- if: SOC_LIGHT_SLEEP_SUPPORTED != 1
depends_components:
- esp_timer
@ -134,9 +122,7 @@ examples/system/ipc/ipc_isr/xtensa:
examples/system/light_sleep:
disable:
- if: IDF_TARGET in ["esp32p4"]
temporary: true
reason: target(s) is not supported yet
- if: SOC_LIGHT_SLEEP_SUPPORTED != 1
examples/system/ota/advanced_https_ota:
disable:

Wyświetl plik

@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
# Console Example

Wyświetl plik

@ -14,5 +14,12 @@
void register_system(void)
{
register_system_common();
register_system_sleep();
#if SOC_LIGHT_SLEEP_SUPPORTED
register_system_light_sleep();
#endif
#if SOC_DEEP_SLEEP_SUPPORTED
register_system_deep_sleep();
#endif
}

Wyświetl plik

@ -19,7 +19,8 @@ void register_system(void);
void register_system_common(void);
// Register deep and light sleep functions
void register_system_sleep(void);
void register_system_deep_sleep(void);
void register_system_light_sleep(void);
#ifdef __cplusplus
}

Wyświetl plik

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@ -29,16 +29,6 @@
static const char *TAG = "cmd_system_sleep";
static void register_deep_sleep(void);
static void register_light_sleep(void);
void register_system_sleep(void)
{
register_deep_sleep();
register_light_sleep();
}
/** 'deep_sleep' command puts the chip into deep sleep mode */
static struct {
@ -95,7 +85,7 @@ static int deep_sleep(int argc, char **argv)
return 1;
}
static void register_deep_sleep(void)
void register_system_deep_sleep(void)
{
int num_args = 1;
deep_sleep_args.wakeup_time =
@ -196,7 +186,7 @@ static int light_sleep(int argc, char **argv)
return 0;
}
static void register_light_sleep(void)
void register_system_light_sleep(void)
{
light_sleep_args.wakeup_time =
arg_int0("t", "time", "<t>", "Wake up time, ms");

Wyświetl plik

@ -168,7 +168,12 @@ void app_main(void)
/* Register commands */
esp_console_register_help_command();
register_system_common();
register_system_sleep();
#if SOC_LIGHT_SLEEP_SUPPORTED
register_system_light_sleep();
#endif
#if SOC_DEEP_SLEEP_SUPPORTED
register_system_deep_sleep();
#endif
#if SOC_WIFI_SUPPORTED
register_wifi();
#endif

Wyświetl plik

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@ -95,9 +95,16 @@ void app_main(void)
/* Register commands */
esp_console_register_help_command();
register_system_common();
register_system_sleep();
register_nvs();
#if SOC_LIGHT_SLEEP_SUPPORTED
register_system_light_sleep();
#endif
#if SOC_DEEP_SLEEP_SUPPORTED
register_system_deep_sleep();
#endif
#if SOC_WIFI_SUPPORTED
register_wifi();
#endif
register_nvs();
/* Prompt to be printed before each line.
* This can be customized, made dynamic, etc.

Wyświetl plik

@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
# Basic Console Example (`esp_console_repl`)

Wyświetl plik

@ -91,7 +91,12 @@ void app_main(void)
/* Register commands */
esp_console_register_help_command();
register_system_common();
register_system_sleep();
#if SOC_LIGHT_SLEEP_SUPPORTED
register_system_light_sleep();
#endif
#if SOC_DEEP_SLEEP_SUPPORTED
register_system_deep_sleep();
#endif
#if SOC_WIFI_SUPPORTED
register_wifi();
#endif