Skip to content

Commit

Permalink
feat(esp_modem): example add esp32p4 usb support
Browse files Browse the repository at this point in the history
1. support ec20 cat.4 module in example modem_console and pppos_client
2. support esp32p4 in example modem_console and pppos_client
  • Loading branch information
leeebo committed Apr 22, 2024
1 parent bd6e120 commit eaf2992
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_IDF_TARGET="esp32p4"
CONFIG_EXAMPLE_SERIAL_CONFIG_USB=y
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ 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();
#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();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_IDF_TARGET="esp32p4"
CONFIG_EXAMPLE_SERIAL_CONFIG_USB=y

0 comments on commit eaf2992

Please sign in to comment.