This repository contains the sources and tools used to manufacture and provision the SPIRS development board (SPIRS). It includes the board application, boot ROM changes, and a host-side server and flashing scripts used to prepare an SD card for a device under test.
- Purpose: provide a minimal, reproducible manufacturing flow for SPIRS boards. The repository holds the firmware component that runs on the board, the bootrom changes required, and a host-side server that communicates with the board and produces artifacts to be written to the SD card.
- High level workflow:
- Cross-compile the board application and place it on the target (Keystone) image.
- Build/run the
serveron the host to receive data from the board, produce certificates/signatures and additional payloads. - Run
flash.shto partition the SD card and copy the producedrootfs,fw_payloadand additional data.
-
board/— board-side application and librariescfile.c— application that runs on the device. It obtains values from the PUF, configures the network connection, connects to the hostserverand transfers files.lib/— dependencies required by the board application (for exampleRoT_SPIRS.h). These are used when cross-compiling.
-
bootrom/— boot ROM modificationsmain.c— modifiedmain.cfor the boot ROM. Replace the existingmain.cin the bootrom project with this file when rebuilding the boot ROM.
-
server/— host-side server, keys and flashing utilitiesserver.c— host server that listens for a connection from the board, receives data, and generates certificates and signing data (secure module and kernel signatures).liball.c— dependency archive used when compilingserver.c(or a library built from it).flash.sh— script that prepares and flashes an SD card: creates partitions and copiesrootfs,fw_payload, and the additional data generated byserver.cert_manifacturer.der,ed25519.h,x509custom.h— certificate and crypto headers used by the server.
Below are the original instructions preserved and reorganized. Replace environment variables and paths (like ${COMPILER} and ${EXE}) with values from your toolchain.
-
Build the board application (cross-compile):
Use your cross-compiler and link against the board libraries. Example:
${COMPILER} cfile.c -L./lib -lrotspirs -lm -o ${EXE} --staticAfter building, move the produced executable (
${EXE}) onto the Keystone image for the board. -
Bootrom
Replace the existing
main.cin your bootrom project withbootrom/main.cfrom this repository when rebuilding the boot ROM. -
Server (host)
Build the host server with
liball.cavailable in the same folder. Example compile command (run inserver/):gcc -o server server.c -L. -lall
The
serverprogram configures networking, opens a socket and waits for the board to connect. When the board sends its data, the server creates certificates and additional data (secure module and kernel signatures) required by the device. The server expectsrootfsandfw_payloadto be present in the same directory when creating the additional data. -
Flashing the SD card
The script
server/flash.shformats and partitions the SD card, then copiesrootfs,fw_payloadand the additional data produced by theserverinto the SD image. Ensure those files are present in the same directory asflash.shbefore running it.
- Goal: provide a reproducible minimal manufacturing flow for SPIRS boards: produce device-side binary, host-side artifacts, and prepare an SD card for flashing.
- Assumptions:
- You have a suitable cross-compiler for the target platform (Keystone board).
rootfsandfw_payloadartifacts are produced/available alongside theserverbefore generating additional data.- The host running
serverhas the required crypto libraries and tools to build and run the code.
- The board application (
board/cfile.c) reads PUF values — ensure hardware support and drivers are available when running on the device. - If you see network issues between the board and the host server, check firewall rules and that both endpoints are on the correct interfaces.
- Keep manufacturer keys and certificates safe; do not commit additional private keys to the repository.
For questions about this manufacturing flow, contact the project maintainers (see repository metadata) or open an issue. This repository does not include an explicit license file; if you need one, add a LICENSE describing permitted uses.
folder "board" contains the application that must be cross compiled and runned on the board
- lib folder has all the dependencies
- cfile.c is the application, it obtain the values from the puf, configure the network connection and connect to the socket created by the server and passes the files on the socket. to compile use
${COMPILER} cfile.c -L./lib -lrotspirs -lm -o ${EXE} --staticand then move the executable on keystone.
folder "bootrom" contains the modification necessary to the bootrom.
- "main.c" needs to be inserted in the bootrom project instead on the old "main.c"
folder "server" contains the data necessary to run the server on the pc
- all required certificates and keys
- the dependency archive "liball.c"
- the file "server.c" requires to be compiled with the library "liball.c" and is in charge of communicating with the board: configure the network, opens the socket, wait for the board data, creates certificate and additional data (sm and kernel signatures). requires to have the rootfs and fw_payload in the same folder. compiled with
gcc -o server server.c -L. -lall. it creates the additional data that are required to flash in the SD. - the script "flash.sh" flashes the values in the SD, creates the partitions and copies the rootfs, fwpayload and the additional data in the SD. requires to have them in the same folder.