Permalink
Browse files

o Make PRU package sub-module

  • Loading branch information...
hzeller committed Mar 29, 2015
1 parent d39ecef commit fbdc4be22056cb10540e6c46fea9aadb4f4491a7
Showing with 29 additions and 25 deletions.
  1. +3 −0 .gitmodules
  2. +11 −7 Makefile
  3. +14 −18 README.md
  4. +1 −0 am335x_pru_package
@@ -0,0 +1,3 @@
[submodule "am335x_pru_package"]
path = am335x_pru_package
url = https://github.com/hzeller/am335x_pru_package.git
@@ -9,14 +9,15 @@
# and set the prefix
#CROSS_COMPILE?=arm-arago-linux-gnueabi-
# Tuning options for ARM CPU.
ARM_OPTIONS?=-mtune=cortex-a8 -march=armv7-a
# Tuning options for ARM CPU. Unset this in an environment variable if compiled on
# a different system.
ARM_COMPILE_FLAGS?=-mtune=cortex-a8 -march=armv7-a
# Location of am335x package https://github.com/beagleboard/am335x_pru_package
AM335_BASE=../am335x_pru_package/pru_sw
PASM=$(AM335_BASE)/utils/pasm
LIBDIR_APP_LOADER?=$(AM335_BASE)/app_loader/lib
INCDIR_APP_LOADER?=$(AM335_BASE)/app_loader/include
AM335_BASE=am335x_pru_package
PASM=$(AM335_BASE)/pru_sw/utils/pasm
LIBDIR_APP_LOADER?=$(AM335_BASE)/pru_sw/app_loader/lib
INCDIR_APP_LOADER?=$(AM335_BASE)/pru_sw/app_loader/include
CFLAGS+= -Wall -I$(INCDIR_APP_LOADER) -std=c99 -D_XOPEN_SOURCE=500 -O3 $(ARM_OPTIONS)
LDFLAGS+=-lpthread -lm
@@ -44,9 +45,12 @@ BeagleG-00A0.dtbo: BeagleG.dts
%.o: %.c
$(CROSS_COMPILE)gcc $(CFLAGS) -c -o $@ $<
%_bin.h : %.p
%_bin.h : %.p $(PASM)
$(PASM) -V3 -c $<
$(PASM):
make -C $(AM335_BASE)
pru-motion-queue.o : motor-interface-constants.h $(PRU_BIN)
motor-operations.o : motor-interface-constants.h
sim-firmware.o : motor-interface-constants.h
@@ -67,29 +67,25 @@ The interfaces are typically C-structs with function pointers which allows for
easy testing or simple translation into languages such as Go or C++.
## Build
The Makefile is assuming that you build this either on the Beaglebone Black
directly, or using a cross compiler (see Makefile).
To build, we need the BeagleG code and the PRU assembler with supporting library.
The BeagleG repository is set up in a way that the PRU assembler is checked out via
a sub-module to make these things simple.
You need to have checked out https://github.com/beagleboard/am335x_pru_package
which provides the pasm PRU assembler and the library to push this code to the
PRU.
Clone the BeagleG repository with the `--recursive` flag to get this sub-module
# Check out and build am335 package
git clone https://github.com/beagleboard/am335x_pru_package.git
cd am335x_pru_package/
cd pru_sw/utils/pasm_source ; ./linuxbuild ; cd -
CROSS_COMPILE="" make -C pru_sw/app_loader/interface/
cd ..
# Check out BeagleG and build
git clone https://github.com/hzeller/beagleg.git
cd beagleg
make
git clone --recursive https://github.com/hzeller/beagleg.git
(If you are a github user, you might want to use the git protocol).
If you run into compile problems, make sure to have both, am335x_pru_package and
beagleg up-to-date from git.
Then just
cd beagleg
make
If you are looking at the code and developing on a non-Beaglebone machine, pass an empty
`ARM_COMPILE_FLAGS` environment variable:
ARM_COMPILE_FLAGS="" make
## Getting started
Before you can use beagleg and get meaningful outputs on the GPIO pins,
Submodule am335x_pru_package added at 87f7a1

0 comments on commit fbdc4be

Please sign in to comment.