Software setup from scratch
The instructions below assume that
- you want to set up an FMC ADC on a SPEC carrier board
- the build process happens on the target machine, a more or less up to date Linux system
- kernel sources for the running version of the target machine kernel are installed
- the target has access to the ohwr.org host where repositories are hosted
Clone the software repository
$ git clone git:https://www.ohwr.org/fmc-projects/fmc-adc-100m14b4cha/fmc-adc-100m14b4cha-sw.git
The URL is taken from the repository tab of the FMC ADC software project: https://www.ohwr.org/project/fmc-adc-100m14b4cha-sw/tree/master
Build all the software stack
Change dir into the freshly cloned repository, and just type 'make':
$ make
This will build the FMC ADC drivers, libraries and test programs. In the process, the build will automagically resolve the dependent submodules (fmc-bus, spec-sw, zio) and build them recursively. After some minutes, depending on your hardware configuration, the build should have terminated successfully.
The following step requires super user powers
$ sudo make modules_install
After success, you should see in the /lib/modules//extra directory of the target machine some new stuff like shown below:
pcbe13089:fmc-adc-100m14b4cha-sw$ ls -l
/lib/modules/3.16.0-4-amd64/extra/
total 8608
drwxr-xr-x 2 root root 4096 Aug 3 09:44 buffers
drwxr-xr-x 2 root root 4096 Aug 3 09:44 drivers
-rw-r--r-- 1 root root 2136544 Aug 3 09:44 fmc-adc-100m14b.ko
-rw-r--r-- 1 root root 206456 Aug 3 09:44 fmc-chardev.ko
-rw-r--r-- 1 root root 208432 Aug 3 09:44 fmc-fakedev.ko
-rw-r--r-- 1 root root 609384 Aug 3 09:44 fmc.ko
-rw-r--r-- 1 root root 163432 Aug 3 09:44 fmc-trivial.ko
-rw-r--r-- 1 root root 163320 Aug 3 09:44 fmc-write-eeprom.ko
-rw-r--r-- 1 root root 969232 Aug 3 09:44 spec.ko
drwxr-xr-x 2 root root 4096 Aug 3 09:44 triggers
-rw-r--r-- 1 root root 2450536 Aug 3 09:44 wr-nic.ko
-rw-r--r-- 1 root root 1882592 Aug 3 09:44 zio.ko
The last step will enable us to load modules by simply using a modprobe command:
$ sudo depmod -a
Prepare firmware
We are about to load the Linux device drivers for your FMC ADC. There is one more pre-requisite before doing so. Appropriate firmware binaries must be made accessible to initialise your hardware. Download the files from the URLs below in the prescribed places:
/lib/firmware/fmc/spec-fmc-adc-100m14b.bin https://www.ohwr.org/project/fmc-adc-100m14b4cha-sw/uploads/72545736ae289aba2df7c8b47432956c/spec-fmc-adc-v4.1.bin
/lib/firmware/fmc/spec-init.bin https://www.ohwr.org/project/spec-sw/uploads/636e7eaa2e1c3a884e2f9f694fdfd1b9/spec-init.bin-2015-09-18
Load the kernel modules
Again, super user status is required for this.
$ sudo modprobe spec
$ sudo modprobe fmc-adc-100m14b
These are the required modules to drive an FMC ADC (or more) carried by SPEC boards.
If this step is successful, your kernel module list should display at least the following:
pcbe13089:fmc-adc-100m14b4cha-sw$ lsmod
Module Size Used by
[...other modules...]
spec 22358 0
fmc_adc_100m14b 60343 0
fmc 19119 2 spec,fmc_adc_100m14b
zio 67461 1 fmc_adc_100m14b
[...other modules...]
If you got to this point, congratulations! Your kernel device drivers are ready to go, and the installed boards should be recognized by them. Look into the directory /dev/zio to see your device nodes in full glory:
cfc-774-caos3:~$ ls -l /dev/zio/adc-100m14b-0400-0-i-*
crw-rw---- 1 root root 247, 8 May 18 11:41 /dev/zio/adc-100m14b-0400-0-i-ctrl
crw-rw---- 1 root root 247, 9 May 18 11:41 /dev/zio/adc-100m14b-0400-0-i-data
A -ctrl device should be seen for each FMC ADC in the system.
Finally, do an acquisition
Chapter 13 of the
manual:
[https://www.ohwr.org/project/fmc-adc-100m14b4cha-sw/uploads/6f86c1d449e6aedd04fdd9a049851ca0/fmc-adc-100m14b4cha-sw-driver-2014-09.pdf)
describes how to use the FMC ADC workhorse program fald-simple-acq, which will allow you to acquire samples from your ADC. Instructions in the manual are sufficient to get you started, so we will not duplicate them here.