Example Software

To help you get started writing software for the Sapphire, Efinix provides a variety of example software code that performs functions such as communicating through the UART, controlling GPIO interrupts, performing Dhrystone benchmarking, etc. Each example includes a makefile and src directory that contains the source code.

Note: Many of these examples display messages on a UART. Refer to the following topics for information on attaching a UART module and connecting to it in a terminal:
Table 1. Example Software Code
Directory Description
apb3Demo This example shows how to implement an ABP3 slave.
Axi4Demo This example illustrates how to implement a user AXI4 master.
bootloader This software is the bootloader for the system.
common Provides linking for the makefiles.
clintTimerInterruptDemo This example shows how to use the clint timer with interrupt.
coremark This example is a synthetic computing benchmark program.
customInstructionDemo This example illustrates how to implement a custom instruction.
dCacheFlushDemo This example illustrates how to invalidate the data cache.
dhrystone This example is a synthetic computing benchmark program.
driver This directory contains the system drivers for the peripherals (I2C, UART, SPI, etc.). Refer to the API Reference in Sapphire RISC-V SoC Hardware and Software User Guide and Sapphire High-Performance RISC-V SoC Hardware and Software User Guide for details.
fatFSDemo This example demonstrates the implementation of the FatFS File System with a Command Line Interface (CLI) for interaction.
FreeRTOS This example shows the example software projects targeting the RTOS.
fpuDemo This example shows how to use the floating-point unit.
gpioDemo This example shows how to control the GPIO and its interrupt.
iCacheFlushDemo This example illustrates how to invalidate the instruction cache.
inlineASMDemo This example illustrates utilizing the inline assembly feature.
lwipIperfServer This example illustrates how to use the LWIP software stack to enable the Sapphire high-performance RISC-V SoC as an Iperf server.
i2cDemo This example shows how to connect to an MCP4725 digital-to-analog converter (DAC) using an I2C peripheral.
i2CEepromDemo This example illustrates how to use I2C driver to communicate with the on-board EEPROM device, AT24C01 on either the T120F324 or T120F576 Development Kit.
i2cMasterDemo This example illustrates how to effectively utilize the Sapphire SoC as an I2C master.
i2cMasterInterruptDemo This example is based on the i2cMasterDemo for the Sapphire SoC, with an important enhancement on the timeout interrupt handling.
i2cSlaveDemo This example illustrates how to effectively utilize the Sapphire SoC as an I2C slave.
memTest This code performs a memory address and data test.
nestedInterruptDemo This example shows how to set a higher priority to an interrupt routine, which allows the CPU to prioritize the task execution instead of other interrupts.
oob Example The out-of-box example provides example code that performs multi core operation where Core 0 controls the LED(s) blinking while Core 1 controls the printing of a rotating donut.
rtcDemo This example shows how to use the on-board PCF8523 RTC module on the Ti375C529 FPGA.
sdhcDemo This example evaluates the throughput performance of the SD Host Controller (SDHC) by reading and writing a specific amount of data to and from the SD card.
semihostingDemo This examples shows how to use write and read debug messages through semihosting.
smpDemo (for Sapphire SoC) This example illustrates how to use multiple cores to execute the Tiny encryption algorithm in parallel.
smpDemo (for HRB)
spiDemo This code reads the device ID and JEDEC ID of a SPI flash device and echoes the characters on a UART.
temperatureSensorDemo This example shows how to communicate with the on-board EMC1413 temperature module on Ti375 C529 Development Board.
uartEchoDemo This example shows how to use the UART.
uartInterruptDemo This exmple shows how to use a UART interrupt.
userInterruptDemo This example demonstrates user interrupts with UART messages.
userTimerDemo This example shows how to use the user timer with interrupt.