-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: modem_cellular: added APP RDY signal handling #93052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: modem_cellular: added APP RDY signal handling #93052
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice change. I think it would be better to rename this to modem ready
so it's better suited to use on other modems. For example, the HL7800 will emit a +KSUP message when it is ready. This even could be reused for that modem by simply matching on +KSUP
received.
I agree, naming the unsol handler and event "modem ready", we can easily extend support for more modems by adding
|
e56db8a
to
c165fa0
Compare
Thanks a lot for the feedback :) I implemented the changes |
c165fa0
to
de100c0
Compare
Some modems (e.g. Quectel BG95/EG25-G, several SIMCom parts) print “APP RDY” when the application core is ready. Parse this line and proceed from AWAIT_POWER_ON immediately, while keeping the existing startup timeout as a fall-back. * add MODEM_CELLULAR_EVENT_MODEM_READY + chat match * open UART and attach chat in AWAIT_POWER_ON * jump to SET_BAUDRATE / RUN_INIT_SCRIPT on event Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
de100c0
to
39ceed4
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Some modems, such as the Quectel BG95/EG25-G, emit an
APP RDY
message when the application core has fully initialized and is ready to process AT commands. By listening for this signal, the state machine can proceed earlier than the configuredstartup_time_ms
, improving connection setup time.This patch:
MODEM_CELLULAR_EVENT_MODEM_READY
event and a corresponding unsolicited chat match.AWAIT_POWER_ON
state, so thatAPP RDY
can be captured immediately.SET_BAUDRATE
orRUN_INIT_SCRIPT
as soon asAPP RDY
is seen, while keeping the existing timeout as a fallback for modems that don't emit this message.Tested on a Quectel BG95-M3 on a custom board, where this change consistently advances the flow by several seconds, especially valuable for battery-powered applications where the modem is power-cycled frequently for short bursts of activity (e.g., uplink and shutdown). Over time, this can lead to noticeable energy savings :)
Modems that do not emit APP RDY will follow the same timeout-driven path as before. No behavioral regressions expected.