# Building fpgawrite

## Requirements

* Linux x86_64
* Android NDK r20b or newer
* libxds.so lib ( Extracted from the EducationInstrument.apk app from the firmware )

## Build

./android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi16-clang \
    -O2 \
    -s \
    -o fpgawrite \
    fpgawrite.c \
    -ldl

## Deploy to the Device

adb push fpgawrite /data/local/tmp/
adb shell chmod 755 /data/local/tmp/fpgawrite

## Runtime Dependency

fpgawrite requires: libxds.so

Copy it to the same directory:

adb push libxds.so /data/local/tmp/

## Usage

cd /data/local/tmp
LD_LIBRARY_PATH=. ./fpgawrite help

Read an FPGA register:

./fpgawrite read 3036

Apply the fan fix:

./fpgawrite fanfix
