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

"Bus Error" - FYI #4

Closed maggiewhite closed 9 years ago

maggiewhite commented 10 years ago

Using kernel ('uname -r'):

Linux beaglebone 3.8.13 #1 SMP Tue Jun 18 02:11:09 EDT 2013 armv7l GNU/Linux

Output from capemanager:

root@beaglebone:~/beagleg.new# cat $SLOTS
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-PRU-01
 8: ff:P-O-L Override Board Name,00A0,Override Manuf,BeagleG

This is what I was getting before I fixed the problem (I added printf's based on the comments above blocks of code):

root@beaglebone:~/beagleg.new# ./machine-control -P casing_export.gcode
initilaize basic state and derived configuration
Always keep the steps_per_mm
Here we assign it to the 'const'
Mapping axes to physical motors
Now let's see what motors
-- Config --
X axis: 200.0mm/s,  4000.0mm/s^2, 160.000 steps/mm
Y axis: 200.0mm/s,  4000.0mm/s^2, 160.000 steps/mm
Z axis:  90.0mm/s,  1000.0mm/s^2, 160.000 steps/mm
E axis:  10.0mm/s, 10000.0mm/s^2,  40.000 steps/mm
A axis:   1.0mm/s,     1.0mm/s^2,   1.000 steps/mm
The parser keeps
geteuid
beagleg_init
map_gpio
Prepare all the pins
Bus error

The code was erroring out here:

gpio_0[GPIO_OE/4] = ~(MOTOR_OUT_BUTS | (1 << AUX_1_BIT) | (1 << AUX_2_BIT));

Per this discussion: https://groups.google.com/forum/#!topic/beagleboard/OYFp4EXawiI It turns out the clocks for GPIO0 and GPIO1 are not necessarily initialized when you put an override cape on. The solution to this is manually activating at least one GPIO pin from GPIO0 and 1:

# echo 5 > /sys/class/gpio/export
# echo 65 > /sys/class/gpio/export
# echo 105 > /sys/class/gpio/export

At that point, I got normal output:

root@beaglebone:~/beagleg.new# ./machine-control -P casing_export.gcode
initilaize basic state and derived configuration
Always keep the steps_per_mm
Here we assign it to the 'const'
Mapping axes to physical motors
Now let's see what motors
-- Config --
X axis: 200.0mm/s,  4000.0mm/s^2, 160.000 steps/mm
Y axis: 200.0mm/s,  4000.0mm/s^2, 160.000 steps/mm
Z axis:  90.0mm/s,  1000.0mm/s^2, 160.000 steps/mm
E axis:  10.0mm/s, 10000.0mm/s^2,  40.000 steps/mm
A axis:   1.0mm/s,     1.0mm/s^2,   1.000 steps/mm
The parser keeps
geteuid
beagleg_init
map_gpio
Prepare all the pins
Prepare all the pins2
Prepare all the pins2
Prepare all the pins3
Get the interrupt
prussdrv_pru_write_memory
beagleg_init finished
hzeller commented 10 years ago

Thanks Maggie! I try to see if this is something I can integrate in the device overlay file, maybe I am misisng something there. (without having to manually export things).

hzeller commented 9 years ago

This has been fixed in cb44a194548a217b1c5a1fc6780fadffd8c1841e This switches on the clocks for the GPIO pins programmatically.