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 <andrei.hutanu.i@gmail.com>
This commit is contained in:
Andrei Hutanu 2023-04-22 11:24:01 +02:00 committed by Anas Nashif
parent cf3df2b840
commit 3cf92bce11
3 changed files with 10 additions and 1 deletions

View file

@ -54,6 +54,14 @@ config MODEM_QUECTEL_BG9X_PASSWORD
context. This value is specific to the network provider and may
need to be changed.
config MODEM_QUECTEL_BG9X_UNSOL_RDY
string "Unsolicited response string expected from the modem"
default "RDY"
help
This string is used to determine when modem powered and ready
to accept AT commands. If this value is not matching the modem
response, the init will fail with timeout.
config MODEM_QUECTEL_BG9X_INIT_PRIORITY
int "quectel BG9X driver init priority"
default 80

View file

@ -921,7 +921,7 @@ static const struct modem_cmd response_cmds[] = {
static const struct modem_cmd unsol_cmds[] = {
MODEM_CMD("+QIURC: \"recv\",", on_cmd_unsol_recv, 1U, ""),
MODEM_CMD("+QIURC: \"closed\",", on_cmd_unsol_close, 1U, ""),
MODEM_CMD("RDY", on_cmd_unsol_rdy, 0U, ""),
MODEM_CMD(MDM_UNSOL_RDY, on_cmd_unsol_rdy, 0U, ""),
};
/* Commands sent to the modem to set it up at boot time. */

View file

@ -53,6 +53,7 @@
#define MDM_APN_LENGTH 32
#define RSSI_TIMEOUT_SECS 30
#define MDM_UNSOL_RDY CONFIG_MODEM_QUECTEL_BG9X_UNSOL_RDY
#define MDM_APN CONFIG_MODEM_QUECTEL_BG9X_APN
#define MDM_USERNAME CONFIG_MODEM_QUECTEL_BG9X_USERNAME
#define MDM_PASSWORD CONFIG_MODEM_QUECTEL_BG9X_PASSWORD