esp-iot-bridge icon indicating copy to clipboard operation
esp-iot-bridge copied to clipboard

ESP32-S2 with UART modem

Open x893 opened this issue 2 years ago • 1 comments

Hello, i use ESP32-S2 with SPI interface to host, WiFi to external network and GSM modem via UART1 as reserved link. After change menuconfig for modem ` [*] UART

[ ] USB

(17) UART Tx GPIO number of Modem

(18) UART Rx GPIO number of Modem

(115200) UART baud rate of Modem

[ ] Use extended DCE object

(0) System status led (red) gpio, set 0 if not use

(0) Wi-Fi status led (blue) gpio, set 0 if not use

(0) Modem status led (green) gpio, set 0 if not use

(0) Modem power control gpio, set 0 if not use

(0) Modem reset control gpio, set 0 if not use

(5) Retry times during dial

(internet) Set MODEM APN `

i see next error

` [886/888] Linking CXX executable esp-gateway-5.elfFAILED: esp-gateway-5.elf cmd.exe /C "cd . && D:\esp32\Espressif\tools\xtensa-esp32s2-elf\esp-2022r1-RC1-11.2.0\xtensa-esp32s2-elf\bin\xtensa-esp32s2-elf-g++.exe -mlongcalls @CMakeFiles\esp-gateway-5.elf.rsp -o esp-gateway-5.elf && cd ."

d:/esp32/espressif/tools/xtensa-esp32s2-elf/esp-2022r1-rc1-11.2.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/11.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: esp-idf/esp_modem/libesp_modem.a(esp_modem_dte_usb.c.obj):(.literal._usb_disconn_cb+0x0): undefined reference to `esp_modem_board_force_reset'

d:/esp32/espressif/tools/xtensa-esp32s2-elf/esp-2022r1-rc1-11.2.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/11.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: esp-idf/esp_modem/libesp_modem.a(esp_modem_dte_usb.c.obj): in function `_usb_disconn_cb':

D:/esp32/esp-gateway-5/components/esp_modem/src/esp_modem_dte_usb.c:335: undefined reference to `esp_modem_board_force_reset'

collect2.exe: error: ld returned 1 exit status `

After change components\esp_modem\CMakeLists.txt

` if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32C3)

    list(APPEND srcs "src/esp_modem_dte_uart.c")

elseif(CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3)

if(CONFIG_GATEWAY_MODEM_USB)

    list(APPEND srcs "src/esp_modem_dte_usb.c")

else()

    list(APPEND srcs "src/esp_modem_dte_uart.c")

endif()

endif() `

compile successfully.

x893 avatar Sep 02 '22 20:09 x893

Thank you for your reminder, the previous logic is not rigorous, S2, S3 should not remove the uart compilation. I'll submit that revision later.

tswen avatar Sep 05 '22 02:09 tswen