hzeller / beagleg

G-code interpreter and stepmotor controller for crazy fast coordinated moves of up to 8 steppers. Uses the Programmable Realtime Unit (PRU) of the Beaglebone.
http://beagleg.org/
GNU General Public License v3.0
122 stars 50 forks source link

Attempting to build the pasm PRU assembler #2

Closed MantisClone closed 10 years ago

MantisClone commented 10 years ago

There's an additional question at the bottom too. I'm having trouble with your list of instructions (numbered for reference):

1 git clone git@github.com:beagleboard/am335x_pru_package.git 2 cd am335x_pru_package/ 3 cd pru_sw/utils/pasm_source ; ./linuxbuild ; cd - 4 make -C pru_sw/app_loader/interface/ 5 cd ..

on line 4, my BBB gives me this error:

root@beaglebone:~/Desktop/am335x_pru_package# make -C pru_sw/app_loader/interface/
make: Entering directory `/home/root/Desktop/am335x_pru_package/pru_sw/app_loader/interface'
arm-arago-linux-gnueabi-gcc -I. -Wall -I../include   -c -g -O0 -D__DEBUG -o debug/prussdrv.o prussdrv.c
make: arm-arago-linux-gnueabi-gcc: Command not found
make: *** [debug/prussdrv.o] Error 127
make: Leaving directory `/home/root/Desktop/am335x_pru_package/pru_sw/app_loader/interface'
root@beaglebone:~/Desktop/am335x_pru_package#

My full kernel version is (because I realized there was a -a flag I could use), it's the one that the board arrived with:

root@beaglebone:~/Desktop/am335x_pru_package# uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux

Additional Question: So the README description talks of the "host pc." does that mean that the majority of this code is running on the host pc? or on the BBB processor itself? I know the .p file probably runs on the PRU, and that the g-code files come from the host pc, but I'm less sure where everything else is running.

And apologies if any of my questions seem tedious or simple. I'm new to linux and only slightly knowledgeable of C and assembly programming. I'm excited to see if I can get your code to work with my project though.

hzeller commented 10 years ago

1) the arm-arago-linux-gnueabi-gcc comes from a CROSS_COMPILE variable that the Makefile sets in the am335x_pru_package. I have now updated the README to explicitly set this variable to an empty string to compile, so this should work now. CROSS_COMPILE="" make -C pru_sw/app_loader/interface

1.5) While looking at it, it seems the package changed a bit and some function got an additional parameter. Made that compile.

2) the 'host CPU' is the BeagleBone itself ('host' to disambiguate it from the PRU (programmable realtime unit) CPU). So you don't need another PC to run stuff, it is all on the BeagleBone: it reads the g-code file (from a file or via a network socket), parses it, and makes the PRU generate the steps. I've re-worked the description in the readme by explicitly naming the host-CPU to be the BeagleBone. Hope this is a bit clearer now.

Beware that there are some smallish limitations that I hope to work on the next weekends, so it is not a 'complete' solution yet for machines to operate, see TODO at the end of the README.

MantisClone commented 10 years ago

Thank you very much! The CROSS_COMPILE addition to your script seemed to work. The PRU assembler seemed to compile without error, and the rest of your code built successfully. And I'm not worried about the limitations at the moment. I'll need to adapt your code a little bit to fit my project in the end either way. Right now I'm just trying to learn and gain a better understanding of how it all works.

Regards,