Intel® Agilex™ Hard Processor System Remote System Update User Guide

ID 683184
Date 7/13/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.5.2. Watchdog Timeout and max retry Operation

This section uses the RSU client to demonstrate the following:
  • RSU handling of watchdog timeouts.
  • max retry feature, which allows each image up to three times to load.
  • RSU notify, which allows the HPS software state to be reported and retrieved after a watchdog timeout.
  • Clearing the RSU status error fields.
  • Resetting the current retry counter value.
Note: The commands listed in this section rely on the commands from the Basic Operation section running first, specifically adding image P2 to the flash.
  1. Power cycle the board, boot Linux*, and display the status – it shows the P2 image running, as it is the highest priority:
    root@linux:~# ./rsu_client --log
          VERSION: 0x00000202
            STATE: 0x00000000
    CURRENT IMAGE: 0x0000000002000000
       FAIL IMAGE: 0x0000000000000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000000
    Operation completed
    What do the version fields mean:
    • Retry counter is 0x00000000 —first attempt to load this image.
    • State is 0x00000000 —No errors to report
  2. Query and display the max_retry value:
    root@linux:~# ./rsu_client --display-max-retry
    max_retry = 3
    Operation completed
    Note: The max_retry option must be queried from U-Boot first, in order for it to be available on Linux.
  3. Enable the watchdog but do not service it, as this produces a timeout, and restarts Linux:
    root@linux:~# echo "something" > /dev/watchdog
    [  603.649746] watchdog: watchdog0: watchdog did not stop!
  4. Wait for Linux* to restart after the watchdog timeout, then display the log:
    root@linux:~# ./rsu_client --log
          VERSION: 0x0ACF0202
            STATE: 0xF0060002
    CURRENT IMAGE: 0x0000000002000000
       FAIL IMAGE: 0x0000000002000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000001
    Operation completed

    The same P2 image is loaded, but the retry counter value is now one, which means this is the second retry for this image to be loaded. The version field shows the last failure was by an application image (0xACF). The state field shows the last error was a watchdog timeout (0xF006) and that the latest notify value from HPS software was from U-Boot loading Linux (0x0002).

  5. Clear the error status so we can see the next errors. Query the status to show the errors were cleared:
    root@linux:~# ./rsu_client --clear-error-status
    Operation completed
    root@linux:~# ./rsu_client --log
          VERSION: 0x00000202
            STATE: 0x00000000
    CURRENT IMAGE: 0x0000000002000000
       FAIL IMAGE: 0x0000000000000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000001
    Operation completed
  6. Cause another watchdog timeout and wait for Linux* to restart. After the restart, query the RSU log and observe that the retry counter is now two:
    root@linux:~# ./rsu_client --log
          VERSION: 0x0ACF0202
            STATE: 0xF0060002
    CURRENT IMAGE: 0x0000000002000000
       FAIL IMAGE: 0x0000000002000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000002
    Operation completed
  7. Clear the error status so we can see the next errors.
  8. Notify the SDM of the HPS execution stage as a 16bit number:
    root@linux:~# ./rsu_client --notify 0x1234
    Operation completed
  9. Cause another watchdog timeout and watch for Linux* to restart. After the restart, query the RSU log:
    root@linux:~# ./rsu_client --log
          VERSION: 0x0ACF0202
            STATE: 0xF0061234
    CURRENT IMAGE: 0x0000000001000000
       FAIL IMAGE: 0x0000000002000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000000
    Operation completed

    The SDM loaded the next application image in the CPB (P1), and it reports that the image P2 failed. The state indicates that a watchdog timeout occurred (upper 16 bits = 0xF006) and that the notify value reported by HPS software was 0x1234. The upper 16 bits of the version are set to 0x0ACF which means the previous error was reported by the application image firmware. For more information, refer to RSU Status and Error Codes .

  10. Clear the error status so we can see the next errors.
  11. Cause a watchdog timeout and display the status - it shows a retry counter value of one:
    root@linux:~# ./rsu_client --log
          VERSION: 0x0ACF0202
            STATE: 0xF0060002
    CURRENT IMAGE: 0x0000000001000000
       FAIL IMAGE: 0x0000000001000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000001
    Operation completed
  12. Use the RSU client to reset the current retry counter value to zero, and query the status again to confirm it:
    rroot@linux:~# ./rsu_client --reset-retry-counter
    Operation completed
    root@linux:~# ./rsu_client --log
          VERSION: 0x0ACF0202
            STATE: 0xF0060002
    CURRENT IMAGE: 0x0000000001000000
       FAIL IMAGE: 0x0000000001000000
        ERROR LOC: 0x00000000
    ERROR DETAILS: 0x00000000
    RETRY COUNTER: 0x00000000
    Operation completed