Skip to content

Commit 3cf92bc

Browse files
Andrei Hutanunashif
authored andcommitted
drivers: modem: quectel-bg9x: mdm unsol ready
Using bg9x driver with bg95 specifically has the issue that BG95 modem replies with "RDY" when it's not fully initialized and AT commands sent to the modem after this point would result in modem reply of "ERROR". This commit adds a new prj.conf field in the build configuration for custom unsolicited app ready string, with the default being BG96 one ("RDY"). Signed-off-by: Andrei Hutanu <[email protected]>
1 parent cf3df2b commit 3cf92bc

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

drivers/modem/Kconfig.quectel-bg9x

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ config MODEM_QUECTEL_BG9X_PASSWORD
5454
context. This value is specific to the network provider and may
5555
need to be changed.
5656

57+
config MODEM_QUECTEL_BG9X_UNSOL_RDY
58+
string "Unsolicited response string expected from the modem"
59+
default "RDY"
60+
help
61+
This string is used to determine when modem powered and ready
62+
to accept AT commands. If this value is not matching the modem
63+
response, the init will fail with timeout.
64+
5765
config MODEM_QUECTEL_BG9X_INIT_PRIORITY
5866
int "quectel BG9X driver init priority"
5967
default 80

drivers/modem/quectel-bg9x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static const struct modem_cmd response_cmds[] = {
921921
static const struct modem_cmd unsol_cmds[] = {
922922
MODEM_CMD("+QIURC: \"recv\",", on_cmd_unsol_recv, 1U, ""),
923923
MODEM_CMD("+QIURC: \"closed\",", on_cmd_unsol_close, 1U, ""),
924-
MODEM_CMD("RDY", on_cmd_unsol_rdy, 0U, ""),
924+
MODEM_CMD(MDM_UNSOL_RDY, on_cmd_unsol_rdy, 0U, ""),
925925
};
926926

927927
/* Commands sent to the modem to set it up at boot time. */

drivers/modem/quectel-bg9x.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#define MDM_APN_LENGTH 32
5454
#define RSSI_TIMEOUT_SECS 30
5555

56+
#define MDM_UNSOL_RDY CONFIG_MODEM_QUECTEL_BG9X_UNSOL_RDY
5657
#define MDM_APN CONFIG_MODEM_QUECTEL_BG9X_APN
5758
#define MDM_USERNAME CONFIG_MODEM_QUECTEL_BG9X_USERNAME
5859
#define MDM_PASSWORD CONFIG_MODEM_QUECTEL_BG9X_PASSWORD

0 commit comments

Comments
 (0)