Skip to main content
Use the RTSS test commands to test the drivers. By default, the RTSS software supports the CLI test commands through the UART terminal. Run the test commands to generate the logs. Caution Before executing any RTSS CPU core 3 test commands, enable RTSS CPU core 3. For enablement instructions, see RTSS CPU3 enablement in QCS9075M Hardware Design Guide.

Prerequisites

  • Set up debug UART.
  • Go to UART terminal.
  • To enable logging on to UART terminal, do the following:
    1. Select Enter in the UART Shell to access sail_proc@home$. The following sample output shows the logs that confirm the access to sail_proc@home$.
    2. Run setlog <Level > <Privilege> on the UART terminal to set the allowed logging based on level and privilege. Parameters:
      • <Level>: info, err, warn, or dbg
      • <Privilege>: el1 or el2
      For example,
      The following sample output shows the logs for loglevel set to LOG_INFO:

Procedure

Run the following commands and verify the logs to validate the successful execution of commands:
  • help
  • gpio
  • i2cel1
  • spi
  • gpttmr_test
  • ospinor_el1
  • can

help

Run help on the UART terminal to know about the list of supported commands and their usage. For example,
The following sample logs show the usage references and command references:

gpio

Run the following gpio commands on the UART terminal to do the GPIO functional test.
Note
GPIO 11 is used as the reference GPIO number in all examples below. Replace <gpio_num> with the actual GPIO number available on your hardware. The canMailboxTask: MD S1 NOT READY!!! messages on core c1 are CAN mailbox background messages and don’t affect GPIO test results.
  • gpio Run the generic GPIO test suite that covers all basic test cases (TC_GPIO_000 through TC_GPIO_004). For example,
    Parameters: None Sample logs:
  • gpio input <gpio_num> Configure a GPIO pin as input using the RAW driver interface. Parameter: <gpio_num>: GPIO pin number to configure as input. For example,
    Sample logs:
  • gpio output <gpio_num> Configure a GPIO pin as output using the RAW driver interface. Parameter: <gpio_num>: GPIO pin number to configure as input. For example,
    Sample logs:
  • gpio high <gpio_num> Drive a GPIO pin to logic high using the RAW driver interface. Parameter: <gpio_num>: GPIO pin number to drive high. For example,
    Sample logs: c0[ 156.699917s]Setting gpio 11 as High with RAW
  • gpio low <gpio_num> Drive a GPIO pin to logic low using the RAW driver interface. Parameter: <gpio_num>: GPIO pin number to drive low. For example,
    Sample logs: c0[ 168.908299s]Setting gpio 11 as Low with RAW
  • gpio read <gpio_num> Read and report the current logic state of a GPIO pin. Parameter: <gpio_num>: GPIO pin number to read. For example,
    Sample logs:
  • gpio intr_low <gpio_num>
    Note
    The gpio intr_low, gpio intr_high, gpio intr_rising, gpio intr_falling, and gpio intr_dual commands register summary interrupts for the specified GPIO. Before configuring the same GPIO with a different interrupt trigger type, deregister the existing summary interrupt by running gpio summary_intr_dereg <gpio_num>
    Enable a low-level triggered interrupt on a GPIO pin. Parameter: <gpio_num>: GPIO pin number on which to enable low-level interrupt. For example,
    Sample logs: c0[ 192.765044s]Enabled Low Level Interrupt on gpio 11 with RAW
  • gpio intr_high <gpio_num> Enable a high-level triggered interrupt on a GPIO pin. Parameter: <gpio_num>: GPIO pin number on which to enable high-level interrupt. For example,
    Sample logs: c0[ 502.252913s]Enabled High Level Interrupt on gpio 11 with RAW
  • gpio intr_rising <gpio_num> Enable a rising-edge triggered interrupt on a GPIO pin. Parameter: <gpio_num>: GPIO pin number on which to enable rising-edge interrupt. For example,
    Sample logs:
    NoteThe log reports Low Level Interrupt instead of Rising Edge Interrupt. Verify whether this is the expected firmware behaviour or flag it as a log string defect in the driver.
  • gpio intr_falling <gpio_num> Enable a falling-edge triggered interrupt on a GPIO pin. Parameter: <gpio_num>: GPIO pin number on which to enable falling-edge interrupt. For example,
    Sample logs:
  • gpio intr_dual <gpio_num> Enable a dual-edge (both rising and falling) triggered interrupt on a GPIO pin. Parameter: <gpio_num>: GPIO pin number on which to enable dual-edge interrupt. For example,
    Sample logs:
  • gpio intr_trigger <gpio_num> Wait and validate an interrupt trigger on a GPIO pin. The command blocks until the interrupt fires and the ISR executes. Parameter: <gpio_num>: GPIO pin number on which to trigger and validate the interrupt. For example,
    Sample logs:
  • gpio direct_intr_dereg <gpio_num> Deregister a previously registered direct interrupt handler on a GPIO pin. Parameter: <gpio_num>: GPIO pin number from which to deregister direct interrupt. For example,
    Sample logs: c0[ 453.821464s]Direct Interrupt deregister test passed
  • gpio summary_intr_reg <gpio_num> Register a summary interrupt handler on a GPIO pin and validate the registration. Parameter: <gpio_num>: GPIO pin number on which to register summary interrupt. For example,
    Sample logs:
  • gpio summary_intr_dereg <gpio_num> Deregister a previously registered summary interrupt handler on a GPIO pin. Parameter: <gpio_num>: GPIO pin number from which to deregister summary interrupt. For example,
    Sample logs:

i2cel1

Run i2cel1 on the UART terminal to do the I2C functional test.
NoteThe i2cel1 test command is for i2c0 only. For i2c1, you must update the test application.
Note
PMIC is connected to I2C.
PMIC is connected to I2C. Parameters: None For example,
The following sample logs show the successful validation of the i2cel1 command:
NoteTo get all the I2C test result logs, enable the INFO log level by running the following command:

spi

Run spi on the UART terminal to do the SPI functional test.
NoteThe spi test command is for spi0 only. For multiple SPI channels, you must configure the DTS file.
Parameters: None For example,
The following sample logs show the successful validation of the spi command:
NoteTC_SPI_002/TC_SPI_003/TC_SPI_005 are expected to fail due to no device ID and scratch register. These test cases will be removed in a future release.
NoteTo enable the SPI loopback, add the following code changes in Spi_PBcfg.c:
NoteDue to a known task-priority issue, the SPI test case may occasionally fail to execute. If the SPI test case doesn’t run, apply the following changes and re-test. This will be fixed in the future release.

gpttmr_test

Run gpttmr_test on the UART terminal to do the GPT functional test.
NoteRunning gpttmr_test across different RTSS clusters (CPU cores) can expose interrupt-handling issues that may occasionally result in a device crash. However, there is no functional issue with the GPT driver itself.
The following are the various gpttmr_test commands:
  • gpttmr_test ft <N> N: <0/1/2/3> specifies the core on which the test will run. The user can explicitly select the core using this parameter. If no core is specified, the test will run on Core 0 by default.
    • gpttmr_test ft 3 - Runs the functional test on core 3
    • gpttmr_test ft - Runs the test on core 0 (default)
For example,
The following sample logs show the initialization of the timer test:
  • gpttmr_test stats The command prints the tick count delta and represents the difference between the configured target tick count and the actual tick count. It can be used to evaluate the accuracy and performance of the timer functionality. The following sample logs show the statistics for various GPT channels: For example,

ospinor_el1

Run ospinor_el1 on the UART terminal to do the SPI functional test. The command executes the positive and async test to evaluate the SPINOR memory read, write, and erase functionality. Parameters: None For example,
The following sample logs show the successful validation of the ospinor_el1 command:

CAN – RTSS test commands

Run the following can commands on the UART terminal to do the CAN functional test:
  • can init
  • can TX
  • can RX
Run CAN test commands
  • can init Syntax:
    Sample logs for can -t 0 -config 1:
    can TX - standard ID Syntax:
    Parameters: x = CAN controller ID: 0 to 7 Sample logs for can -t 3 -c 1
    The CAN TX data shows up on the PCAN-View application.
    pcan-view-application-1.png
    can TX - FD ID Syntax:
    Parameters: x = CAN controller ID: 0 to 7 Sample logs for can -t 5 -c 1
    The CAN TX FD data shows up on the PCAN-View application
image1.png
CAN RX To run the CAN RX command, do the following: a. Select Transmit > New Message ….
image3.png
b. On the New Transmit Message window, set the following configurations:
image4.png
  • ID: Enter the CAN ID (For example, 123).
  • Length: Set the number of data bytes (8, 12, 32, 64).
  • Data: Enter the data bytes (For example, 11 22 33 44 55 66 77 88).
  • cycle time : 1000 ms
  • under Message Type, ensure to select the CAN FD checkbox if it’s a CAN FD frame.
c. Select ok. d. On the Transmit window, select the cycle time checkbox to start sending the message.
image5.png
NoteTo stop sending the message, unselect the cycle time.
The following figure shows the transmitted message and received logs:
image6.png
Sample logs for standard CAN:

CAN – HLOS mailbox test commands

The following are the HLOS mailbox CAN test commands:

Enable sail_can user-space application

Run the command to start the sail_can application to use this feature:
NoteFor high performance requirements, —debug must be skipped. Use —debug to print the log messages on the console.
Test case output:

View CAN ports

Run the command to see all the CAN ports from APSS:
Test case output:
vcan0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00inet addr:169.254.185.103 Mask:255.255.0.0vcan1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00inet addr:169.254.185.103 Mask:255.255.0.0vcan8 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00inet addr:169.254.185.103 Mask:255.255.0.0vcan9 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00inet addr:169.254.185.103 Mask:255.255.0.0wlan0 Link encap:Ethernet HWaddr F6:4F:02:32:74:EA
NoteEdit the active_controller value at /etc/sail_can/sail_can.conf to reflect the actual number of controllers on the device.Start sail_can only after editing and saving the conf file.

Bootup CAN port status

Run the command to update the CAN port status at bootup:
NoteEnsure this test sail_can is running in the background.

Set CAN port baud

Run the command to configure the CAN node with bit rate per the CAN bus:

Send data

Run the command to send data on CAN bus and receive using a PCAN analyzer on another end:
Test case output:

Receive data

Run the command to receive data from CANutils (candump) on the can port. Data is sent from PCAN or other external device.
Test case output:

Error CAN

Send error frame on CAN bus using PCAN analyzer. Use external analysers, such as PCAN, to send error frames.

Send multiple data

To verify CAN communication using one of the following setups:
  • Send data over multiple CAN buses and receive it using a PCAN analyzer.
  • Connect two devices through multiple CAN ports and receive data on the corresponding ports.
  • Connect multiple CAN ports on the same device to a single CAN bus and transmit/receive data across different CAN ports.
Run the following command:
Test case output:

Set baud to multiple CAN port

Run the command to configure the CAN node with bit rate per the CAN bus for more than one CAN port.

Receive multiple data

Run the command to receive data using SOCKETCAN APIs on more than one CAN port:
Test case output:

Mailbox test applications

Prerequisites

Before running mailbox test applications:
  1. Update SELinux configuration:
    1. Change SELINUX=enforcing to SELINUX=permissive in the /etc/selinux/config file.
    2. Verify the updated configuration:
      Sample output:
  2. Reboot the device by running the following command either in the ADB shell or in the UART shell:

Check mailbox driver status

  1. Run the following command to verify that the mailbox driver is initialized:
    Sample output:
  2. Verify device node:
    Sample output: /dev/sailMB

sail_console_chan_app

  1. Run the following command in the APSS UART shell:
    Sample output:
NoteThe sail_console_chan_app test application emulates (acts like) the RTSS UART console shell.

saildbg

I²C testing
  • Run the following command in APSS UART shell:
  • Sample logs:
    • APSS side:
    • RTSS side:
SPI testing
  • Run the following command in APSS UART shell:
  • Sample logs:
  • APSS side:
  • RTSS side:
NoteThe failure of TC_I2C_09 is expected, as it is intended to validate negative test scenarios.

mailbox

The mailbox command executes the functional testcases to evaluate the external mailbox performance. Reboot the system after the test is completed.
NoteRun the mailbox command in the RTSS UART console.

sailmb_demo

Run the application from the APSS UART shell:
The application supports the following options: Example scenarios:
  • Send multiple messages to a core. The following command sends the default message 10 times to Core 1:
    Sample output:
    • APSS side:
    • RTSS side:
  • Send a custom message. The following command sends Ping from Linux 10 times to Core 2:
    Sample output:
    • APSS side:
    • RTSS side:
  • Specify the core in hexadecimal format. The following command sends Testing Core 3 five times to Core 3:
    Sample output:
    • APSS side:
    • RTSS side:
Each received message identifies the responding RTSS core and includes the original message. Use this information to verify that the selected core processed every message.

Ethernet test commands

View the interface configuration

When the device is connected to a public network, the Dynamic Host Configuration Protocol (DHCP) automatically assigns an IP address to the RTSS Ethernet interface. Run the following command to view the assigned IP address, subnet mask, gateway, MAC address, and Ethernet link status:
Sample output: [NW] ifconfig: link=UP
[NW] ipv4 192.168.200.20 up=1 dhcp=1
[NW] mask 255.255.255.0
[NW] gw 192.168.200.10
[NW] mac e8:e0:b7:b5:7d:e1
[NW] ipv6 fe80::eae0:b7ff:feb5:7de1 up=1

Set static IPv4 configuration

Run the following command to apply a static IPv4 configuration to the Ethernet device:
Parameters:
  • <ip>: Static IPv4 address to assign to the RTSS Ethernet interface.
  • <mask>: Subnet mask for the assigned IPv4 address.
  • <gw>: Default gateway IP address used to reach devices outside the local subnet.
Example:
Sample output:

View network statistics

Use the following command to display network buffer and heap counters:
Sample output:
Key metrics:
  • net buffers: min—if this reaches 0, packet drops may occur.
  • heap: min_ever—if this approaches 0, memory pressure exists.

Run a ping test

Run the following command to send ICMP echo requests to a remote host and confirm data connectivity:
Parameters: <ip>: Link partner IP address <N>: Number of probes. The default value is 4, and the maximum supported value is 32. Example:
Sample output:

Testing network protocols

The following figure shows the high-level client/server connection used to validate Ethernet communication between the IQ-9075 target and a connected host. RTSS on the target uses the FreeRTOS TCP/UDP network stack and Ethernet interface to exchange data with the host over a standard Ethernet link. This setup supports TCP client/server testing and UDP packet transmission to verify network connectivity or protocol functionality.
highleveliq9clientserver.png
High-level IQ-9075 client/server connection TCP test To perform a TCP test, start the server by running the following command:
Example:
Run the following command to do the TCP test:
Parameters:
  • <ip>: IP address of the remote TCP server.
  • <port>: Port number on the remote TCP server.
  • <data>: Data payload to send over the active TCP connection.
Example:
UDP test Run the following command to do the UDP test:
Parameters:
  • <ip>: IPv4 address of the remote host.
  • <port>: Port number on the remote host.
  • [size]: packet payload size, in bytes.
Example:

Watchdog test commands

By default, Watchdog is enabled after device bootup. Watchdog enable and disable commands provide feasibility for debugging the software faults. To run the RTSS watchdog commands, do the Prerequisites.

Disable all watchdogs

The wdg disable command disables all four cores simultaneously to stop watchdog petting across the system. For example,
The following sample logs show the watchdog disabled for all cores:
Note
  • If all active cores (Core 0, Core 1, Core 2, and Core 3) remain idle for more than 30 seconds, they enter the Sleep state. In the Sleep state, the wdg disable command can’t disable the watchdog on Core 1, Core 2, and Core 3. Additionally, commands executed while the cores are in the Sleep state don’t take effect on Core 1, Core 2, and Core 3.
c0[ 197.375209s] come for WDG disable core [0]
c0[ 197.375253s] [ WDT ] WDT disabled for core 0
c0[ 197.375291s][WDT] : Core_0 wdt disable performed
c0[ 197.375765s][WDT test] disable command send
  • When user selects Enter on RTSS console, then core 0 will exit the Sleep state and watchdog is enabled as UART interrupts are registered on core 0. External interrupts are required for cores 1, core2, core3 to exit Sleep mode.
c0[ 260.591159s]sail_proc@home$
c0[ 266.639045s][WDT] Watchdog enabled on core 0 cluster-: 0
c0[ 266.639184s] [ WDT ] Petting started for core 0
c0[ 266.639592s][WDT] Petting Queuesend success with time-: 55000 core-:0
c0[ 266.639641s][WDT] : Core_0 wdt enable performed

Enable watchdog

The wdg core<N> enable command enables the watchdog for the specified core. The watchdog starts counting and expects periodic petting.
Parameter: N is core number. Note For a split-split cluster configuration, the number of cores is 4. For a split-lock configuration, the number of cores is 3. For example,
The following sample logs show the watchdog enabled for core0:

Disable watchdog

The wdg core<N> disable commands disables the watchdog for the specified core. The counter stops and no reset will be triggered.
Parameter: N is core number. For example,
The following sample logs show the watchdog disabled for core0:

Trigger watchdog bite

The wdg core<N> triggerbite <time_ms> command forces an immediate watchdog bite on the specified core after the given timeout in milliseconds. This is used to test the bite-triggered reset and recovery sequences.
Parameters:
  • N: Core number
  • time_ms: Timeout value in milliseconds
For example,
The following sample logs show the watchdog trigger bite for core 0: c0[ 1930.862604s] Wdg Core0 triggerbite : Passed
c0[ 1930.863200s] BITE trigger recived on core 0
NoteAfter exection of this command, the device enters the Crash state.

Verify window maximum violation

The wdg core<N> winmax command tests the window maximum violation behavior, such as the watchdog is deliberately not petted until after WIN_MAX, verifying that a bark interrupt is correctly generated.
Parameter: “N“is core number.

Verify window minimum violation

The wdg core<N> winmin command tests the window minimum violation behavior, such as the watchdog is petted before WIN_MIN, verifying that a window error interrupt is correctly generated.