AN 999: Drive-on-Chip with Functional Safety Design Example: Agilex™ 7 Devices

ID 823627
Date 7/04/2024
Public

Visible to Intel only — GUID: bqa1716287537593

Ixiasoft

Document Table of Contents

3.7. Modifying the HPS Safety Function Application

The Drive-on-Chip with Functional Safety Design Example for Devices includes an HPS safety function application as part of the meta layer. The source code is in <PROJ_LOCATION>/hps_software/src or in the recipe <PROJ_LOCATION>/hps_software/meta-safedriveonchip/recipes-example/hpssafechannel/files/hpssafechannel_1.0.tar.gz HPS Channel Speed Monitoring Safety Application describes the HPS safety application source code.

The recipe hpssafechannel_1.0.bb compiles and deploys the application after the Yocto build in /opt/hpssafechannel directory, ready to be run in the HPS. The recipe hpssafechannelservice_1.0.bb installs all necessary files to start the application after HPS booting process (starts the application as a service). You don't need to relaunch the whole Yocto build every time you modify the software, just use the Makefile in the src directory.

  1. Copy the source code to a workspace.
    >> cd <YOUR_WORKSPACE>
    >> cp -r <PROJ_LOCATION>/hps_software/src/ <YOUR_WORKSPACE>
    
  2. Install the ARM64 GCC compiler (or your favorite ARM64 toolchain).
    >> sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
    >> sudo apt-get install libncurses5-dev
  3. As the main program uses ncurses, download and precompile version 6.4 from: https://ftp.gnu.org/gnu/ncurses/
    >> cd ncurses
    >> ./configure --host=aarch64-linux-gnu --prefix=/usr/aarch64-linux-gnu CXX="aarch64-linux-gnu-g++" --disable-stripping --with-fallbacks=linux --without-xterm-new --with-terminfo-dirs=/etc/terminfo
    >>sudo make install
    
  4. Set the CROSS_COMPILE environment variable accordingly.
    >> export CROSS_COMPILE=aarch64-linux-gnu-
    >> echo $CROSS_COMPILE
    
  5. Build the executable hspsafechannel.
    >> cd <YOUR_WORKSPACE>
    >> make all
    

    You can transfer the executable to the board using ssh, sftp or copy it into the SD card directly.