diff --git a/components/esp_modem/examples/modem_console/README.md b/components/esp_modem/examples/modem_console/README.md index 1b4db28816..07ef2b1e49 100644 --- a/components/esp_modem/examples/modem_console/README.md +++ b/components/esp_modem/examples/modem_console/README.md @@ -16,9 +16,9 @@ class. ### USB DTE support -For USB enabled targets (ESP32-S2 and ESP32-S3), it is possible to connect to the modem device via USB. +For USB enabled targets (ESP32-S2, ESP32-S3, or ESP32-P4), it is possible to connect to the modem device via USB. 1. In menuconfig, navigate to `Example Configuration->Type of serial connection to the modem` and choose `USB`. -2. Connect the modem USB signals to pin 19 (DATA-) and 20 (DATA+) on your ESP chip. +2. Connect the modem USB signals to your ESP chip (pin 19 (DATA-) and 20 (DATA+) for ESP32-S2/S3). USB example uses Quactel BG96 modem device. BG96 needs a positive pulse on its PWK pin to boot-up. diff --git a/components/esp_modem/examples/modem_console/main/Kconfig.projbuild b/components/esp_modem/examples/modem_console/main/Kconfig.projbuild index 3eb51e488a..5b53daa153 100644 --- a/components/esp_modem/examples/modem_console/main/Kconfig.projbuild +++ b/components/esp_modem/examples/modem_console/main/Kconfig.projbuild @@ -10,7 +10,7 @@ menu "Example Configuration" Connect to modem via UART. config EXAMPLE_SERIAL_CONFIG_USB bool "USB" - depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4 help Connect to modem via USB (CDC-ACM class). For IDF version >= 4.4. endchoice @@ -36,6 +36,11 @@ menu "Example Configuration" bool "BG96" help Quectel BG96 is a series of LTE Cat M1/Cat NB1/EGPRS module. + config EXAMPLE_MODEM_DEVICE_EC20 + depends on EXAMPLE_SERIAL_CONFIG_USB + bool "EC20" + help + Quectel EC20 is a series of LTE Cat M4 module. config EXAMPLE_MODEM_DEVICE_SIM7000 depends on EXAMPLE_SERIAL_CONFIG_UART bool "SIM7000" diff --git a/components/esp_modem/examples/modem_console/main/idf_component.yml b/components/esp_modem/examples/modem_console/main/idf_component.yml index 80382c4a3b..0c242b0d79 100644 --- a/components/esp_modem/examples/modem_console/main/idf_component.yml +++ b/components/esp_modem/examples/modem_console/main/idf_component.yml @@ -6,7 +6,7 @@ dependencies: version: "^1.0.0" override_path: "../../../" espressif/esp_modem_usb_dte: - version: "^1.1.0" + version: "^1.2.0" rules: - if: "idf_version >=4.4" - - if: "target in [esp32s2, esp32s3]" + - if: "target in [esp32s2, esp32s3, esp32p4]" diff --git a/components/esp_modem/examples/modem_console/main/modem_console_main.cpp b/components/esp_modem/examples/modem_console/main/modem_console_main.cpp index b703d99137..ac4b8f604c 100644 --- a/components/esp_modem/examples/modem_console/main/modem_console_main.cpp +++ b/components/esp_modem/examples/modem_console/main/modem_console_main.cpp @@ -160,6 +160,9 @@ extern "C" void app_main(void) #if CONFIG_EXAMPLE_MODEM_DEVICE_BG96 == 1 ESP_LOGI(TAG, "Initializing esp_modem for the BG96 module..."); struct esp_modem_usb_term_config usb_config = ESP_MODEM_BG96_USB_CONFIG(); +#elif CONFIG_EXAMPLE_MODEM_DEVICE_EC20 == 1 + ESP_LOGI(TAG, "Initializing esp_modem for the EC20 module..."); + struct esp_modem_usb_term_config usb_config = ESP_MODEM_EC20_USB_CONFIG(); #elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM7600 == 1 ESP_LOGI(TAG, "Initializing esp_modem for the SIM7600 module..."); struct esp_modem_usb_term_config usb_config = ESP_MODEM_SIM7600_USB_CONFIG(); @@ -180,7 +183,7 @@ extern "C" void app_main(void) }); #if CONFIG_EXAMPLE_MODEM_DEVICE_BG96 == 1 std::unique_ptr dce = create_BG96_dce(&dce_config, dte, esp_netif); -#elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM7600 == 1 || CONFIG_EXAMPLE_MODEM_DEVICE_A7670 == 1 +#elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM7600 == 1 || CONFIG_EXAMPLE_MODEM_DEVICE_A7670 == 1 || CONFIG_EXAMPLE_MODEM_DEVICE_EC20 == 1 std::unique_ptr dce = create_SIM7600_dce(&dce_config, dte, esp_netif); #else #error USB modem not selected diff --git a/components/esp_modem/examples/modem_console/sdkconfig.ci.usb_p4 b/components/esp_modem/examples/modem_console/sdkconfig.ci.usb_p4 new file mode 100644 index 0000000000..49e9148fdb --- /dev/null +++ b/components/esp_modem/examples/modem_console/sdkconfig.ci.usb_p4 @@ -0,0 +1,2 @@ +CONFIG_IDF_TARGET="esp32p4" +CONFIG_EXAMPLE_SERIAL_CONFIG_USB=y diff --git a/components/esp_modem/examples/pppos_client/README.md b/components/esp_modem/examples/pppos_client/README.md index f319a2feda..d4ef494381 100644 --- a/components/esp_modem/examples/pppos_client/README.md +++ b/components/esp_modem/examples/pppos_client/README.md @@ -11,9 +11,9 @@ See the README.md file in the upper level `pppos` directory for more information ### USB DTE support -For USB enabled targets (ESP32-S2 and ESP32-S3), it is possible to connect to the modem device via USB. +For USB enabled targets (ESP32-S2, ESP32-S3, or ESP32-P4), it is possible to connect to the modem device via USB. 1. In menuconfig, navigate to `Example Configuration->Type of serial connection to the modem` and choose `USB`. -2. Connect the modem USB signals to pin 19 (DATA-) and 20 (DATA+) on your ESP chip. +2. Connect the modem USB signals to your ESP chip (pin 19 (DATA-) and 20 (DATA+) for ESP32-S2/S3). USB example uses Quactel BG96 modem device. BG96 needs a positive pulse on its PWK pin to boot-up. diff --git a/components/esp_modem/examples/pppos_client/main/Kconfig.projbuild b/components/esp_modem/examples/pppos_client/main/Kconfig.projbuild index f66827b67d..8d5a575ec3 100644 --- a/components/esp_modem/examples/pppos_client/main/Kconfig.projbuild +++ b/components/esp_modem/examples/pppos_client/main/Kconfig.projbuild @@ -9,7 +9,7 @@ menu "Example Configuration" Connect to modem via UART. config EXAMPLE_SERIAL_CONFIG_USB bool "USB" - depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4 help Connect to modem via USB (CDC-ACM class). For IDF version >= 4.4. endchoice @@ -29,6 +29,11 @@ menu "Example Configuration" bool "BG96" help Quectel BG96 is a series of LTE Cat M1/Cat NB1/EGPRS module. + config EXAMPLE_MODEM_DEVICE_EC20 + depends on EXAMPLE_SERIAL_CONFIG_USB + bool "EC20" + help + Quectel EC20 is a series of LTE Cat M4 module. config EXAMPLE_MODEM_DEVICE_SIM7000 depends on EXAMPLE_SERIAL_CONFIG_UART bool "SIM7000" diff --git a/components/esp_modem/examples/pppos_client/main/idf_component.yml b/components/esp_modem/examples/pppos_client/main/idf_component.yml index 80382c4a3b..0c242b0d79 100644 --- a/components/esp_modem/examples/pppos_client/main/idf_component.yml +++ b/components/esp_modem/examples/pppos_client/main/idf_component.yml @@ -6,7 +6,7 @@ dependencies: version: "^1.0.0" override_path: "../../../" espressif/esp_modem_usb_dte: - version: "^1.1.0" + version: "^1.2.0" rules: - if: "idf_version >=4.4" - - if: "target in [esp32s2, esp32s3]" + - if: "target in [esp32s2, esp32s3, esp32p4]" diff --git a/components/esp_modem/examples/pppos_client/main/pppos_client_main.c b/components/esp_modem/examples/pppos_client/main/pppos_client_main.c index 89553702ad..3529965406 100644 --- a/components/esp_modem/examples/pppos_client/main/pppos_client_main.c +++ b/components/esp_modem/examples/pppos_client/main/pppos_client_main.c @@ -219,6 +219,10 @@ void app_main(void) ESP_LOGI(TAG, "Initializing esp_modem for the BG96 module..."); struct esp_modem_usb_term_config usb_config = ESP_MODEM_BG96_USB_CONFIG(); esp_modem_dce_device_t usb_dev_type = ESP_MODEM_DCE_BG96; +#elif CONFIG_EXAMPLE_MODEM_DEVICE_EC20 == 1 + ESP_LOGI(TAG, "Initializing esp_modem for the EC20 module..."); + struct esp_modem_usb_term_config usb_config = ESP_MODEM_EC20_USB_CONFIG(); + esp_modem_dce_device_t usb_dev_type = ESP_MODEM_DCE_EC20; #elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM7600 == 1 ESP_LOGI(TAG, "Initializing esp_modem for the SIM7600 module..."); struct esp_modem_usb_term_config usb_config = ESP_MODEM_SIM7600_USB_CONFIG(); diff --git a/components/esp_modem/examples/pppos_client/sdkconfig.ci.usb_p4 b/components/esp_modem/examples/pppos_client/sdkconfig.ci.usb_p4 new file mode 100644 index 0000000000..49e9148fdb --- /dev/null +++ b/components/esp_modem/examples/pppos_client/sdkconfig.ci.usb_p4 @@ -0,0 +1,2 @@ +CONFIG_IDF_TARGET="esp32p4" +CONFIG_EXAMPLE_SERIAL_CONFIG_USB=y diff --git a/components/esp_modem/include/esp_modem_c_api_types.h b/components/esp_modem/include/esp_modem_c_api_types.h index 2c74819ab7..521161da7b 100644 --- a/components/esp_modem/include/esp_modem_c_api_types.h +++ b/components/esp_modem/include/esp_modem_c_api_types.h @@ -52,6 +52,7 @@ typedef enum esp_modem_dce_device { ESP_MODEM_DCE_SIM7070, ESP_MODEM_DCE_SIM7000, ESP_MODEM_DCE_BG96, + ESP_MODEM_DCE_EC20, ESP_MODEM_DCE_SIM800, ESP_MODEM_DCE_CUSTOM } esp_modem_dce_device_t;