Skip to content

Commit

Permalink
beaglebone: no more slots, add docs on configuring u-boot overlays
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Dec 19, 2017
1 parent b5e6f8e commit c25661a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
30 changes: 14 additions & 16 deletions platforms/beaglebone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ $ scp beaglebone_blink [email protected]:/home/debian/
$ ssh -t [email protected] "./beaglebone_blink"
```

In order to run the preceeding commands, you must be running the official Debian Linux through the usb->ethernet connection, or be connected to the board using WiFi. You must also setup the needed permissions to run as non-root user, as described below.
In order to run the preceeding commands, you must be running the official Debian Linux through the usb->ethernet connection, or be connected to the board using WiFi.

You must also configure hardware settings as described below.

### Updating your board to the latest OS

Expand All @@ -130,35 +132,31 @@ These instructions come from the Beagleboard web site's "Getting Started" page l

http://beagleboard.org/getting-started

### Running as Non-Root user
### Configure hardware settings

In order to enable the various hardware devices on your BeagleBone or PocketBeagle, you need to configure a special file named `/boot/uEnv.txt`.

In order to run as a non-root user, you will need to add a udev rule to your BeagleBone.
This file controls all of the different hardware options used at startup time, so you can enable or disable features based on your specific needs. You only need to do this once, and then the settings will apply each time you start up your BeagleBone.

First connect to the BeagleBone using ssh:

```
ssh [email protected]
```

Once you are connected to the BeagleBone, create the new udev rule file:
Once you are connected to the BeagleBone, edit the /boot/uEnv.txt file like this:

```
sudo nano /etc/udev/rules.d/75-bone_capemgr-noroot.rules
sudo nano /boot/uEnv.txt
```

Make sure the file contains the following rules text:
To enable GPIO, PWM, I2C, and SPI, modify the `##Example v4.1.x` section to add a line to enable the cape manager:

```
# Change group to gpio
SUBSYSTEM=="platform", PROGRAM="/bin/sh -c '/bin/chown -R root:gpio /sys/devices/platform/bone_capemgr'"
# Change user permissions to ensure user and group have read/write permissions
SUBSYSTEM=="platform", PROGRAM="/bin/sh -c '/bin/chmod -R ug+rw /sys/devices/platform/bone_capemgr'"
##Example v4.1.x
cape_enable=bone_capemgr.enable_partno=cape-universaln,BB-ADC,BB-SPIDEV0
```

Save the file, then either reboot your BeagleBone, or run the following command to reload your udev rules:

```
sudo udevadm control --reload-rules && sudo udevadm trigger
```
Save the file, then reboot your BeagleBone.

You will now be able to run your Gobot programs without using sudo.
You will now be able to run your Gobot programs to control the various hardware.
13 changes: 1 addition & 12 deletions platforms/beaglebone/beaglebone_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,7 @@ func (b *Adaptor) SetName(n string) { b.name = n }

// Connect initializes the pwm and analog dts.
func (b *Adaptor) Connect() error {
b.mutex.Lock()
defer b.mutex.Unlock()

// loads U-Boot Cape Universal
// https://github.com/cdsteinkuehler/beaglebone-universal-io
if err := ensureSlot(b.slots, "cape-universaln"); err != nil {
return err
}

// loads U-Boot ADC
err := ensureSlot(b.slots, "BB-ADC")
return err
return nil
}

// Finalize releases all i2c devices and exported analog, digital, pwm pins.
Expand Down

0 comments on commit c25661a

Please sign in to comment.