-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Describe the bug
I'm trying the Quectel BG9x modem driver on my STM32F1 custom board with Quectel EC21 as their initialization should be the same and the offloaded TCP AT commands are the same.
I compiled the modem on basic/blinky example with these
prj.conf
CONFIG_GPIO=y
CONFIG_LOG=y
CONFIG_KERNEL_LOG_LEVEL_DBG=y
CONFIG_KERNEL_LOG_LEVEL_DBG=y
CONFIG_MODEM_LOG_LEVEL_DBG=y
def_config
# Modem
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_MODEM=y
CONFIG_MODEM_QUECTEL_BG9X=y
.dts:
/* QUECTEL EC21 */
quectel_ec21: quectel_ec21 {
compatible = "quectel,bg9x";
label = "QUECTEL EC21";
mdm-power-gpios = <&gpiob 1 GPIO_ACTIVE_LOW>;
mdm-reset-gpios = <&gpiob 0 GPIO_ACTIVE_LOW>;
mdm-dtr-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
status = "okay";
};
The driver initialized fine, however it seems to be stucked in a bootloop:
Log:
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x20003d60 for thread 0x20001ba8: obj_size=1024 buf_start=0x20003d60 buf_size 1024 stack_ptr=0x20004160
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x20004160 for thread 0x20001b30: obj_size=256 buf_start=0x20004160 buf_size 256 stack_ptr=0x20004260
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x200023c8 for thread 0x20000af0: obj_size=768 buf_start=0x200023c8 buf_size 768 stack_ptr=0x200026c8
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x20004a60 for thread 0x20001c20: obj_size=1024 buf_start=0x20004a60 buf_size 1024 stack_ptr=0x20004e60
[00:00:02.000,000] <dbg> os.setup_thread_stack: stack 0x20002ad0 for thread 0x20001808: obj_size=2048 buf_start=0x20002ad0 buf_size 2048 stack_ptr=0x200032d0
[00:00:02.000,000] <dbg> os.setup_thread_stack: stack 0x200026c8 for thread 0x20001790: obj_size=1032 buf_start=0x200026c8 buf_size 1032 stack_ptr=0x20002ad0
[00:00:02.000,000] <inf> modem_quectel_bg9x: Setting Modem Pins
[00:00:04.750,000] <inf> modem_quectel_bg9x: ... Done!
[00:00:04.750,000] <inf> modem_quectel_bg9x: Waiting for modem to respond
[00:00:13.729,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [RDY] (len:3)
[00:00:13.747,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:13.800,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:13.883,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:13.953,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [] (len:7)
[00:00:13.953,000] <inf> modem_quectel_bg9x: Manufacturer: Quectel
[00:00:13.954,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:14.006,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [] (len:4)
[00:00:14.006,000] <inf> modem_quectel_bg9x: Model: EC21
[00:00:14.007,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:14.060,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [] (len:16)
[00:00:14.060,000] <inf> modem_quectel_bg9x: Revision: EC21EFAR06A01M4G
[00:00:14.060,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:14.131,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [] (len:15)
[00:00:14.131,000] <inf> modem_quectel_bg9x: IMEI: 867962045083204
[00:00:14.132,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:14.205,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:14.207,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [+CSQ: ] (len:11)
[00:00:14.207,000] <inf> modem_quectel_bg9x: RSSI: -1000
[00:00:14.208,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:16.213,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [+CSQ: ] (len:11)
[00:00:16.213,000] <inf> modem_quectel_bg9x: RSSI: -1000
[00:00:16.214,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:18.217,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [+CSQ: ] (len:11)
[00:00:18.217,000] <inf> modem_quectel_bg9x: RSSI: -1000
[00:00:18.217,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:20.220,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [+CSQ: ] (len:11)
[00:00:20.220,000] <inf> modem_quectel_bg9x: RSSI: -57
[00:00:20.220,000] <dbg> modem_cmd_handler.cmd_handler_process_rx_buf: match cmd [OK] (len:2)
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x20003d60 for thread 0x20001ba8: obj_size=1024 buf_start=0x20003d60 buf_size 1024 stack_ptr=0x20004160
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x20004160 for thread 0x20001b30: obj_size=256 buf_start=0x20004160 buf_size 256 stack_ptr=0x20004260
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x200023c8 for thread 0x20000af0: obj_size=768 buf_start=0x200023c8 buf_size 768 stack_ptr=0x200026c8
[00:00:00.000,000] <dbg> os.setup_thread_stack: stack 0x20004a60 for thread 0x20001c20: obj_size=1024 buf_start=0x20004a60 buf_size 1024 stack_ptr=0x20004e60
[00:00:02.000,000] <dbg> os.setup_thread_stack: stack 0x20002ad0 for thread 0x20001808: obj_size=2048 buf_start=0x20002ad0 buf_size 2048 stack_ptr=0x200032d0
[00:00:02.000,000] <dbg> os.setup_thread_stack: stack 0x200026c8 for thread 0x20001790: obj_size=1032 buf_start=0x200026c8 buf_size 1032 stack_ptr=0x20002ad0
After this it will repeat again at the
[00:00:02.000,000] <inf> modem_quectel_bg9x: Setting Modem Pins
continuously. If I add a 5 seconds delay after bg9x:L1070, then it will be able to print an additional line:
[00:00:17.080,000] <inf> modem_quectel_bg9x: Network is ready.
I then debugged this and found that it resets at around
or
But then I don't know what to do to further trace this issue down. No errors printed in the log.
To Reproduce
Steps to reproduce the behavior:
- Build
samples/blinkyexample with thedts,def_configandprj.confon a STM32F103RE board with Quectel EC21 - See error
Expected behavior
I'm expecting that LED to be blinking on samples/blinky
Impact
This is a showstopper, I'm working on a IoT device that depends on modem to send data.
Logs and console output
See above
Environment (please complete the following information):
- OS: Windows 10
- Toolchain: gnuarmemb
- Just did
west init zephyr_projectandwest updatetoday, should be the latest version
Additional context
I edited bg9x.h:L33 from 30 to 10 to reduce the amount of SRAM used by the buffer
The log is from my PR, using the original code produced more or less the same result.

