ardupilot/Tools/Linux_HAL_Essentials
Lucas De Marchi 8cec2c188f Tools: add O_CLOEXEC in places missing it
By opening with O_CLOEXEC we make sure we don't leak the file descriptor
when we are exec'ing or calling out subprograms. Right now we currently
don't do it so there's no harm, but it's good practice in Linux to have
it.
2016-11-07 12:37:30 -03:00
..
RCInput_UART Tools: Fix typos 2016-05-13 19:20:07 -03:00
devicetree Linux_HAL_Essentials: Add support for HC-SR04 Range Finder 2015-07-07 08:00:32 +10:00
pru Tools: add O_CLOEXEC in places missing it 2016-11-07 12:37:30 -03:00
README.md Linux_HAL_Essentials: Update README.md 2015-10-08 15:24:14 +09:00
pwmpru1 HAL_Linux: pwmpru,HAL_Linux_RCOut code doesn't wait for magic flag to send data 2014-07-14 09:44:37 +10:00
rcinpru0 Linux_HAL_Essentials: rebuilt rcinpru0 with 300 ring buffer entries 2014-10-07 14:57:35 +11:00
startup.sh Linux_HAL_Essentials: Move PFX DT files to devicetree/pxf 2015-03-17 08:20:51 +11:00

README.md

PRU PWM

###Updating kernel

  • Check your kernel version using uname -r
  • If you get 3.8.13bone56+ as output then you may skip Updating kernel.
  • For other kernel versions write following cmds in your BBB:
wget https://rcn-ee.net/deb/wheezy-armhf/v3.8.13-bone57/install-me.sh
chmod +x install-me.sh
./install-me.sh
  • After above steps reboot and check your kernel version using uname -r,it should be 3.8.13bone57

NOTE: For Ubuntu different scripts shall be used. E.g., for precise: - http://rcn-ee.net/deb/precise-armhf/v3.8.13-bone57/install-me.sh


###Setting Up PRU Compiler You should first check if there is the PRU Compiler available in your Linux-Distribution.

  • apt-get update
  • sudo apt-get install ti-pru-cgt-installer

If it is not available in your Linux-Distribution you have to download it from the TI website.

echo export PATH=/path/to/pru/compiler/bin:$PATH >> ~/.bashrc
echo export PRU_C_DIR="/path/to/pru/compiler/include;/path/to/pru/compiler/lib" >> ~/.bashrc
source ~/.bashrc

note: semicolons in second command were intended

###Compiling and loading the code

  • just make
  • copy generated executable pwmpru1 to ardupilot/Tools/Linux_HAL_Essentials/.
  • To load firmware use
    • ./startup.sh load : only once after reboot it will copy overlays and firmware to /lib/firmware/ and loads them.
    • ./startup.sh reload : it only copies firmware to /lib/firmware/ and reloads pru firmware.
  • Enable loading cape during BBB startup (no need to follow above step if you do this step once):
    • cp BB-PXF-01-00A0.dtbo /lib/firmware
    • add cape_enable=capemgr.enable_partno=BB-PXF-01 to /boot/uboot/uEnv.txt
    • add CAPE=BB-PXF-01 to /etc/default/capemgr