The following instructions are for Debian-based distributions. Change the commands according to the distribution you are using.
- Install the following prerequisites:
- CMake
- GNU Toolchain
- Make
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install cmake build-essential- Clone the repository and build the project:
git clone https://github.com/thomasfaingnaert/scriptable-guitar-pedal
mkdir build
cd build
cmake ../scriptable-guitar-pedal
make- Run the executable:
chmod +x ./scriptable-guitar-pedal
./scriptable-guitar-pedal- Install the following prerequisites, and make sure they are in your PATH:
- CMake (https://cmake.org/)
- Beaglebone GNU Toolchain (http://gnutoolchains.com/beaglebone/)
- NMake (included in Visual Studio or Microsoft Visual C++ Build Tools)
- PuTTY (https://www.putty.org/)
- Clone the repository and build the project:
git clone https://github.com/thomasfaingnaert/scriptable-guitar-pedal
mkdir build
cd build
cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE="../scriptable-guitar-pedal/cmake/Toolchain.cmake" ../scriptable-guitar-pedal
nmake- Install the following prerequisites:
- CMake
- GNU Toolchain for ARM
- Make
If you are using Ubuntu or one of its derivatives:
sudo apt install make cmake binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihfIf you are using Fedora:
sudo dnf copr enable lantw44/arm-linux-gnueabihf-toolchain
sudo dnf install make cmake arm-linux-gnueabihf-{binutils,gcc,glibc}Otherwise, change the commands according to the distribution you are using.
- Clone the repository and build the project:
git clone https://github.com/thomasfaingnaert/scriptable-guitar-pedal
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE="../scriptable-guitar-pedal/cmake/Toolchain.cmake" ../scriptable-guitar-pedal
makeThese instructions are for the Beaglebone image Debian 9.3 2018-03-05 4GB SD IoT. They may or may not work for you if you use a different one.
- Make sure you can access the internet on the BeagleBone Black.
This can be done by configuring your internet adapter on your PC to share its connection with the Beaglebone.
Create a script
internet.shwith the following contents:
#!/usr/bin/env bash
route add default gw 192.168.7.1
echo "nameserver 8.8.8.8" >> /etc/resolv.confFinally, run the script with sudo:
chmod +x ./internet.sh
sudo ./internet.sh- Update all packages:
sudo apt update
sudo apt upgrade- Delete RoboticsCape, as it blacklists the
uio_prussmodule
sudo apt purge roboticscape- Apply the Xenomai patches to the kernel using:
cd /opt/scripts/tools/
git pull
sudo ./update_kernel.sh --ti-xenomai-kernel --lts-4_9
sudo rebootFinally, you can check if you are running the right kernel using:
uname -aThis should output something similar to Linux beaglebone 4.9.88-ti-xenomai-r107 #1 SMP PREEMPT Sat Mar 24 09:29:27 UTC 2018 armv7l GNU/Linux.
- Next, we need to install our custom overlay:
cd device-tree/
make
sudo make install- Enable it by copying
uEnv-pru.txtto theboot/folder:
cd boot/
sudo cp uEnv-pru.txt /boot/uEnv.txt- The UIO driver should now be loaded. You can verify this by running:
lsmod | grep uio
ls /dev/uio*- If you want to assemble PRU Assembly files on your PC, you should install the PRU assembler from https://github.com/beagleboard/am335x_pru_package.
Otherwise, you could copy the
*.pfiles to the BBB using SCP and assemble them there. To assemble a filetest.p, you can use:
pasm -b test.p- Install the RTDM kernel module from https://github.com/thomasfaingnaert/rtdm_pruss_irq:
wget https://github.com/thomasfaingnaert/rtdm_pruss_irq/releases/download/v1.0/rtdm_pruss_irq.ko
sudo cp rtdm_pruss_irq.ko /lib/modules/`uname -r`/extra
sudo depmod -a
sudo modprobe rtdm_pruss_irq- Run the PRU loader to execute the PRU code:
./scriptable-guitar-pedal test.binThese instructions are for Fedora based distributions. Change the commands according to the distribution you are using.
- Clone the official BeagleBoard and BeagleBone kernel repository and checkout the version the BeagleBone is running:
git clone https://github.com/beagleboard/linux
cd linux
git checkout 4.9.82-ti-r102- Make sure you have no stale .o files and dependencies lying around:
make mrproper- Modularize the ASoC codec driver:
mkdir ../build
make O=../build ARCH=arm bb.org_defconfig
make O=../build ARCH=arm menuconfigNavigate to Device Drivers/Sound Card Support/Advanced Linux Sound Architecture/ALSA for SoC audio support/CODEC drivers
and modularize Cirrus Logic CS4271 CODEC (I2C).
- Compile the kernel:
make O=../build ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-- Copy the modules on your to the BeagleBone Black:
scp ../build/sound/soc/codecs/snd-soc-cs4271-i2c.ko ../build/sound/soc/codecs/snd-soc-cs4271.ko [email protected]:~- Install the modules on the BeagleBone Black:
ssh [email protected]
sudo mv snd-soc-cs4271-i2c.ko snd-soc-cs4271.ko /lib/modules/4.9.82-ti-r102/extra/
sudo depmod -aTo transfer the executable to your BeagleBone Black, you can use SSH, e.g. using PSCP (PuTTY Secure Copy) on Windows or SCP (Secure Copy) on GNU/Linux:
- Copy the executable on your computer to the BeagleBone Black:
pscp scriptable-guitar-pedal debian@192.168.7.2:/home/debian/scriptable-guitar-pedalIf you are using scp, change pscp to scp.
Also make sure to change the username (debian), destination path (/home/debian/scriptable-guitar-pedal) and IP address (192.168.7.2) if required.
- Log in to the BeagleBone Black using SSH, and run the application:
chmod +x ./scriptable-guitar-pedal
./scriptable-guitar-pedalThe repository already includes a version of Ne10 in include/ne10 and lib/libNE10.a.
If you want to use a custom Ne10 installation, you have to set the CMake variables NE10_INCLUDE_DIRS and NE10_LIBRARIES to point to the Ne10 include directory and library file, respectively.
An example when cross compiling on Windows:
cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE="../scriptable-guitar-pedal/cmake/Toolchain.cmake" -DNE10_INCLUDE_DIRS="/path/to/ne10/inc" -DNE10_LIBRARIES="/path/to/ne10/build/modules/libNE10.a" ../scriptable-guitar-pedal