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.
Firmware image details
When the execution time is violated, critical applications are deemed as malfunctioning. This demo detects two types of issues:
- Temporal issues are events arriving outside of the expected frequency.
- 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:
Generate event data streams.
Convert the streams to stream configuration files.
Pack the streams to generate deployment data.
Transfer the generated stream deployment data to Safety Island Cluster 1 (CL1).
Run
cam-app-example
from the Primary Compute terminal to create an application with four streams.cam-service
is loading the four stream deployment files for monitoring and checks against the received streams to identify temporal and logical issues.Inject network faults.
Detect injected faults.
Run the firmware image
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.When the device boots, navigate to the Console tab and select
Primary Compute Non-Secure
from the dropdown.Login as
root
.Check that all the expected services have been initialized.
root@fvp-rd-kronos:~# systemctl is-system-running --wait
runningStart
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
List the stream event log files generated.
ls -l *.csel
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- 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.
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- The stream deployment data is a binary representation of the stream configuration that needs to be deployed to the Safety Island.
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.1Change to the
Safety Island CL1
console from the dropdown.Check that the stream deployment data transfer was successful.
fs ls RAM:/
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
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
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: 1724850660663164ERROR: 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