UART swapping on Modem Shell

Hello, 

I have two UART AT Command devices attached to by board. One for ESP-AT (compatible = "espressif,esp-at";) and the other is a SIM7080 module (compatible = "simcom,sim7080";). Both are working individually, however having both config parameters enabled, the sim7080 is initiated and the esp-at has this error message:

[00:00:15.040,000] <err> wifi_esp_at: Error registering modem context: -12

However I believe I can only have one UART shell at a time from this post -  Multiple Zephyr Shell instances over UART 

Luckily, I only need one at a time. If the ESP-AT cannot find a Wi-Fi network, switch to GSM on the SIM7080 module. 

I believe I cannot have them initiated in the configurations and have to initiate them in main. How would I go about this? 

The files in question are:

https://github.com/zephyrproject-rtos/zephyr/blob/21b9a1c8239637bbecd0b74381f3d8fb069a47b3/drivers/wifi/esp_at/esp.c#L4

https://github.com/zephyrproject-rtos/zephyr/blob/21b9a1c8239637bbecd0b74381f3d8fb069a47b3/drivers/modem/simcom-sim7080.c#L7

What would I need to call for this to be initiated in main?





Related