Skip to content

Commit 6083b89

Browse files
ycsinnashif
authored andcommitted
drivers: modem: gsm_ppp: Add support for Quectel modems
Add support for Quectel modem in gsm_ppp modem driver. The CMUX cmd is based on MUX application notes v1.0(2020-09-22) for BG95, BG77 and BG600L. Tested and working on EC21e. As the gsm_ppp doesn't do power control, it is required to power on the modem manually in the application. Signed-off-by: Yong Cong Sin <[email protected]>
1 parent 36451e6 commit 6083b89

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

drivers/console/Kconfig.gsm_mux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ config GSM_MUX_PENDING_CMD_MAX
6060
config GSM_MUX_MRU_DEFAULT_LEN
6161
int "Default size of received user data (MRU)"
6262
default 127 if MODEM_GSM_SIMCOM
63+
default 127 if MODEM_GSM_QUECTEL
6364
default 31
6465
range 1 1509
6566
depends on GSM_MUX

drivers/modem/Kconfig.gsm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ config MODEM_GSM_SIMCOM
2727
help
2828
Use this if you have SIMCOM based modem like SIM800 etc.
2929

30+
config MODEM_GSM_QUECTEL
31+
bool "Quectel modem"
32+
help
33+
Use this if you have Quectel based modem like EC2X etc.
34+
3035
endchoice
3136

3237
config MODEM_GSM_RX_STACK_SIZE

drivers/modem/gsm_ppp.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,20 @@ static int mux_enable(struct gsm_modem *gsm)
769769
STRINGIFY(CONFIG_GSM_MUX_MRU_DEFAULT_LEN),
770770
&gsm->sem_response,
771771
GSM_CMD_AT_TIMEOUT);
772+
} else if (IS_ENABLED(CONFIG_MODEM_GSM_QUECTEL)) {
773+
ret = modem_cmd_send_nolock(&gsm->context.iface,
774+
&gsm->context.cmd_handler,
775+
&response_cmds[0],
776+
ARRAY_SIZE(response_cmds),
777+
"AT+CMUX=0,0,5,"
778+
STRINGIFY(CONFIG_GSM_MUX_MRU_DEFAULT_LEN),
779+
&gsm->sem_response,
780+
GSM_CMD_AT_TIMEOUT);
781+
782+
/* Arbitrary delay for Quectel modems to initialize the CMUX,
783+
* without this the AT cmd will fail.
784+
*/
785+
k_sleep(K_SECONDS(1));
772786
} else {
773787
/* Generic GSM modem */
774788
ret = modem_cmd_send_nolock(&gsm->context.iface,

0 commit comments

Comments
 (0)