Installation
We currently support Linux, Windows (via WSL), and Apple Silicon MacOS.
You can use any distro but you will need to install the following:
libhidapi
libusb
docker
Optionally, if you are using the EVK2 cable-attached dev kit, you will need the appropriate firmware to run it in cable-attached mode. Download the firmware by clicking “Cable-Attached Dev Kit Firmware” on the EVK2 reference design page of the femtoAI Developer Portal. The firmware then needs to be flashed using the Teensy Loader, as described in the EVK2 reference manual (also available at the link above).
Ubuntu
We will give Ubuntu as an example.
We need to install hidapi packages and a udev rule.
sudo apt install libhidapi-hidraw0 libhidapi-libusb0
You will also need the teensy udev rule.
Download the 00-teensy.rules file from the link and put it in /etc/udev/rules.d/.
Then you will need to run
sudo udevadm control --reload-rules && sudo udevadm trigger
Apple Silicon Mac
brew install hidapi libusb
Then you will need to add to your zshrc and restart all open terminals.
export DYLD_LIBRARY_PATH=/opt/homebrew/lib
You could do this by running
echo 'export DYLD_LIBRARY_PATH=/opt/homebrew/lib' >> ~/.zshrc
Python 3.10 is required (Note: Only 3.10 is supported explicitly. YMMV with newer versions.). Femtocrux requires docker to be installed (see other instructions for femtocrux).
From PyPI:
pip install femtodriver
This will install the femtodrive and pull_femtocrux_image executables.
Windows
Windows users can use femtodriver via WSL and USBIPD. Open Powershell as administrator and run
wsl --install -d Ubuntu-24.04
Open the Ubuntu 24.04 app from the start menu and proceed with the Ubuntu setup instructions above. Once Ubuntu is installed, connect the EVK via USB and turn it on after loading the Cable-Attached Dev Kit Firmware (see above).
Bind the EVK USB connection to WSL. Open Powershell as administrator again and run
usbipd bind --busid X-X
usbipd attach --wsl --busid X-X
You can find your busid X-X by running the following with and without the EVK connected. The EVK busid will only be shown when it is connected and powered on.
usbipd list
You can verify that the EVK is connected correctly by running the following in the Ubuntu terminal
lsusb
You should now see the EVK device Van Ooijen Technische Informatica Teensyduino RawHID
Docker Installation
You will need to install docker to run our compiler and simulator. Please refer to the docker installation instructions to do this.
If you are running WSL (Windows), you must enable Use WSL 2 based engine in the Docker settings
Docker Image Password Authentication
Femtodriver relies on running a docker container (called femtocrux) which contains the compiler to compile your model for the EVK2 SPU-001. In order to download the docker container you will be prompted for a password on your first run on the command line whether you use the CLI or the Python API.
In order to do this before your first run, you can run:
pull_femtocrux_image
This will trigger the password prompt and allow you to download the docker container. You only have to do this once per femtocrux version release. You may have to do it again if we update the version and you want to get a newer version of femtocrux.
Cable-Attached Dev Kit Test
You can verify that the cable-attached dev kit is working by compiling a test model and running it on the EVK by running
conda create -n "femtodriver_test" python=3.10
conda activate femtodriver_test
femtodrive LOOPBACK --hardware=evk2 --runners=hw
Conda is not required, but recommended to ensure python version 3.10. If no errors are returned by femtodrive, the EVK and all software packages are functioning correctly.