Workflow

Step 1: install pre-requisites

  • Either

    1. provide a native build context by installing associated pre-requisites, e.g., a suitable compiler and programming tool-chain, e.g., board-specific versions of GCC and OpenOCD, or

    2. provide a Docker build context by installing the Docker container platform.

Step 2: clone repository

  • Either use

    1. the GitHub CLI, e.g.,

      gh repo clone https://github.com/danpage/fiat.git ./fiat
      

      or

    2. git itself, e.g.,

      git clone https://github.com/danpage/fiat.git ./fiat
      

    to clone the repository.

  • Execute

    cd ./fiat
    source ./bin/conf.sh
    

    to configure the environment. For example, you should find that the FIAT_PATH_REPO environment variable is set appropriately.

Step 3: develop target implementation

  • Edit

    ${FIAT_PATH_REPO}/src/fiat/target/kernel/imp/kernel_imp.conf
    

    to configure the target implementation (and support for it),

  • Edit

    ${FIAT_PATH_REPO}/src/fiat/target/kernel/imp/kernel_imp.h
    ${FIAT_PATH_REPO}/src/fiat/target/kernel/imp/kernel_imp.c
    

    to complete the target implementation itself.

Step 4: build target implementation

  • Either decide on the build context then set the associated environment variable, e.g., by executing

    export FIAT_CONTEXT="native"
    

    or accept default of native.

  • Either decide on the driver type then set the associated environment variable, e.g., by executing

    export FIAT_DRIVER="binary"
    

    or accept default of binary.

  • Either decide on the board type then set the associated environment variable, e.g., by executing

    export FIAT_BOARD="native"
    

    or accept default of native.

  • Either

    1. for a native build context, execute

      make target/clean
      make target/fetch-dep
      make target/patch-dep
      make target/build-dep
      make target/build
      

      or

    2. for a docker build context, execute

      make target/clean
      make target/build
      

Step 5: use target implementation

  • If the build process succeeds, it produces associated artefacts, e.g.,

    ${FIAT_PATH_REPO}/build/target/${FIAT_BOARD}/target.elf
    

    in ${FIAT_PATH_REPO}/build/target/${FIAT_BOARD}. Using the appropriate programming infrastructure, you can program your board with one of them.