Skip to main content

Critical Application Monitoring - Baremetal Stock Image

The goal of this firmware image is to detect application execution faults in safety-critical systems and ensure that a certain piece of code running in critical applications executes periodically at a specific frequency.

High-level diagram

Firmware image details

When the execution time is violated, critical applications are deemed as malfunctioning. This demo detects two types of issues:

  1. Temporal issues are events arriving outside of the expected frequency.
  2. Logical issues are events arriving out of order.

cam-app-example is a critical application that uses libcam to generate event streams to be sent to cam-service.

cam-service monitors event streams sent by critical applications and runs from higher safety cores in the Safety Island, uses the stream deployment data to validate event streams produced by critical applications.

Execution flow

The flow of the firmware image is the following:

  1. Generate event data streams.

  2. Convert the streams to stream configuration files.

  3. Pack the streams to generate deployment data.

  4. Transfer the generated stream deployment data to Safety Island Cluster 1 (CL1).

  5. Run cam-app-example from the Primary Compute terminal to create an application with four streams.

  6. cam-service is loading the four stream deployment files for monitoring and checks against the received streams to identify temporal and logical issues.

  7. Inject network faults.

  8. Detect injected faults.

Run the firmware image

  1. Create a virtual RD-1AE board running the Critical Application Monitor (Baremetal)-1.0 (1.0) firmware image. For further details, please refer to the RD-1AE Quickstart guide.

  2. When the device boots, navigate to the Console tab and select Primary Compute Non-Secure from the dropdown.

  3. Login as root.

  4. Check that all the expected services have been initialized.

    root@fvp-rd-kronos:~# systemctl is-system-running --wait
    running
  5. Start cam-app-example in calibration mode (generate .csel stream event log files for each stream).

    cam-app-example -u 11085ddc-bc10-11ed-9a44-7ef9696e -t 3000 -c 10 -s 4 -C
  6. List the stream event log files generated.

    ls -l *.csel
  7. Run cam-tool analyze once for each stream to generate the stream configurations.

    • A stream configuration file is a configuration file containing the number of stream events and their timing characteristics according to requirements of the critical application. cam-tool analyzes the .csel stream event log files and converts them to .csc.yml stream configuration files.
    cam-tool analyze -m 1000000 -i 11085ddc-bc10-11ed-9a44-7ef9696e0000.csel
    cam-tool analyze -m 1000000 -i 11085ddc-bc10-11ed-9a44-7ef9696e0001.csel
    cam-tool analyze -m 1000000 -i 11085ddc-bc10-11ed-9a44-7ef9696e0002.csel
    cam-tool analyze -m 1000000 -i 11085ddc-bc10-11ed-9a44-7ef9696e0003.csel
  8. Run cam-tool pack once for each stream to generate the deployment data.

    • The stream deployment data is a binary representation of the stream configuration that needs to be deployed to the Safety Island. cam-tool converts the .csc.yml stream configuration files into .csd stream deployment files.
    cam-tool pack -i 11085ddc-bc10-11ed-9a44-7ef9696e0000.csc.yml
    cam-tool pack -i 11085ddc-bc10-11ed-9a44-7ef9696e0001.csc.yml
    cam-tool pack -i 11085ddc-bc10-11ed-9a44-7ef9696e0002.csc.yml
    cam-tool pack -i 11085ddc-bc10-11ed-9a44-7ef9696e0003.csc.yml
  9. Transfer the generated stream deployment data to Safety Island CL1 where cam-service is running.

    cam-tool deploy -i 11085ddc-bc10-11ed-9a44-7ef9696e0000.csd -a 192.168.1.1
    cam-tool deploy -i 11085ddc-bc10-11ed-9a44-7ef9696e0001.csd -a 192.168.1.1
    cam-tool deploy -i 11085ddc-bc10-11ed-9a44-7ef9696e0002.csd -a 192.168.1.1
    cam-tool deploy -i 11085ddc-bc10-11ed-9a44-7ef9696e0003.csd -a 192.168.1.1
  10. Change to the Safety Island CL1 console from the dropdown.

  11. Check that the stream deployment data transfer was successful.

    fs ls RAM:/
  12. Start cam-app-example to create four streams.

    cam-app-example -u 11085ddc-bc10-11ed-9a44-7ef9696e -t 3000 -c 10 -s 4 -a 192.168.1.1
  13. Inject a fault to test the CAM framework.

    cam-app-example -u 22085ddc-bc10-11ed-9a44-7ef9696e -t 2000 -c 5 -s 2 -f -S 0 -T 1000 -a 192.168.1.1
  14. You should see the following errors:

    ERROR: Stream temporal error:
    ERROR: stream_name: CAM STREAM 0
    ERROR: stream_uuid:
    ERROR: event_id: 0
    ERROR: time_received: 0
    ERROR: time_expected: 1724850660663164
    ERROR: Stream state error:
    ERROR: stream_name: CAM STREAM 0
    ERROR: stream_uuid:
    ERROR: timestamp: 1724850729608438
    ERROR: current_state: Failed state
    ERROR: requested_state: In-progress state