Why the modem console needs AT#XLOG=1

Serial Modem Host Applications

tags
Serial Modem Host Applications

Serial Modem prints its bootloader and application banners over uart1 and then suspends the log backend and the UART to avoid the roughly 700 uA overhead of keeping it active. Without further action the modem log therefore stops after about 0.65 s of uptime and contains nothing from the phase a test actually exercises.

AT#XLOG=1 resumes it, and the tests issue that command through the host's modem at shell once the host reports Cloud connected. That is all the released image needs: its default INF levels carry the PPP, PDN, and AT events triage relies on.

Three further consequences worth knowing:

  • The command needs the CMUX AT pipe, which only exists after the modem attaches and which CMUX runtime power save closes again after its idle timeout. enable_modem_application_logs() therefore retries and confirms the modem replied OK, warning if it never succeeds.
  • Anything that reboots the host also pulses modem nRESET, which resets the modem and turns logging back off, so the command is reissued after each reboot (for example, after a FOTA update is applied).
  • Reissuing it only works if the image now running has the command. FOTA tests update to a released build, and one produced before CONFIG_MODEM_AT_SHELL was enabled answers modem: command not found, so those runs log a warning and their modem console holds nothing after the update. That resolves itself once a release containing the option exists.