element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog BBB - Getting ACE working
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 16 Jun 2013 6:25 PM Date Created
  • Views 647 views
  • Likes 1 like
  • Comments 2 comments
  • beaglebone_black
  • bbb
  • bb_black
  • beagle_bone_black
Related
Recommended

BBB - Getting ACE working

shabaz
shabaz
16 Jun 2013

Introduction

The Beaglebone Black PRU cores are great for high speed operations. The AM3359 chip on the BBB contains an ARM core and two PRU cores amongst other modules. They run as independent CPUs at 200MHz, freeing up the ARM core for continuing to run Linux applications. It is quite amazing to have three processors in a single chip that are fairly easy to use. This post is about a library called ACE that could be useful for any method we create to communicate to the PRU cores easily, hopefully to accelerate PRU adoption and make code easier to understand. Hopefully we can come up with good protocols for communication with the PRU cores.

image

Improving communications with the PRU

Some method is required for transferring binary code to be run on the PRU, and for communication between PRU and ARM while the binary code is run. The TI example software makes use of shared memory communications. Some method or protocol is still required to make this simple and safe to use, and to allow multiple processes to communicate with the PRU if desired. Not everyone will want to know about memory locations just to push a command to software running on the PRU.

An example approach

For example, one approach would be to have some code on the ARM that sleeps until a command is received from some Linux app. It would interpret the command and then send some data (via shared memory for example) that the PRU could use. The PRU would be sitting in a loop waiting for the data. The PRU would read the data, and execute some task (such as read from an ADC) and then send a response back. Meanwhile, the Linux app would continue to run at full speed. Once the PRU completes, the response would be sent to the original application that had issued the command.

ACE

One proposed approach is to make use of ACE available from here. It is considered to be reliable. (There may be other software that is also suitable). It would allow a higher level interface to be created to talk with the PRUs from Linux hosted applications.

This post investigates if ACE can run on the BBB, to encourage protocols to be devised later, for the communication to the Linux process and then a lower layer for communication down to the PRU (maybe people know of some existing methods that could be reused). The latter protocol needs to be lightweight and easy for the PRU to understand, maybe just tag/length/value encoded for example.

image

Compiling ACE

On the BBB, create a folder to do the development work in, e.g. off your home directory, something like /home/root/develop and create a folder called ace, i.e. so the path is /home/root/develop/ace

Download ACE - the required version is ACE-6.2.0.tar.bz2 and place it in that folder.

bunzip2 ACE-6.2.0.tar.bz2

tar xvf ACE-6.2.0.tar

 

The tar command will result in a folder called ACE_wrappers being created.

cd ACE_wrappers

ACE_ROOT=/home/root/develop/ace/ACE_wrappers

export ACE_ROOT

cd ace

 

(the path is now /home/root/develop/ace/ACE_wrappers/ace)

cp config-linux.h config-bbb-linux.h

 

Create a new file:

vi config.h

 

in this new blank file, add this line:

#include "ace/config-bbb-linux.h"

 

Save and exit.

cd ../include/makeinclude/

cp platform_linux.GNU platform_bbb_linux.GNU

 

Edit the platform_bbb_linux.GNU file, and insert after the comments at the top, this line:

static_libs_only ?= 1

 

Save and exit.

Then, create this new file:

vi platform_macros.GNU

 

in this new file, add a line (note there is no hash):

include $(ACE_ROOT)/include/makeinclude/platform_bbb_linux.GNU

 

Save and exit.

LD_LIBRARY_PATH=/home/root/develop/ace/ACE_wrappers/lib:/usr/lib:/lib

export LD_LIBRARY_PATH

cd $ACE_ROOT

 

(the path is now /home/root/develop/ace/ACE_wrappers )

cd ace

make

 

This will take a while to compile (about 20 minutes).

Now that the ACE library is compiled, create a folder and subfolders where you want to store everything, if you don't want to copy to /usr immediately, or if you wish to save the compiled stuff for transferring to other BBBs.

For example:

mkdir /home/root/develop/ace/built

cd /home/root/develop/ace/built

mkdir include

mkdir bin

mkdir lib

mkdir share

 

Then, type these commands to install in the created folders:

INSTALL_PREFIX=/home/root/develop/ace/built

export INSTALL_PREFIX

cd $ACE_ROOT

cd ace

make install

 

 

To now install in the usual folders:

INSTALL_PREFIX=/usr

export INSTALL_PREFIX

cd $ACE_ROOT

cd ace

make install

 

Quick ACE test

To test out ACE, make an example application (this one was selected at random):

cd $ACE_ROOT

cd examples/Logger

make

 

Then, in one window, execute

cd /home/root/develop/ace/ACE_wrappers/examples/Logger

./simple-server/server_loggerd

(7136|3070193664) starting up server logging daemon

 

 

And in another window,

cd /home/root/develop/ace/ACE_wrappers/examples/Logger

./client/logging_app

 

You should see this at the server:


(7136|3070193664) connected with localhost.localdomain

message = 1

message = 2

message = 3

message = 4

message = 5

message = 6

message = 7

message = 8

message = 9

message = 10

server logging daemon closing down

 

The built libraries are attached.


Attachments:
built.tar.gz
  • Sign in to reply
  • shabaz
    shabaz over 12 years ago in reply to morgaine

    Thanks for the information! Just been reading the wikipedia pages on these languages. Very interesting.

    I suppose, for new apps (which those using the PRU are likely to be), it would make

    more sense to use a more modern language with built-in concurrency support rather than C++.

     

    Is there some existing repository to store built tools/compilers/libraries/etc, to save people having

    to recompile them from scratch, that people could either download and copy across manually, or (say) use with

    opkg?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • morgaine
    morgaine over 12 years ago

    I think I'd probably veer towards using a proper concurrent language for the host side of the PRU communications interface, such as Erlang or Google Go.  In both cases the design patterns for concurrent communication are well honed and exceedingly powerful as a result of being an integral part of the language, rather than a framework layered on top of a non-concurrent language.

     

    I like both Erlang and Go, but I've not installed either of them on ARM yet.  It's on my TO-DO list.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube