-
Notifications
You must be signed in to change notification settings - Fork 11
PRU Information
Jeff Schornick edited this page Feb 6, 2014
·
20 revisions
Steps to get up and running
- Start with RCN latest flasher image (www.rcn-ee.net)
- PRU Package that needs to be installed: https://github.com/beagleboard/am335x_pru_package
- Install device Tree compiler (DTC) from
- patch for DTC compiler "for -@ symbol"
$ git clone git://www.jdl.com/software/dtc.git
$ cd dtc
$ git checkout 27cdc1b16f86f970c3c049795d4e71ad531cca3d
$ wget https://github.com/beagleboard/meta-beagleboard/raw/master/common-bsp/recipes-kernel/dtc/dtc/0001-dtc-Dynamic-symbols-fixup-support.patch
$ patch -p1 < 0001-dtc-Dynamic-symbols-fixup-support.patch
$ make
- DTC used to
- modify device tree overlay
- Fragment for one ultrasonic : https://github.com/Teknoman117/beaglebot/blob/master/hcsr04-demo/hcsr04_demo.dts
- Need to modify for 4 sensors and specific pins
- the pins selected are the guaranteed realtime access pins
- device tree overlay must be referenced by main device tree file (dts -> dtb)
- /boot/uboot/dtbs/am335x-boneblack.dts
- decompile am335x-boneblack.dtb to produce editable dts
- reference that added take from element14 example
- compiled fragment ends /lib/firmware
- fragment gets loaded by "echo (fragment_name) > $SLOTS"
/*
* pru dts file BB-BONE-PRU-00A0.dts
*/
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "PRU_US";
version = "00A0";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
mygpio: pinmux_mygpio{
pinctrl-single,pins = <
0x834 0x06 /* P8_11 out, MODE6 trigger */
/* 0x830 0x06 P8_12 out, MODE6 trigger */
0x83C 0x36 /* P8_15 in, MODE6, pullup echo */
/* 0x838 0x36 P8_16 in, MODE6, pullup echo */
/* 0x99C 0x05 P9_28 out, MODE5 trigger */
/* 0x994 0x05 P9_29 out, MODE5 trigger */
/* 0x998 0x36 P9_30 in, MODE6, pullup echo */
/* 0x990 0x36 P9_31 in, MODE6,pullup echo */
>;
};
};
};
fragment@1 {
target = <&ocp>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&mygpio>;
status = "okay";
};
};
};
fragment@2{
target = <&pruss>;
__overlay__ {
status = "okay";
};
};
};
Code for PRUs
-
PRU code (one sensor): https://github.com/Teknoman117/beaglebot/blob/master/hcsr04-demo/hcsr04_demo.p
- Needs to be assembled into a *.bin file using "pasm" program (look in makefile)
- see AM335x PRU reference guide starting at page 36
-
*.c file
- uses prussdrv libraries
- initializes PRU, prepares to receive a program
- loads bin file using prussdrv_exec_program
- docs for PRU functions in ???
- python wrapper may exist
-
Consult BeagleBone Black Pin Assignments in drive, Sheet 5 for pinmux
-
sub-centimeter should be possible
Best starting point for PRU examples: http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/05/22/bbb--working-with-the-pru-icssprussv2
Ultrasonic Demo https://github.com/PaladinEng/beaglebot/tree/master/hcsr04-demo
Setting up PRU on BBB
* [Working with the PRU-ICSS/PRUSSv2](http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/05/22/bbb--working-with-the-pru-icssprussv2)
PRU Instruction set Wiki
AM335x PRU-ICSS Reference Guide Download
Some Examples of Others Using PRUs
* [Imaging with a PRU connected Camera](http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/08/18/bbb--imaging-with-a-pru-connected-camera)