# SPDX-License-Identifier: LicenseRef-SierraWireless-Proprietary
# SPDX-FileCopyrightText: 2026 Sierra Wireless, Inc.
1. Description
==============

dm-logger (the application) is a utility that collect firmware logs from Sierra Wireless Modems based on Qualcomm chipsets.  


2. Prerequisities
=================

The application should only be used with drivers included in MBPL release packages.  It does not work with GobiNet and GobiSerial drivers distributed with legacy SLQS packages.

2.1 PCIe driver
The mhictrl driver should be used for SDX55/SDX65 based modems in PCIe mode. The modem should be recognized as /dev/mhixxx modems which can be listed via command "ls /dev/mhi*".

2.2 USB driver
The following drivers should be used for modems in USB mode: 
- Network Driver: Open Source cdc_mbim driver (for the MBIM interface) or the qmi_wwan driver (included in the MBPL release packages for the RmNet interface)
- Serial Driver: Open Source qcserial driver (included in MBPL release packages)

Please note that GobiNet and GobiSerial drivers (if installed) should be removed or blacklisted from host system before launching the application.  These drivers were distributed with older SLQS releases and are no longer supported.

To blacklist Gobixxx drivers, add the following entries to "/etc/modprobe.d/blacklist-modem.conf" file and restart the Linux platform:

blacklist GobiNet
blacklist GobiSerial


3. Supported Modems
====================

  All actively shipping products based on Qualcomm chipsets.


4. Build Instructions
=====================

  $cd tools/dm-logger/
For x86_64
  $make clean
  $make
For ARM64linaro
  $make clean CPU=arm64linaro
  $make CPU=arm64linaro
For ARM64
  $make clean CPU=arm64
  $make CPU=arm64
For Raspberry Pi ARM
  $make clean CPU=rpi
  $make CPU=rpi

The binaries should be built under the bin folder.

Note on armv7l platforms (e.g. Raspberry Pi as reference):
  - Build via release/scripts: Use bin/dm-loggerrpi (pre-built from MBPL package).
  - Local build (make without CPU=): Produces bin/dm-loggerhostarmv7l. Use this
    binary when building manually on an armv7l host. "make clean" removes it
    (intended behavior). Run "make" to regenerate.

Note: dm-logger binaries are built with PIE (Position Independent Executable) enabled by default. 
To build with PIE disabled, run the make with "NOPIE=1".

5. Command Options
==================

./<appName> -p dm_device [-P qdss_device] [-eq enableqdss] [-dq disableqdss] [-D dpl_device] [-ed enabledpl] [-dd disabledpl] [-c config] [-s stop] [-o output] [-b buffer_size] [-mf max_file_size] [-ml max_log_size] [-C] [-m] [-t connect_time_delay] [-r retries] [-i retry_interval] [-w] [-T wait_time_after_device_detection] [-R wait_for_device_retries] [-I wait_for_device_retry_interval] [-v] [-d] [-V] [-h]

   -p dm_device: DM COM device (e.g.: "/dev/ttyUSB1" or "/dev/wwan0qcdm0")
   -P qdss_device: QDSS COM device (e.g.: "/dev/QDSS_Data_90E3_2-2:1.9" or "/dev/mhi0_QDSS")
   -eq enableqdss: Configuration file for enabling QDSS logging - cfg or sqf format only
   -dq disableqdss: Configuration file for disabling QDSS logging - cfg or sqf format only
   -D dpl_device: DPL COM device (e.g.: "/dev/QTI_DPL_Data_90E3_2-2:1.10" or "/dev/mhi0_IP_HW_ADPL")
   -ed enabledpl: Configuration file for enabling DPL logging - cfg or sqf format only
   -dd disabledpl: Configuration file for disabling DPL logging - cfg or sqf format only
   -c config: Configuration file - cfg or sqf format only
   -s stop: Stop logging command sequence file - cfg or sqf format only
   -o output: Log file name - default is "DmLogger.qmdl" if not specified
   -b buffer_size: Size of buffer for logging data - default is 32KB if not specified
   -mf max_file_size: Maximum log file size - default is 1GB if not specified
   -ml max_log_size: Maximum total log size - default is 2GB if not specified
   -C: Circle over log files continuely by overwriting old ones
   -m: Merge data from all ports to single log file.  Ignored if neither QDSS nor DPL is available
   -t connect_time_delay: Time delay after connect (in millisecond), default is 2
   -r retries: Number of retries accessing data port, default is 10
   -i retry_interval: Interval between retries accessing data port (in millisecond), default is 2
   -w: Wait for DM device if failed to open
   -T wait_time_after_device_detection: Time delay after waited device is found (in millisecond), default is 8000
   -R wait_for_device_retries: Number of retries waiting for device, default is 600
   -I wait_for_device_retry_interval: Interval between retries waiting for device (in millisecond), default is 1000
   -v: Enable verbose output information
   -d: Enable debug output, verbose is also turned on
   -V: Show version information
   -h: Show help information


6. Examples
===========

For logging on PCIe DM interface:
$sudo ./dm-loggerhostx86_64 -p /dev/mhitty0 -c ../filters/default.cfg -o log.qmdl

For logging on DM, QDSS and DPL interfaces with linaro PCIe driver:
$sudo ./dm-loggerhostx86_64 -p /dev/wwan0qcdm0 -P /dev/mhi0_QDSS -D /dev/mhi0_IP_HW_ADPL -eq ../filters/enable_qdss_pcie.cfg -ed ../filters/enable_dpl_pcie.cfg

For logging on DM, QDSS and DPL interfaces with USB driver with QDSS and DPL support:
$sudo ./dm-loggerhostx86_64 -p /dev/ttyUSB1 -P /dev/QDSS_Data_90E3_2-2:1.9 -D /dev/QTI_DPL_Data_90E3_2-2:1.10 -eq ../filters/enable_qdss_usb.cfg -ed ../filters/enable_dpl_usb.cfg


7. Notes, exceptions, etc.
==========================

1. Prior to Execution

Enter the following AT commands:
  
  at!entercnd="A710"
  at!custom="QXDMLOGENABLE",1

For EM92xx, please use the following commands instead,

  at!entercnd="A710"
  AT!CUSTOM="DIAGENABLE",1

2. Filter files

The following filter files are included:

  default.cfg             - for most scenario
  lte_5g_rrc-nas-ota.cfg  - lite weight filter to capture registration issues
  lwm2m.cfg               - for capturing LWM2M information

3. Continuous logging

When using -C option to keep logging continuously, it is best practice to have maximum total log size 
(-ml option value) larger than maximum log file size (-mf option value), so that multiple log files
are created.  When maximum total log size is reached, oldest log file will be overwritten.

