Difference between revisions of "EBC Exercise 30 PRU via remoteproc and RPMsg"

From eLinux.org
Jump to: navigation, search
m (Yoder moved page EBC Exercise 30 PRU to EBC Exercise 30 PRU via remoteproc and RPMsg: Makes clear how the PRUs are accessed)
m (Adding files to install)
Line 43: Line 43:
 
in your '''.bashrc''' file so it's set every time you login.  The other commands only need to be run once.
 
in your '''.bashrc''' file so it's set every time you login.  The other commands only need to be run once.
  
 +
== Installing Examples ==
 +
I've found some examples that are a good starting point. 
 +
 +
=== TI's examples ===
 +
The examples from TI's site
 +
[git://git.ti.com/pru-software-support-package/pru-software-support-package.git]
 +
are already on the bone, but let's make them easier to find.
 +
 +
bone$ '''mkdir pru'''
 +
bone$ '''cd pru'''
 +
bone$ '''ln -s /opt/source/pru-software-support-package .'''
 +
bone$ '''cd pru-software-support-package'''
 +
The first lines makes a directory for keeping all your PRU file and the last commands link to the already loaded files and
 +
changes to the directory. Look around and see what's there.  Be sure to checkout the ReadMe.txt file.
  
== Installing Examples ==
+
bone$ '''cat ReadMe.txt'''
I've found some examples that are a good starting point.
+
<code>
 +
Programmable Real-time Unit (PRU) Software Support Package release 5.0
 +
 +
DESCRIPTION
 +
 +
  The PRU Software Support Package is an add-on package that provides a framework
 +
  and examples for developing software for the Programmable Real-time Unit
 +
  sub-system and Industrial Communication Sub-System (PRU-ICSS) in the supported
 +
  TI processors.  The PRU-ICSS achieves deterministic, real-time processing, direct
 +
  access to I/Os and meets ultra-low-latency requirements.
 +
 +
  This software package contains example PRU firmware code as well as application
 +
  loader code for the host OS. The examples demonstrate the PRU capabilities to
 +
  interact with and control the system and its resources.
 +
 +
  For more details about the PRU, visit
 +
     
 +
        http://processors.wiki.ti.com/index.php/PRU-ICSS
 +
 +
WHAT's INCLUDED?
 +
 +
  This package includes the following resources:
 +
 +
DIRECTORY CONTENTS
 +
--------- --------
 +
examples Basic PRU examples
 +
include PRU firmware header files
 +
labs Source code for step-by-step labs
 +
lib PRU library files and library source files
 +
pru_cape Demo software for the BeagleBone PRU Cape
 +
 +
ADDITIONAL RESOURCES
 +
 +
  For more information about the PRU, visit:
 +
 +
PRU-ICSS Wiki � http://processors.wiki.ti.com/index.php/PRU-ICSS
 +
PRU Training Slides � http://www.ti.com/sitarabootcamp
 +
PRU Evaluation Hardware � http://www.ti.com/tool/PRUCAPE
 +
Support � http://e2e.ti.com
 +
</code>
 +
 
 +
=== BeagleScope ===
 +
 
 +
ZeekHuge has [https://github.com/ZeekHuge/BeagleScope Google Summer of Code (GSoC) 2016 project] called BeagleScope
 +
that has some very nice working examples.  We'll look at these in more detail. Clone a copy of your own.
 +
 
 +
bone$ '''cd pru'''
 +
bone$ '''git clone https://github.com/ZeekHuge/BeagleScope.git'''
  
 
Follow these [http://beagleboard.org/Getting%20Started#update instructions]  
 
Follow these [http://beagleboard.org/Getting%20Started#update instructions]  

Revision as of 08:58, 11 July 2016

thumb‎ Embedded Linux Class by Mark A. Yoder


Here's how to setup a Bone to play with the PRUs. I'm running with

bone$ uname -a

Disable the HDMI

The PRUs have direct access to many pins that are also used by the HDMI. Check to see if the HDMI has been disabled.

bone$ config-pin -q P8_45
P8_45 pinmux file not found!
cape-universala overlay not found
run "config-pin overlay cape-universala" to load the cape

If you get the message above, you need to disable your HDMI. Do it by editing /boot/uEnv.txt and uncommenting the following by removing the # in front of the dtb line:

##BeagleBone Black: HDMI (Audio/Video) disabled:
dtb=am335x-boneblack-emmc-overlay.dtb

Then reboot and try again.

bone$ config-pin -q P8_45
config-pin -q P8_45
P8_45 Mode: default Direction: in Value: 0

Good the HDMI is now disabled. Later we'll use config-pin to set pins to the PRU.

Setting up the PRU compiler

The PRU compiler should already be installed.

bone$ which clpru
/usr/bin/clpru

If not, you'll have to search around to learn how to install it. (Beyond the scope of this page.)

However some setup must be done so it can find all the libraries it needs.

bone$ export PRU_CGT=/usr/share/ti/cgt-pru
bone$ cd $PRU_CGT
bone$ mkdir bin
bone$ cd bin
bone$ ln -s `which clpru`  .
bone$ ln -s `which lnkpru` .

The variable PRU_CGT is used by the Makefiles and scripts to know which compiler to run. I suggest you put export PRU_CGT=/usr/share/ti/cgt-pru in your .bashrc file so it's set every time you login. The other commands only need to be run once.

Installing Examples

I've found some examples that are a good starting point.

TI's examples

The examples from TI's site [1] are already on the bone, but let's make them easier to find.

bone$ mkdir pru
bone$ cd pru
bone$ ln -s /opt/source/pru-software-support-package .
bone$ cd pru-software-support-package

The first lines makes a directory for keeping all your PRU file and the last commands link to the already loaded files and changes to the directory. Look around and see what's there. Be sure to checkout the ReadMe.txt file.

bone$ cat ReadMe.txt

Programmable Real-time Unit (PRU) Software Support Package release 5.0

DESCRIPTION

  The PRU Software Support Package is an add-on package that provides a framework 
  and examples for developing software for the Programmable Real-time Unit 
  sub-system and Industrial Communication Sub-System (PRU-ICSS) in the supported 
  TI processors.  The PRU-ICSS achieves deterministic, real-time processing, direct 
  access to I/Os and meets ultra-low-latency requirements. 

  This software package contains example PRU firmware code as well as application 
  loader code for the host OS. The examples demonstrate the PRU capabilities to 
  interact with and control the system and its resources.

  For more details about the PRU, visit 
      
       http://processors.wiki.ti.com/index.php/PRU-ICSS

WHAT's INCLUDED?

  This package includes the following resources:

DIRECTORY CONTENTS --------- -------- examples Basic PRU examples include PRU firmware header files labs Source code for step-by-step labs lib PRU library files and library source files pru_cape Demo software for the BeagleBone PRU Cape

ADDITIONAL RESOURCES

  For more information about the PRU, visit:

PRU-ICSS Wiki � http://processors.wiki.ti.com/index.php/PRU-ICSS PRU Training Slides � http://www.ti.com/sitarabootcamp PRU Evaluation Hardware � http://www.ti.com/tool/PRUCAPE Support � http://e2e.ti.com

BeagleScope

ZeekHuge has Google Summer of Code (GSoC) 2016 project called BeagleScope that has some very nice working examples. We'll look at these in more detail. Clone a copy of your own.

bone$ cd pru
bone$ git clone https://github.com/ZeekHuge/BeagleScope.git

Follow these instructions

host$ cd Downloads
host$ wget http://www.rose-hulman.edu/~yoder/Beagle/BeagleBone_Rev_A6A_Production_08_14_2012.7z
host$ wget http://www.rose-hulman.edu/~yoder/Beagle/BeagleBone_Rev_A6A_Production_08_14_2012.md5


  1. Download and install Ubuntu's Win32DiskImager (also known as the win32-image-writer).
  2. Download and install 7-zip compression software. (Or use winRAR)
  3. Decompress ETC2012.img.bz2 image file using 7-zip (or winRAR).
  4. Insert >=4GB SD card into the reader/writer.
  5. Start the Win32DiskImager.
  6. Select ETC2012.img and correct SD card location.
  7. Click on Write.

After the image writing is done (this will take some 10 minutes), eject the SD card.




thumb‎ Embedded Linux Class by Mark A. Yoder