# Tools

Source: [https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html](https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html)

The following tools are supported for functional testing and build environment set up.

## Sensor functional test tools

Source: [https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html](https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html)

The sensor info test, driver acceptance test, and sensor workhorse are designed to
            facilitate comprehensive testing of the sensor functionalities.

- The sensor info test provides detailed information about the sensor.
- The driver acceptance test ensures that the sensor drivers are functioning correctly
                and are compatible with the QSH.
- The sensor workhorse is a tool to stress-test the sensors under various
                conditions.

The test tools ensure the accuracy, reliability, and optimal performance of both the
            hardware-based and software-based sensors in your applications. The following sections
            provide information on the test tools.

### Sensor info test (ssc\_sensor\_info)

Source: [https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html](https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html)

The sensor info test `ssc_sensor_info`, is an application within the QSH
            test suite. It lists the QSH supported sensors and their attributes. You can query the
            attributes of a given data type.

ssc_sensor_info [-sensor=<sensor_type>] [-delay=<time_in_seconds>][-duration=<time_in_seconds>][-default_only=<1|0>][-log=<1|0>][-help] 
     Copy to clipboard

Table : Parameters of ssc_sensor_info

| **Flags** | **Type** | **Value** | **Units** | Notes |
| --- | --- | --- | --- | --- |
| sensor | `string` | Any valid sensor type, such as accel and gyro. | NA | Queries the attribute information for a specified sensor<br>                            type. |
| log | `int` | 0 | 1 | – | Enable or disable diag (API) logs. |
| help(h) | `int` | – | – | Displays command usage help. |
| duration | `int` | Positive values | seconds | Specifies the wait time for the sensor attribute updates. |
| delay | `int` | Positive values | seconds | Specifies the time delay before sending the sensor requests. |
| default\_only | `int` | 0 | 1 | – | If the `default_only` flag is set to false, UIDs of<br>                            all the available sensors supporting the specified data type is sent. If<br>                            the `default_only` flag is set to true, only the UID of<br>                            the default sensor availability is sent. |

**Sensor info test examples**

- Query sensor attributes and generate diag logs.
ssc_sensor_infoCopy to clipboard

root@qcm6490:~# ssc_sensor_info
        ssc_sensor_info v1.86
                            
        SUID           = 0xebd5604d09d379bca54dcf30ec041e0f
        NAME           = ak0991x
        VENDOR         = akm
        TYPE           = mag
        AVAILABLE      = true
        VERSION        = 2.62.47
        API            = sns_mag.proto
        RATES          = [1.000000, 10.000000, 20.000000, 50.000000, 100.000000]
        RESOLUTIONS    = 0.150000
        RANGES         = [-4912.000000,4912.000000]
        DRI            = false
        FIFO_SIZE      = 0
        STREAM_TYPE    = streaming
        STREAM_SYNC    = false
        DYNAMIC        = false
        EVENT_SIZE     = 16
        OP_MODES       = [LOW_POWER, LOW_NOISE]
        ACTIVE_CURRENT = 900
        SLEEP_CURRENT  = 3
        HW_ID          = 0
        RIGID_BODY     = display
        PHYSICAL_SENSOR       = true
        PHYSICAL_SENSOR_TESTS = [3, 1]
        SELECTED_RESOLUTION   = 0.150000
        SELECTED_RANGE        = [-4912.000000,4912.000000]
                            
        SUID           = 0xaddeaddeaddeaddeaddeaddeaddeadde
        NAME           = da_test
        VENDOR         = QTI
        TYPE           = da_test
        AVAILABLE      = true
        VERSION        = 0.51.0
        API            = sns_da_test.proto
        STREAM_TYPE    = on_change
                            
        SUID           = 0x69def905fea2fbac6a43ca273221a2eb
        NAME           = aont
        VENDOR         = QTI
        TYPE           = aont
        AVAILABLE      = true
        VERSION        = 0.0.1
        API            = sns_aont.proto
        STREAM_TYPE    = on_change
                            
        SUID           = 0xabababababababababababababababab
        NAME           = suid
        VENDOR         = QTI
        TYPE           = suid
        AVAILABLE      = true
        VERSION        = 0.0.1
        API            = sns_suid.proto
        STREAM_TYPE    = single_output
                            
        SUID           = 0xe12754a7007f27595e2541b4701e2275
        NAME           = registry
        VENDOR         = QTI
        TYPE           = registry
        AVAILABLE      = true
        VERSION        = 0.0.1
        API            = sns_registry.proto
        STREAM_TYPE    = single_output
        
        SUID           = 0xadfeadfeadfeadfeadfeadfeadfeadfe
        NAME           = da_test_big_image
        VENDOR         = QTI
        TYPE           = da_test
        AVAILABLE      = true
        VERSION        = 0.49.0
        API            = sns_da_test.proto
        STREAM_TYPE    = on_change
                            
        SUID           = 0x61ab5376b4a5c9aa58442ede47acd316
        NAME           = icm4x6xx
        VENDOR         = TDK-Invensense
        TYPE           = accel
        AVAILABLE      = true
        VERSION        = 1.65.2
        API            = sns_accel.proto
        RATES          = [12.500000, 25.000000, 50.000000, 100.000000, 200.000000, 500.000000]
        RESOLUTIONS    = [0.000019, 0.000037, 0.000075, 0.000150, 0.000299]
        RANGES         = [[-9.806650,9.806650], [-19.613300,19.613300], [-39.226601,39.226601], [-78.453201,78.453201], [-156.906403,156.906403]]
        DRI            = true
        FIFO_SIZE      = 200
        STREAM_TYPE    = streaming
        STREAM_SYNC    = false
        DYNAMIC        = false
        EVENT_SIZE     = 16
        OP_MODES       = [LPM, NORMAL, HIGH_PERF]
        ACTIVE_CURRENT = [50, 240, 240]
        SLEEP_CURRENT  = 6
        HW_ID          = 0
        RIGID_BODY     = display
        PHYSICAL_SENSOR       = true
        PHYSICAL_SENSOR_TESTS = [3, 2, 1]
        SELECTED_RESOLUTION   = 0.000299
        SELECTED_RANGE        = [-156.906403,156.906403]
        LOW_LATENCY_RATES     = 1000.000000
        PASSIVE_REQUEST       = true                
                        Copy to clipboard

- Query all accel sensor attributes
ssc_sensor_info -sensor=accelCopy to clipboard

root@qcm6490:~# ssc_sensor_info -sensor=accel
        ssc_sensor_info v1.86
        
        SUID           = 0x61ab5376b4a5c9aa58442ede47acd316
        NAME           = icm4x6xx
        VENDOR         = TDK-Invensense
        TYPE           = accel
        AVAILABLE      = true
        VERSION        = 1.65.2
        API            = sns_accel.proto
        RATES          = [12.500000, 25.000000, 50.000000, 100.000000, 200.000000, 500.000000]
        RESOLUTIONS    = [0.000019, 0.000037, 0.000075, 0.000150, 0.000299]
        RANGES         = [[-9.806650,9.806650], [-19.613300,19.613300], [-39.226601,39.226601], [-78.453201,78.453201], [-156.906403,156.906403]]
        DRI            = true
        FIFO_SIZE      = 80
        STREAM_TYPE    = streaming
        STREAM_SYNC    = false
        DYNAMIC        = false
        EVENT_SIZE     = 16
        OP_MODES       = [LPM, NORMAL, HIGH_PERF]
        ACTIVE_CURRENT = [50, 240, 240]
        SLEEP_CURRENT  = 6
        HW_ID          = 0
        RIGID_BODY     = display
        PHYSICAL_SENSOR       = true
        PHYSICAL_SENSOR_TESTS = [3, 2, 1]
        SELECTED_RESOLUTION   = 0.000299
        SELECTED_RANGE        = [-156.906403,156.906403]
        LOW_LATENCY_RATES     = [1000.000000, 2000.000000]
        PASSIVE_REQUEST       = trueCopy to clipboard

**Test application output**

The test application generates the following output:
- Standard output on console
- Result file

### Driver acceptance test (ssc\_drva\_test)

Source: [https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html](https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html)

The driver acceptance test tool `ssc_drva_test`, is used for the sensor
            driver validation and operates at the QSH sensor API layer. It executes a range of
            sensor use cases. The tool accepts the parameters directly from the command line and
            eliminates the need for compile-time options. This makes it a convenient and efficient
            tool to perform basic driver-level tests or validations.

ssc_drva_test [-sensor=<sensor_type>] [-duration=<time_in_seconds>] [-sample_rate=<value_in_Hz>] [-batch_period=<value_in_seconds>] [-iterations=<value>] [-num_samples=<value>] [-factory_test=<value>]Copy to clipboard

Table : Parameters of ssc_drva_test

| **Flags** | **Type** | **Value** | **Units** | **Notes** |
| --- | --- | --- | --- | --- |
| `sensor` | `string` | <ul class="ul" id="driver_acceptance_test__ul_fdz_cyh_r1c_monicapa_03-08-24-1528-6-536"><br>                                    <li class="li"><code class="ph codeph">accel</code></li><br><br>                                    <li class="li"><code class="ph codeph">gyro</code></li><br><br>                                    <li class="li"><code class="ph codeph">sensor_temperature</code></li><br><br>                                    <li class="li"><code class="ph codeph">pressure</code></li><br><br>                                    <li class="li"><code class="ph codeph">mag</code></li><br><br>                                    <li class="li"><code class="ph codeph">humidity</code></li><br><br>                                    <li class="li"><code class="ph codeph">ambient_temperature</code></li><br><br>                                    <li class="li"><code class="ph codeph">ultra_violet</code></li><br><br>                                    <li class="li"><code class="ph codeph">proximity</code></li><br><br>                                    <li class="li"><code class="ph codeph">ambient_light</code></li><br><br>                                    <li class="li"><code class="ph codeph">rgb</code></li><br><br>                                    <li class="li"><code class="ph codeph">hall</code></li><br><br>                                    <li class="li">Any custom sensor added</li><br><br>                                </ul> | – | Mandatory argument: limited to the available sensor types. |
| `duration` | `float` | Positive values only | Seconds | Mandatory argument: sensor test duration in seconds. |
| `sample_rate` | `float` | Positive floating point number values:<br><ul class="ul" id="driver_acceptance_test__ul_f5h_2rh_n1c_monicapa_02-23-24-720-48-25"><br>                                <li class="li">-1: Maximum sampling rate</li><br><br>                                <li class="li">-2: Minimum sampling rate</li><br><br>                            </ul> | Hz | Mandatory for streaming sensors, optional for on-change sensors. |
| `batch_period` | `float` | Positive floating point numbers | Seconds | This is same as the report period and indicates how long to buffer<br>                            the samples and report outside of the low-power processor. |
| `iterations` | `int` | Positive values only | NA | Provides the number of times the test must be repeated. |
| `num_samples` | `int` | Positive values only | NA | Indicates the minimum number of samples intended to be collected. If<br>                                a `num_samples` parameter is specified and the test<br>                                does not collect enough samples during the test, a FAIL is generated<br>                                by the test sensor.<br><br><br>                            <br>The `num_samples`parameter forces the test to run for<br>                                a maximum duration between a specified duration or duration<br>                                calculated by the following:<ul class="ul" id="driver_acceptance_test__ul_zw5_ygx_p1c_monicapa_03-03-24-1428-35-237"><br>                                    <li class="li"><code class="ph codeph">num_samples*</code> expected sample rate, where<br>                                        the expected sample rate is the rate at which the sensor is<br>                                        expected to serve.</li><br><br>                                </ul> |
| `factory_test` | `int` | <ul class="ul" id="driver_acceptance_test__ul_g5h_2rh_n1c_monicapa_02-23-24-720-48-25"><br>                                <li class="li"><code class="ph codeph">0 (SNS_PHYSICAL_SENSOR_TEST_TYPE_SW)</code></li><br><br>                                <li class="li"><code class="ph codeph">1 (SNS_PHYSICAL_SENSOR_TEST_TYPE_HW)</code></li><br><br>                                <li class="li"><code class="ph codeph">2 (SNS_PHYSICAL_SENSOR_TEST_TYPE_FACTORY)</code></li><br><br>                                <li class="li"><code class="ph codeph">3 (SNS_PHYSICAL_SENSOR_TEST_TYPE_COM)</code></li><br><br>                            </ul> | NA | Selects the type of factory test (from the value column) that you<br>                            want to run. |

**Driver acceptance test examples**

- Stream a single sensor at a selected sampling frequency for a known duration:
ssc_drva_test -sensor=accel -duration=5 -sample_rate=500Copy to clipboard

root@qcm6490:~# ssc_drva_test -sensor=accel -duration=5 -sample_rate=500
        6 ssc_drva_test version 1.27k
        6 ssc_drva_test -sensor=accel -duration=5 -sample_rate=500
        diag: Diag_LSM_Init: invoked for pid: 1141 with init_count: 0
        diag:successfully connected to socket 3
        diag: Diag_LSM_Init: done for pid: 1141 with init_count: 1
        6 event_cb attribute event for da_test
        6 event_cb attribute event for da_test
        6 using da_test name=da_test, suid = [high addeaddeaddeadde, low addeaddeaddeadde
        6 enter send_memory_log_req cookie: 6
        6 exit send_memory_log_req
        6 enter da_test runner. -rumifact=1
        6 -time_to_first_event=233206
        6 -time_to_last_event=-20008
        6 -sample_ts=50267544823
        6 -total_samples=2528
        6 -avg_delta=37875
        6 -recvd_phy_config_sample_rate=500
        6 -random_seed_used=2926886043
        6 -num_request_sent=2
        6 -first_sample_timestamp=50171775915
        6 received event: PASS
        6 enter send_memory_log_req cookie: 6
        6 exit send_memory_log_req
        6 PASSCopy to clipboard
- Batch a single sensor at a selected sampling frequency and report period for a
                    known duration:
ssc_drva_test -sensor=accel -duration=30.0 -sample_rate=100 -batch_period=2.0Copy to clipboard

root@qcm6490:~# ssc_drva_test -sensor=accel -duration=30.0 -sample_rate=100 -batch_period=2.0
        3 ssc_drva_test version 1.27k
        3 ssc_drva_test -sensor=accel -duration=30.0 -sample_rate=100 -batch_period=2.0
        diag: Diag_LSM_Init: invoked for pid: 1413 with init_count: 0
        diag:successfully connected to socket 3
        diag: Diag_LSM_Init: done for pid: 1413 with init_count: 1
        3 event_cb attribute event for da_test
        3 event_cb attribute event for da_test
        3 using da_test name=da_test, suid = [high addeaddeaddeadde, low addeaddeaddeadde
        3 enter send_memory_log_req cookie: 3
        3 exit send_memory_log_req
        3 enter da_test runner. -rumifact=1
        3 -time_to_first_event=15321140
        3 -time_to_last_event=-13606286
        3 -sample_ts=8591389823
        3 -total_samples=2960
        3 -avg_delta=184826
        3 -recvd_phy_config_sample_rate=100.000000
        3 -random_seed_used=3720387971
        3 -num_request_sent=2
        3 -first_sample_timestamp=8030694123
        3 received event: PASS
        3 enter send_memory_log_req cookie: 3
        3 exit send_memory_log_req
        3 PASSCopy to clipboard
- Self-test for accelerometer (hardware self-test):
ssc_drva_test -sensor=accel -factory_test=1 -duration=10Copy to clipboard

root@qcm6490:~# ssc_drva_test -sensor=accel -factory_test=1 -duration=10
        4 ssc_drva_test version 1.27k
        4 ssc_drva_test -sensor=accel -factory_test=1 -duration=10
        diag: Diag_LSM_Init: invoked for pid: 1439 with init_count: 0
        diag:successfully connected to socket 3
        diag: Diag_LSM_Init: done for pid: 1439 with init_count: 1
        4 event_cb attribute event for da_test
        4 event_cb attribute event for da_test
        4 using da_test name=da_test, suid = [high addeaddeaddeadde, low addeaddeaddeadde
        4 enter send_memory_log_req cookie: 4
        4 exit send_memory_log_req
        4 enter da_test runner. -rumifact=1
        4 -time_to_first_event=0
        4 -time_to_last_event=-2032137957
        4 -sample_ts=10622073335
        4 -total_samples=0
        4 -avg_delta=0
        4 -recvd_phy_config_sample_rate=0.000000
        4 -random_seed_used=1840104635
        4 -num_request_sent=2
        4 -first_sample_timestamp=0
        4 received event: PASS
        4 enter send_memory_log_req cookie: 4
        4 exit send_memory_log_req
        4 PASSCopy to clipboard

**Output**:

On the console command line, this test only outputs as pass or fail, which indicates only
            the test execution status (whether the test is complete).

### Sensor workhorse (see\_workhorse)

Source: [https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html](https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html)

The sensor workhorse tool `see_workhorse`, operates specific sensors based
            on the command-line arguments. It is designed to streamline sensor testing and data
            collection in various configurations.

see_workhorse [-sensor=<sensor_type>][-sample_rate=<min | max | number>] [-batch_period=<seconds>] [-calibrated=<0 | 1>] [-wakeup=<0 | 1>]Copy to clipboard

Table : Parameters of see_workhorse

| Flags | Type | Value range | Units | Notes |
| --- | --- | --- | --- | --- |
| `sensor` | `string` | <ul class="ul" id="sensor_workhorse__ul_scn_hzh_r1c_monicapa_03-08-24-1537-3-266"><br>                                    <li class="li"><code class="ph codeph">accel</code></li><br><br>                                    <li class="li"><code class="ph codeph">gyro</code></li><br><br>                                    <li class="li"><code class="ph codeph">sensor_temperature</code></li><br><br>                                    <li class="li"><code class="ph codeph">pressure</code></li><br><br>                                    <li class="li"><code class="ph codeph">mag</code></li><br><br>                                    <li class="li"><code class="ph codeph">humidity</code></li><br><br>                                    <li class="li"><code class="ph codeph">ambient_temperature</code></li><br><br>                                    <li class="li"><code class="ph codeph">ultra_violet</code></li><br><br>                                    <li class="li"><code class="ph codeph">proximity</code></li><br><br>                                    <li class="li"><code class="ph codeph">ambient_light</code></li><br><br>                                    <li class="li"><code class="ph codeph">rgb</code></li><br><br>                                    <li class="li"><code class="ph codeph">hall</code></li><br><br>                                    <li class="li">Any custom sensor added</li><br><br>                                </ul> | NA | Mandatory argument: Limited to the available sensor types. |
| `on_change` | `int` | 0 | 1 | NA | <ul class="ul" id="sensor_workhorse__ul_owz_nzh_r1c_monicapa_03-08-24-1538-57-350"><br>                                <li class="li">0 selects using<br>                                        <code class="ph codeph">SNS_STD_SENSOR_STREAM_TYPE_STREAMING</code>.</li><br><br>                                <li class="li">1 selects using <code class="ph codeph"><br>                                        SNS_STD_SENSOR_STREAM_TYPE_ON_CHANGE</code>.</li><br><br>                            </ul> |
| `sample_rate` | `float` | Positive floating point number values:<br><ul class="ul" id="sensor_workhorse__ul_g5b_xsh_n1c_monicapa_02-23-24-733-54-889"><br>                                <li class="li">-1: Maximum sampling rate</li><br><br>                                <li class="li">-2: Minimum sampling rate</li><br><br>                            </ul> | Hz | Mandatory for streaming sensors, optional for on-change sensors. |
| `batch_period` | `float` | Positive floating point numbers | Seconds | Same as the batch period or report period. |
| `calibrated` | `int` | 0 | 1 | NA | <ul class="ul" id="sensor_workhorse__ul_m4l_xzh_r1c_monicapa_03-08-24-1541-43-436"><br>                                <li class="li">0: nop (default).</li><br><br>                                <li class="li">1: if the <code class="ph codeph">sensor_type</code> is gyro or mag, then also<br>                                    activate <code class="ph codeph">gyro_cal</code> or <code class="ph codeph">/mag_cal</code>,<br>                                    respectively.</li><br><br>                            </ul> |
| `wakeup` | `int` | 0 | 1 | NA | <ul class="ul" id="sensor_workhorse__ul_vkb_113_r1c_monicapa_03-08-24-1542-29-309"><br>                                <li class="li">0: sets <code class="ph codeph">suspend_config</code> wake-up to<br>                                        <code class="ph codeph">SEE_CLIENT_DELIVERY_NO_WAKEUP</code>.</li><br><br>                                <li class="li">1: sets <code class="ph codeph">suspend_config</code> wake-up to<br>                                        <code class="ph codeph">SEE_CLIENT_DELIVERY_WAKEUP</code> (default).</li><br><br>                            </ul> |
| `display_events` | `int` | 0 | 1 | NA | Display sensor events in JSON format, using the event<br>                            callbacks. |

**Sensor workhorse examples**

For instance, use the following command to stream the accelerometer data at the
                    maximum rate for 30 seconds:

see_workhorse -sensor=accel -sample_rate=max -duration=30 -display_events=1Copy to clipboard

root@qcm6490:~# see_workhorse -sensor=accel -sample_rate=max -duration=30 -display_events=1
    see_workhorse version 2.04
    20:22:15.406 see_workhorse -sensor=accel -sample_rate=max -duration=30 -display_events=1
    begin usta_get_sensor_listCopy to clipboard

This command instructs `see_workhorse` to run the accelerometer
                        `accel`, at a maximum sample rate for a duration of
                    30 seconds.

20:22:15.731 stream_sensor( accel)
    20:22:15.731 + sample_rate: 500.000000 hz
    20:22:15.838 config_stream_sensor() complete rc 0
    20:22:15.838 sleep(30) seconds
    
    "sns_client_event_msg" : {
     "suid" : {
      "suid_low" : "0x58442ede47acd316",
      "suid_high" : "0x61ab5376b4a5c9aa"
     },
     "events" : [
      {
       "msg_id" : 768,
       "timestamp" : 78497742089,
       "payload" : {
        "sample_rate" : 500.000000,
        "water_mark" : 1,Copy to clipboard

## Miscellaneous tools

Source: [https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html](https://docs.qualcomm.com/doc/80-70014-7/topic/test_tools.html)

The following are the tools for the build environment and functional diagnose:

- **Qualcomm® Hexagon™ DSP toolchain**
    Hexagon 8.4.07 toolchain
- **QXDM Professional tool**

    The Qualcomm® eXtensible diagnostic monitor (QXDM) Professional™ tool is a
                        diagnostic client.

    - The QSH framework can call the macros and APIs directly to send the
                            debug information to print strings and log packets.
    - The QXDM logs are primarily used for the aDSP side debugging. For more
                            information, see *Debug* in [Qualcomm Linux Sensors Guide -
                                Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70014-7A/overview.html).
                            
Note: [Qualcomm Linux
                                    Sensors Guide - Addendum](https://docs.qualcomm.com/bundle/resource/topics/80-70014-7A/overview.html) is accessible only
                                to the Authorized users.
    - The QXDM Professional tool requires a USB connection. The application
                        processors have a direct connectivity to a USB port, but the aDSP does
                        not.

Last Published: Jul 12, 2024

[Previous Topic
Samples](https://docs.qualcomm.com/bundle/publicresource/80-70014-7/topics/samples.md) [Next Topic
Calibrate](https://docs.qualcomm.com/bundle/publicresource/80-70014-7/topics/calibrate.md)