Giter Club home page Giter Club logo

nerves_system_bbb's Introduction

Generic BeagleBone Support

CircleCI Hex version

This is the base Nerves System configuration for the BeagleBone Black, BeagleBone Green, BeagleBone Green Wireless, and PocketBeagle.

BeagleBone Black image
Image credit

Feature Description
CPU 1 GHz ARM Cortex-A8
Memory 512 MB DRAM
Storage 4 GB eMMC Flash and MicroSD
Linux kernel 6.6 w/ "ti" patches
IEx terminal UART ttyS0
GPIO, I2C, SPI Yes - Elixir Circuits
ADC Yes
PWM Yes, but no Elixir support
UART ttyS0 + more via device tree overlay
Camera None
Ethernet Yes
WiFi Beaglebone Green Wireless (wl18xx driver). Other requires USB WiFi dongle/driver
HW Watchdog AM335x watchdog enabled on boot. Be sure to enable heart in your vm.args or the device will reboot

Using

The most common way of using this Nerves System is create a project with mix nerves.new and to export MIX_TARGET=bbb. See the Getting started guide for more information.

If you need custom modifications to this system for your device, clone this repository and update as described in Making custom systems.

Preparing your BeagleBone

If your BeagleBone has eMMC (the PocketBeagle doesn't), it will be configured to try the eMMC first when looking for software on boot. If you haven't reprogrammed it, it will boot to Debian even if a MicroSD card is inserted with good software. To boot from the MicroSD card, hold down the USER button and apply power.

When starting with Nerves, you will find that booting from a MicroSD card is convenient since you can easily recover from broken software images. Holding down the USER button will get old. To force the BeagleBone to boot from the MicroSD card, simply corrupt the image on the eMMC memory. Don't worry, the BeagleBone website has instructions for restoring Debian.

From Debian:

debian@beaglebone:~$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 5.72098 s, 18.3 MB/s
debian@beaglebone:~$ sudo reboot

When it reboots, it will boot from the MicroSD slot. If a MicroSD card hasn't been inserted or if there are errors reading it, you will see the letter C printed repeatedly on the console port.

Console access

The console is configured to output to the 6 pin header on the BeagleBone that's labeled J1. A 3.3V FTDI cable is needed to access the output.

The HDMI output has been disabled via device tree to free up pins on the GPIO header. If you would like console access via HDMI, you will need to enable HDMI support in the Linux kernel, remove the HDMI disable argument in the uboot script providing kernel arguments, and change erlinit.conf to output to tty1.

Provisioning devices

This system supports storing provisioning information in a small key-value store outside of any filesystem. Provisioning is an optional step and reasonable defaults are provided if this is missing.

Provisioning information can be queried using the Nerves.Runtime KV store's Nerves.Runtime.KV.get/1 function.

Keys used by this system are:

Key Example Value Description
nerves_serial_number "12345678" By default, this string is used to create unique hostnames and Erlang node names. If unset, it defaults to part of the BBB's serial number.

The normal procedure would be to set these keys once in manufacturing or before deployment and then leave them alone.

For example, to provision a serial number on a running device, run the following and reboot:

iex> cmd("fw_setenv nerves_serial_number 12345678")

This system supports setting the serial number offline. To do this, set the NERVES_SERIAL_NUMBER environment variable when burning the firmware. If you're programming MicroSD cards using fwup, the commandline is:

sudo NERVES_SERIAL_NUMBER=12345678 fwup path_to_firmware.fw

Serial numbers are stored on the MicroSD card so if the MicroSD card is replaced, the serial number will need to be reprogrammed. The numbers are stored in a U-boot environment block. This is a special region that is separate from the application partition so reformatting the application partition will not lose the serial number or any other data stored in this block.

Additional key value pairs can be provisioned by overriding the default provisioning.conf file location by setting the environment variable NERVES_PROVISIONING=/path/to/provisioning.conf. The default provisioning.conf will set the nerves_serial_number, if you override the location to this file, you will be responsible for setting this yourself.

Linux and U-Boot versions

The BeagleBone Black has many options for Linux that vary by kernel version and patch set. Nerves tracks those maintained by Robert Nelson at eewiki.net.

Nerves also integrates the BeagleBone Black's U-boot patches to support device tree overlays. Support mirrors the BeagleBone docs with the exception that to set U-boot environment variables, See the section below for more information.

Device tree overlays

Most pins on the BBB's headers are configurable via a mechanism called the device tree. The device tree is made up of device tree files and overlay files that get compiled down into one or more .dtb or .dtbo files. The files tell Linux what drivers to load and what parameters to use for things that it can't figure out by itself.

There are two strategies for dealing with the device tree:

  1. Modify the device tree files for an existing board to make your own
  2. Load device tree overlay files

Upstream BBB encourages the second option since it can be easier. The tradeoff is that if anything goes wrong or your hardware doesn't match their assumptions, it's a little harder to debug.

The device tree files are loaded by U-Boot. Nerves installs all of the Beagleboard overlay files to /lib/firmware and configures U-Boot to closely match upstream. This means that most of the upstream documentation on device tree is usable. The difference is that instead of using /boot/uEnv.txt to customize the overlays, you need to set the variables in the U-Boot environment block. This can be done by running cmd("fw_setenv <key> <value>") from the IEx prompt or by adding the variables to the fwup_include/provisioning.conf file.

For example, at the IEx prompt:

cmd("fw_setenv uboot_overlay_addr7 /lib/firmware/BB-UART1-00A0.dtbo")

Or by updating the configuration file:

uboot_setenv(uboot-env, "uboot_overlay_addr7", "/lib/firmware/BB-UART1-00A0.dtbo")

See elinux.org/Beagleboard:BeagleBoneBlack_Debian for documentation on the variables.

Universal I/O

The BBB's Universal device tree overlay lets you configure pins at runtime. This system enables the universal overlay by default. See the enable_uboot_cape_universal setting in the default fwup_include/provisioning.conf file.

See beaglebone-universal-io for documentation. You'll see references to an RCN-built kernel. RCN is the initials for Robert Nelson and we use his kernel patches.

ADCs

The following example shows how to read values from the 7 ADC inputs in Elixir. You will first need to load "BB-ADC" device tree overlay using the guide described above.

iex(nerves@nerves-0014.local)> ls "/sys/bus/iio/devices/iio:device0"
buffer              dev                 in_voltage0_raw     in_voltage1_raw
in_voltage2_raw     in_voltage3_raw     in_voltage4_raw     in_voltage5_raw
in_voltage6_raw     name                of_node             power
scan_elements       subsystem           uevent
iex(nerves@nerves-0014.local)> File.read("/sys/bus/iio/devices/iio:device0/in_voltage0_raw")
{:ok, "3891\n"}
iex(nerves@nerves-0014.local)> File.read("/sys/bus/iio/devices/iio:device0/in_voltage0_raw")
{:ok, "3890\n"}
iex(nerves@nerves-0014.local)> File.read("/sys/bus/iio/devices/iio:device0/in_voltage0_raw")
{:ok, "3891\n"}

SPI

The following examples shows how to get SPI0 functional in Elixir.

Load the "BB-SPIDEV0" device tree overlay using the guide described above.

Verify that the device drivers are loaded and read spi0 transfers:

iex(nerves@nerves-0014.local)> ls "/dev"
  ...
        spidev1.0              spidev1.1              spidev2.0              spidev2.1
  ...
iex(nerves@nerves-0014.local)> File.read "/sys/bus/spi/devices/spi1.0/statistics/transfers"
{:ok, "0"}

If you have included circuits_spi as a dependency, you can start it now and test a transfer:

The example below should work without any additional hardware connected to the BBB. If you have SPI hardware connected to the BBB, your returned binary might be different.

iex(nerves@nerves-0014.local)> {:ok, ref} = Circuits.SPI.open("spidev0.0")
{:ok, #Reference<...>}
iex(nerves@nerves-0014.local)> Circuits.SPI.transfer(ref, <<1,2,3,4>>)
<<255, 255, 255, 255>>

Note: If you get back all 0's, then you have likely have not configured the overlay pins correctly.

PRUS

The PRUs are controlled via uio. Two kernel modules are needed for them to work.

iex> :os.cmd('modprobe uio uio_pruss')
iex> ls "/sys/class/uio"
uio0     uio1     uio2     uio3     uio4     uio5     uio6     uio7

Check the beaglebone am335x_pru_package repository for samples on how to interface PRUs.

Supported USB WiFi devices

The base image includes drivers and firmware for the TI WiLink8 (wl18xx), Ralink RT53xx (rt2800usb driver) and RealTek RTL8712U (r8712u driver) devices. All WiFi drivers are compiled as modules. Some drivers can be loaded automatically. If you have a Beaglebone Green or Beaglebone Black with built-in WiFi, see the next section.

We are still working out which subset of all possible WiFi dongles to support in our images. At some point, we may have the option to support all dongles and selectively install modules at packaging time, but until then, these drivers and their associated firmware blobs add significantly to Nerves release images.

If you are unsure what driver your WiFi dongle requires, run Raspbian and configure WiFi for your device. At a shell prompt, run lsmod to see which drivers are loaded. Running dmesg may also give a clue. When using dmesg, reinsert the USB dongle to generate new log messages if you don't see them.

Bluetooth

The Beaglebone boards with built-in WiFi support use the WiLink8 WL1835 module. This is a combo WiFi/Bluetooth module. Bluetooth is not well supported in Nerves. However, Nerves is built on Linux so you can enable and use bluez. Another option is to use harald which can communicate with the module using low level Bluetooth HCI commands.

The WL1835 requires initialization before first use. This is done via a "BTS" file. The TIInit_11.8.32.bts file is included in this system under lib/firmware/ti-connectivity. The Bluetooth kernel modules know how to load it automatically. If you're using harald, you will need to load it yourself. The source of the "BTS" file is http://www.ti.com/tool/wl18xx-bt-sp.

Image credit: This image is from the Fritzing parts library.

NervesKey

Using NervesKey on an I2C bus requires the bus speed to be lowered. This can be done using uboot overlays specific to the I2C bus that NervesKey is attached to. The device tree blob can be found in /lib/firmware.

Choose one of the following:

uboot_setenv(uboot-env, "uboot_overlay_addr4", "/lib/firmware/i2c1-clock-frequency-100khz.dtbo")
uboot_setenv(uboot-env, "uboot_overlay_addr5", "/lib/firmware/i2c2-clock-frequency-100khz.dtbo")

You can configure your project to enable these device tree overlays by copying the fwup_include/provisioning.conf file to your project, updating the file to enable the uboot overlay for your NervesKey i2c bus, and by adding the following to your Mix Application configuration:

config :nerves, :firmware,
  provisioning: "project/relative/path/to/provisioning.conf"

nerves_system_bbb's People

Contributors

aadavids avatar amclain avatar cblock avatar connorrigby avatar diamondlovesyou avatar elcritch avatar fhunleth avatar gregmefford avatar insasec avatar jasonmj avatar jjcarstens avatar mattludwigs avatar mazubieta avatar mnishiguchi avatar mobileoverlord avatar smpallen99 avatar thomaschandler avatar tomielee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nerves_system_bbb's Issues

Firmware upgrades no longer seem to be working with v0.13.0

Since updating nerves_system_bbb to v0.13.0, I'm no longer able to do firmware upgrades.

From a fresh nerves project after mix deps.get/mix firmware/etc:

  1. Flash sd card with mix firmware.burn
    BBB boots off this card into nerves successfully.

  2. Update sd card with mix firmware.burn --task upgrade
    BBB doesn't boot, just outputs CCCCCCCC

Here's the mix.lock for the project:
mix.lock.bbb.txt

Question: Is this compatible with the BeagleBone Black Wireless?

I'm a complete newcomer to the embedded world but I have been for a while now considered ordering a BeagleBone Black Wireless to setup some personal elixir project on. Before I do that though I would like confirmation that this works with the BeagleBone Black Wireless (it's not listed in the compatible systems) and how do you actually setup the wireless connection? Do the same instructions apply as for the BeagleBone Green Wireless?

`config-pin` doesn't work anymore.

iex(hello_pru@nerves.local)36> :os.cmd('config-pin overlay cape-universaln')
'grep: /sys/devices/bone_capemgr.*/slots: No such file or directory\nLoading cape-universaln overlay\nsh: can\'t create /sys/devices/bone_capemgr.*/slots: nonexistent directory\nError loading device tree overlay file: cape-universaln\n'
iex(hello_pru@nerves.local)37> 

BB green wireless fails to boot into nerves

Hi!

My SeeedStudio BeagleBone green wireless fails to boot into nerves from sd card due to not finding a valid device tree. To me it looks as if the patch at nerves_system_bbb/uboot/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch sets fdtfile to am335x-bonegreen-wireless.dtb if it detects a bb green wireless. But fwup.conf is missing the corresponding file resource (a file resource for am335x-bonegreen.dtb is defined though in line 72).

So I guess that adding

file-resource am335x-bonegreen-wireless.dtb {
    host-path = "${NERVES_SYSTEM}/images/am335x-bonegreen-wireless.dtb"
}  

to fwup.conf might fix the problem. I'm not sure though if the file itself has to be added somewhere.

For your reference: This is the boot log of my bb green wireless:

U-Boot SPL 2016.03-00001-gd12d09f (Mar 17 2016 - 16:16:15)
Trying to boot from MMC
bad magic


U-Boot 2016.03-00001-gd12d09f (Mar 17 2016 - 16:16:15 -0500), Build: jenkins-github_Bootloader-Builder-351

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
2308 bytes read in 14 ms (160.2 KiB/s)
## Executing script at 80000000
Running Nerves U-Boot script
reading uEnv.txt
** Unable to read file uEnv.txt **
reading zImage
4350536 bytes read in 304 ms (13.6 MiB/s)
reading am335x-bonegreen-wireless.dtb
** Unable to read file am335x-bonegreen-wireless.dtb **
Kernel image @ 0x82000000 [ 0x000000 - 0x426248 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
Nerves boot failed!
SCRIPT FAILED: continuing...
Found U-Boot script /boot.scr
reading /boot.scr
2308 bytes read in 14 ms (160.2 KiB/s)
## Executing script at 80000000
Running Nerves U-Boot script
reading uEnv.txt
** Unable to read file uEnv.txt **
reading zImage
4350536 bytes read in 304 ms (13.6 MiB/s)
reading am335x-bonegreen-wireless.dtb
** Unable to read file am335x-bonegreen-wireless.dtb **
Kernel image @ 0x82000000 [ 0x000000 - 0x426248 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
Nerves boot failed!
SCRIPT FAILED: continuing...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
gpio: pin 55 (gpio 55) value is 1
reading boot.scr
2308 bytes read in 14 ms (160.2 KiB/s)
Loaded script from boot.scr
gpio: pin 56 (gpio 56) value is 1
Running bootscript from mmc0:1 ...
## Executing script at 82000000
Running Nerves U-Boot script
reading uEnv.txt
** Unable to read file uEnv.txt **
reading zImage
4350536 bytes read in 301 ms (13.8 MiB/s)
reading am335x-bonegreen-wireless.dtb
** Unable to read file am335x-bonegreen-wireless.dtb **
Kernel image @ 0x82000000 [ 0x000000 - 0x426248 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
Nerves boot failed!
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
** Invalid partition 4 **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
1185 bytes read in 15 ms (77.1 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.4.9-ti-r25 ...
7833256 bytes read in 444 ms (16.8 MiB/s)
loading /boot/dtbs/4.4.9-ti-r25/am335x-bonegreen-wireless.dtb ...
61860 bytes read in 46 ms (1.3 MiB/s)
loading /boot/initrd.img-4.4.9-ti-r25 ...
4777389 bytes read in 278 ms (16.4 MiB/s)
debug: [console=ttyO0,115200n8 quiet bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN root=UUID=532d64b4-5ee8-41ae-9a6e-f82b946e45ff ro rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable] ...
debug: [bootz 0x82000000 0x88080000:48e5ad 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x7786a8 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8fb71000, end 8ffff5ad ... OK
   Loading Device Tree to 8fb5e000, end 8fb701a3 ... OK

Starting kernel ...

[    2.007515] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    2.153808] omap_voltage_late_init: Voltage driver support not added
[    2.161220] PM: Cannot get wkup_m3_ipc handle
[    2.277580] bone_capemgr bone_capemgr: slot #0: No cape found
[    2.321586] bone_capemgr bone_capemgr: slot #1: No cape found
[    2.365648] bone_capemgr bone_capemgr: slot #2: No cape found
[    2.409581] bone_capemgr bone_capemgr: slot #3: No cape found
Loading, please wait...
BOOT: recovering journal
BOOT: clean, 111922/238560 files, 515269/954112 blocks
[   11.591514]  remoteproc1: failed to load am335x-pru0-fw
[   11.732150]  remoteproc1: request_firmware failed: -2
[   11.737385] pru-rproc 4a334000.pru0: rproc_boot failed
[   12.251248]  remoteproc1: failed to load am335x-pru1-fw
[   12.273925]  remoteproc1: request_firmware failed: -2
[   12.279097] pru-rproc 4a338000.pru1: rproc_boot failed

Debian GNU/Linux 8 beaglebone ttyS0

BeagleBoard.org Debian Image 2016-05-27

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

The IP Address for usb0 is: 192.168.7.2
beaglebone login:

MAC address not read from EEPROM or AM335X registers

Environment

  • Elixir version (elixir -v):
$ elixir -v
Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Elixir 1.9.0 (compiled with Erlang/OTP 22)
  • Nerves environment: (mix nerves.env --info)
$ mix nerves.env --info
|nerves_bootstrap| Environment Package List

  No packages found
|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   host
  MIX_ENV:      dev

NERVES_SYSTEM is unset
NERVES_TOOLCHAIN is unset
|nerves_bootstrap| Environment Variable List
  target:     host
  toolchain:  unset
  system:     unset
  app:        /Users/chris/code/nerves/hello_world

|nerves_bootstrap| Loadpaths End
$ MIX_TARGET=bbb mix nerves.env --info
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_bbb
  Vsn:         2.3.1
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Docker, []}

  Pkg:         nerves_system_br
  Vsn:         1.8.4
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_arm_unknown_linux_gnueabihf
  Vsn:         1.2.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.6.0
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     bbb
  toolchain:  /Users/chris/.nerves/artifacts/nerves_toolchain_arm_unknown_linux_gnueabihf-darwin_x86_64-1.2.0
  system:     /Users/chris/.nerves/artifacts/nerves_system_bbb-portable-2.3.1
  app:        /Users/chris/code/nerves/hello_world

|nerves_bootstrap| Loadpaths End
  • Additional information about your host, target hardware or environment that
    may help

Targeting BBB with the latest nerves package and latest nerves_system_bbb with Elixir 1.9 and OTP 22. But this issue seemed to be present before upgrading as well.

Current behavior

Include errors, stacktraces, screenshots or code that may help us reproduce the
issue.

Repro:

  1. Create brand new project targeting BBB mix nerves.new hello_world --target=bbb
  2. Build the projects MIX_TARGET=bbb mix deps.get MIX_TARGET=bbb mix firmware.burn
  3. Boot device and check MAC address used iex> ifconfig ->
iex(3)> ifconfig
lo: flags=[:up, :loopback, :running]
    inet 127.0.0.1  netmask 255.0.0.0
    inet ::1  netmask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
    hwaddr 00:00:00:00:00:00

eth0: flags=[:broadcast, :multicast]
    hwaddr 78:00:00:00:00:00

usb0: flags=[:up, :broadcast, :running, :multicast]
    inet 172.31.105.165  netmask 255.255.255.252  broadcast 172.31.105.167
    inet fe80::38e1:74ff:fe38:b4a3  netmask ffff:ffff:ffff:ffff::
    hwaddr 3a:e1:74:38:b4:a3

I have tried this on 3 boards now (2 BBB and 1 Octavo based board) all with the same results

Expected behavior

The MAC address should be read from either the EEPROM or the AM335X registers.

Note

I am more than happy to look into this, but if someone could help point me in the correct direction. I am trying to upgrade from VERY old tooling and this is a major block for me at the moment.

Major version mismatch between host and target Erlang/OTP versions

I updated my Nerves toolchains today to the latest releases, but the bbb target is giving me trouble.

This is on a system with NERVES_SYSTEM_CACHE=local set and in a project checkout after doing rm -Rf deps _images rel/APPNAME and mix deps.unlock --all to clean out any old dependencies:

$ NERVES_TARGET=bbb mix do deps.get, deps.precompile
* Updating nerves_lib (https://github.com/nerves-project/nerves_lib.git)
* Updating nerves_networking (https://github.com/nerves-project/nerves_networking.git)
Running dependency resolution
Dependency resolution completed
  bbmustache: 1.0.4
  bunt: 0.1.6
  certifi: 0.4.0
  cf: 0.2.1
  credo: 0.4.8
  dialyxir: 0.3.5
  earmark: 1.0.1
  erlware_commons: 0.21.0
  ex_doc: 0.13.0
  excoveralls: 0.5.5
  exjsx: 3.2.0
  exrm: 1.0.8
  getopt: 0.8.2
  hackney: 1.6.1
  idna: 1.2.0
  jsx: 2.6.2
  metrics: 1.0.1
  mimerl: 1.0.2
  nerves: 0.3.4
  nerves_leds: 0.7.0
  nerves_ssdp_client: 0.1.3
  nerves_ssdp_server: 0.2.1
  nerves_system: 0.1.5
  nerves_system_bbb: 0.6.2
  nerves_system_br: 0.5.2
  nerves_toolchain: 0.6.3
  nerves_toolchain_arm_unknown_linux_gnueabihf: 0.6.1
  porcelain: 2.0.1
  providers: 1.6.0
  relx: 3.20.0
  ssl_verify_fun: 1.1.0
==> nerves_toolchain_arm_unknown_linux_gnueabihf
[nerves_toolchain][compile]
[nerves_toolchain][http] Toolchain up to date
==> nerves_system_bbb
[nerves_system][compile]
[nerves_system][local] Checking Cache for nerves_system_bbb-0.6.2
[nerves_system][local] Found cached system
** (Nerves.Env.Exception) Major version mismatch between host and target Erlang/OTP versions
  Host version: 19
  Target version: 18

This will likely cause Erlang code compiled for the target to fail in
unexpected ways. Install an Erlang OTP release that matches the target
version before continuing.

    (nerves_bootstrap) lib/mix/tasks/nerves.loadpaths.ex:20: Mix.Tasks.Nerves.Loadpaths.run/1
    (nerves_bootstrap) lib/mix/tasks/nerves.precompile.ex:19: Mix.Tasks.Nerves.Precompile.run/1
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
    (mix) lib/mix/task.ex:328: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:261: Mix.Task.run/2
    (elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:651: Enum.each/2
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3

The other targets I use (rpi, rpi2, rpi3, and qemu_arm) didn't give me any trouble executing the same command in the same project.

The host is OS X with Erlang 19.0.2, Elixir 1.3.2, etc, all installed from Homebrew as per the Nerves installation guide.

Add more tests

We're going to be upgrading the Linux kernel soon. This may result in regressions. In order to prevent this, it would be good to have more tests.

For example, I'm not using the PRUs. If PRU support is important to you, could you add a test that verifies that it works.

Here are some tests I've been adding for the RPi0: nerves-project/nerves_system_rpi0@b790b1f

Beagle Bone Green Wireless does not connect to Wifi using onboard Wifi module

I took the following steps:

  • Use the latest BBB system
  • Create a nerves app and add InterimWifi as a dependancy
  • Burn firmware and insert SD in a BBGW
  • Attempt to connect the BBGW to my Wifi network by running the following:
:os.cmd('modprobe wl18xx')
{ok, pid} = Nerves.InterimWiFi.setup "wlan0", ssid: "xxx", key_mgmt: :"WPA-PSK", psk: "yyy"

I get no error messages, but I don't think I'm actually successfully connecting to my wlan.

After calling Nerves.InterimWiFi.setup I get some output which ends with [info] Done Registering) but that's all I get, I'd expect to get a lot more output from InterimWifi and probably expect to see something like WiFiManager.EventHandler(wlan0) wifi_connected if it had actually connected. I tried a couple of other things to see if I had a network connection:
Check if interface exists:

iex(4)> Nerves.NetworkInterface.interfaces
["lo"] # Note no wlan0 listed

Check for internet connectivity:

iex(5)> :httpc.request(:get, {'http://www.erlang.org', []}, [], [])
{:error,
 {:failed_connect,
  [{:to_address, {'www.erlang.org', 80}}, {:inet, [:inet], :nxdomain}]}}

I've been able to connect to the internet by following the same basic procedure on a LinkIt so I think I have my wifi details correct.

Thanks!

Beaglebone eMMC boot with uBoot 2021.10

Booting Beaglebone off of eMMC memory has been compex so far as it required to patch uBoot (see #94)

With nervs_system_bbb upgrading uBoot to 2021.10, those patches are not applicable anymore.

It seems that uBoot has introduced a different way of describing booting device. I'd like to know:

  • if we still need to patch uBoot for eMMC boot, is there any known patch
  • if this is not needed anymore, is there a know fwup /uboot.env combination for making this running in nervs_system_bbb ?

Custom DTBO for SPI LCD (BBGW)

Environment

  • Elixir version (elixir -v):
Erlang/OTP 25 [erts-13.2.2.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
                                            
Elixir 1.14.5 (compiled with Erlang/OTP 25)
  • Nerves environment: (mix nerves.env --info)
==> nerves                                                                                                                                                                        
==> nerves_bbgw                                                                                                                                                                   
|nerves_bootstrap| Environment Package List                                                                                                                                       
                                                                                                                                                                                  
  Pkg:         bbgw_spi                                                                                                                                                           
  Vsn:         2.17.2                                                                                                                                                             
  Type:        system                                                                                                                                                             
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, [make_args: ["source", "all", "legal-info"]]}                                                                                 
                                                                                                                                                                                  
  Pkg:         nerves_system_br                                                                                                                                                   
  Vsn:         1.22.5                                                                                                                                                             
  Type:        system_platform                                                                                                                                                    
  BuildRunner: {nil, []}                                                                                                                                                          

  Pkg:         nerves_toolchain_armv7_nerves_linux_gnueabihf
  Vsn:         1.8.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.9.3
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start

|nerves_bootstrap| Precompile Start

==> nerves_toolchain_armv7_nerves_linux_gnueabihf
|nerves_bootstrap| Compile.NervesPackage start

|nerves_bootstrap| Compile.NervesPackage end 

==> bbgw_spi
Generated bbgw_spi app
|nerves_bootstrap| Compile.NervesPackage start

|nerves_bootstrap| Compile.NervesPackage end 

==> nerves_bbgw
|nerves_bootstrap| Precompile End


Nerves environment
  MIX_TARGET:   bbgw_spi
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     bbgw_spi
  toolchain:  /home/serpent/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.8.0
  system:     /home/serpent/.nerves/artifacts/bbgw_spi-portable-2.17.2
  app:        .

|nerves_bootstrap| Loadpaths End
  • Boot log with additional overlay:
U-Boot 2021.10 (Apr 04 2023 - 02:26:05 +0000)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Reset Source: Global warm SW reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
WDT:   Started with servicing (60s timeout)
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from MMC... OK
Board: BeagleBone Black
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Wireless:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net:   Could not get PHY for ethernet@4a100000: addr 0
eth2: ethernet@4a100000
board_name=[A335BNLT] ...
board_rev=[GW1A] ...
loading /zImage.a ...
2860152 bytes read in 253 ms (10.8 MiB/s)
uboot_overlays: [uboot_base_dtb=am335x-bonegreen-wireless-uboot-univ.dtb] ...
uboot_overlays: Switching too: dtb=am335x-bonegreen-wireless-uboot-univ.dtb ...
loading /boot/am335x-bonegreen-wireless-uboot-univ.dtb ...
207617 bytes read in 35 ms (5.7 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/spi0_ili9341_display.dtbo ...
2417 bytes read in 109 ms (21.5 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
1614 bytes read in 47 ms (33.2 KiB/s)
uboot_overlays: loading /lib/firmware/BB-BBGW-WL1835-00A0.dtbo ...
4289 bytes read in 38 ms (109.4 KiB/s)
debug: [console=ttyS0,115200n8 coherent_pool=1M bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p2 rootfstype=squashfs rootwait coherent_pool=1M net.ifnames=0 omap_wdt.early_enable=1 omap_wdt.timer_margin=120 quiet] ...
debug: [bootz 0x82000000 - 88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x2ba478 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ff69000, end 8fffffff ... OK

Starting kernel ...

[    0.159780] l3-aon-clkctrl:0000:0: failed to disable
[    6.058566] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[    6.058589] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[    6.069856] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    6.378639] pinctrl-single 44e10800.pinmux: pin PIN30 already requested by 481a6000.serial; cannot claim for leds
[    6.389311] pinctrl-single 44e10800.pinmux: pin-30 (leds) status -22
[    6.395742] pinctrl-single 44e10800.pinmux: could not request pin 30 (PIN30) from group pinmux_bt_pins  on device pinctrl-single
[    6.407370] leds-gpio leds: Error applying setting, reverse things back
[    6.424305] omap_voltage_late_init: Voltage driver support not added
Erlang/OTP 25 [erts-13.2] [source] [32-bit] [smp:1:1] [ds:1:1:10] [async-threads:1]

pinctrl errors are exactly the same without overlay. System config is unchanged except for additional BR packages.

Changes in provisioning.conf:

uboot_setenv(uboot-env, "uboot_overlay_addr4", "/lib/firmware/spi0_ili9341_display.dtbo")
#uboot_setenv(uboot-env, "enable_uboot_cape_universal", "1")

Actual U-Boot env on target:

iex(1)> ubootenv(~r/^uboot_/)                                                                  
uboot_base_dtb="am335x-boneblack-uboot.dtb"
uboot_base_dtb_univ="am335x-bonegreen-wireless-uboot-univ.dtb"
uboot_emmc="BB-BONE-eMMC1-01-00A0.dtbo"
uboot_overlay_addr4="/lib/firmware/spi0_ili9341_display.dtbo"
uboot_wireless="BB-BBGW-WL1835-00A0.dtbo"
:ok
iex(2)> ubootenv(~r/^enable_/) 
enable_uboot_overlays="1"
:ok

DTS file package/extra-dts/spi0_ili9341_display.dts:

// run `make extra-dts-rebuild` in Nerves shell to rebuild manually, then `make all` to bundle

/dts-v1/;
/plugin/;

#include <dt-bindings/pinctrl/omap.h>

/ {
  fragment@1 {
    target-path="/";
    __overlay__ {
      compatible = "ti,am335x-bone-green-wireless", "ti,am335x-bone-green", "ti,am335x-bone", "ti,am33xx";

      // /* state the resources this cape uses */
      // exclusive-use =
      //   /* the pin header uses */
      //   /* "P9.17",	/* spi0_cs0 */
      //   "P9.18",	/* spi0_d1 */
      //   "P9.21",	/* spi0_d0 */
      //   "P9.22",	/* spi0_sclk */
      //   "P9.16",  /* backlight LED */
      //   "P9.24",  /* SPI DC (direction) */
      //   "P9.23",  /* reset */
      //   /* the hardware ip uses */
      //   "spi0",
      //   "ehrpwm1B";
    };
  };

  /*
  * Free up the pins used by the cape from the pinmux helpers.
  */
  fragment@2 {
    target = <&ocp>;
    __overlay__ {
      P9_18_pinmux { status = "disabled"; };
      P9_21_pinmux { status = "disabled"; };
      P9_22_pinmux { status = "disabled"; };
      P9_16_pinmux { status = "disabled"; };
      P9_24_pinmux { status = "disabled"; };
      P9_23_pinmux { status = "disabled"; };
    };
  };

  fragment@3 {
    target = <&am33xx_pinmux>;

    __overlay__ {
      backlight_pins_default: backlight_pins_default {
        // P9.16
        pinctrl-single,pins = <
          AM33XX_IOPAD(0x84c, PIN_OUTPUT | MUX_MODE6) /* (T14) gpmc_a3.ehrpwm1B */
        >;
      };

      spi_dc_pins_default: spi_dc_pins_default {
        // P9.24
        pinctrl-single,pins = <
          AM33XX_IOPAD(0x984, PIN_OUTPUT | MUX_MODE7) /* (D15) uart1_txd.gpio0[15] */
        >;
      };

      reset_pins_default: reset_pins_default {
        // P9.23
        pinctrl-single,pins = <
          AM33XX_IOPAD(0x844, PIN_OUTPUT | MUX_MODE7) /* (V14) gpmc_a1.gpio1[17] */
        >;
      };

      spi0_pins_default: spi0_pins_default {
        // P9.22, P9.21, P9.18
        pinctrl-single,pins = <
          AM33XX_IOPAD(0x950, PIN_OUTPUT | MUX_MODE0) /* (A17) spi0_sclk.spi0_sclk */
          AM33XX_IOPAD(0x954, PIN_INPUT | MUX_MODE0) /* (B17) spi0_d0.spi0_d0 */
          AM33XX_IOPAD(0x958, PIN_OUTPUT | MUX_MODE0) /* (B16) spi0_d1.spi0_d1 */
        >;
      };
    };
  };

  fragment@4 {
    target = <&epwmss2>;
    __overlay__ {
      status = "okay";
    };
  };

  fragment@5 {
    target = <&ehrpwm2>;
    __overlay__ {
      status = "okay";
    };
  };

  fragment@6 {
    target = <&ocp>;
    __overlay__ {
      backlight {
        compatible = "pwm-backlight";
        pinctrl-names	= "default";
        pinctrl-0	= <&backlight_pins_default>;
        pwms = <&ehrpwm1 1 500000>;

        brightness-levels = <0 4 8 16 32 64 128 255>;
        default-brightness-level = <6>;
      };
    };
  };

  fragment@7 {
    target = <&spi0>;
    __overlay__ {
      // avoid warning
      #address-cells = <1>;
      #size-cells = <0>;

      status		= "okay";
      pinctrl-names	= "default";
      pinctrl-0	= <&spi0_pins_default>;

      ti,spi-num-cs = <0>;

      /*
      lcd@0 {
        compatible = "ilitek,ili9341";
        reg = <0>;
        buswidth = <8>;
        spi-max-frequency = <24000000>;
        dc-gpios = <&gpio0 15 0>;     // P9_24
        reset-gpios = <&gpio1 17 0>;  // P9_23
        rotation = <270>;
        backlight = <&backlight>;
        status = "okay";
      };
      */
    };
  };
};

Current behavior

  • Universal cape seems always to be loaded
    Even changing uboot_base_dtb and uboot_base_dtb_univ to am335x-bonegreen-wireless.dtb does not make any difference.
  • /sys/class/backlight does not show up
  • DTBO becomes unloadable when enabling the lcd part

Expected behavior

PWM backlight should be available.

I'm fairly new to the whole device tree business, so probably I made some mistakes in my DTS.

Where can I find information about exclusive-use? Is it BeagleBone specific? Some overlays make use of it, others disable the pinmux nodes (like I did for now).

Is <&ehrpwm1 1 x> the right way to address ehrpwm1B? Where can I find this kind of information?

Any pointers appreciated to get this to work.

Rename BBB system

I've noticed on the forums that some people are unaware that this system also contains support for the beagle bone green, black, and pocket (which is new however). Perhaps we should rename this system to something along the lines of Beaglebone Commons?

Enable the USB gadget mode interface and support nerves_init_gadget

Based on the great experience we've had with the Raspberry Pi Zero and its USB gadget mode interface, enable the same support on BeagleBone-based boards. This makes it possible to have one cable to the board that provides power, IEx prompt access, and network access.

add support for PRU's

I don't have time to really get into this yet, but I want to document it somewhere...

I think a lot of users (including myself) want to begin using the PRU's with Nerves, but aside from some old ish stuff that @fhunleth did here (this predates Nerves/Elixir), there is not much to be found.

I think we will need a number of things outside this repository also. Here's what I'd like to see...

  • Buildroot support. This would probably require at least the following:
    • A device tree to be enabled.
    • the package BR2_PACKAGE_AM335X_PRU_PACKAGE to be enabled
      • This contains the assembler if i remember correctly.
  • An Elixir API for access to the PRU's. This would have the following
    • assemble the PRU code
    • build a "loader" to load code into the PRU's.
    • Allow communication somehow if needed thru ElixirALE or similar.
  • Docs for setting it all up and examples for usage.

Buildroot support would probably be easy and could be enabled without breaking backwards compatibility (unless the DTBO, would break GPIO access...)

The second and third point there would probably be it's own repo, tho it could technically exist here..

I've been having a lot of discussions on Slack about this recently, and i would like to document it in a more followable manor.

GPIO assignment scrambled in v2.15.0

Environment

  • Elixir version (elixir -v):
Erlang/OTP 25 [erts-13.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.13.4 (compiled with Erlang/OTP 25)
  • Nerves environment: (mix nerves.env --info) (This is from the working v2.14.0 based system!)
==> nerves
==> gpio
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_bbb
  Vsn:         2.14.0
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, [make_args: ["source", "all", "legal-info"]]}

  Pkg:         nerves_system_br
  Vsn:         1.19.0
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_armv7_nerves_linux_gnueabihf
  Vsn:         1.5.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.8.5
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     bbb
  toolchain:  /home/udos/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.5.0
  system:     /home/udos/.nerves/artifacts/nerves_system_bbb-portable-2.14.0
  app:        .

|nerves_bootstrap| Loadpaths End
  • Additional information about your host, target hardware or environment that
    may help
    • Host System is Ubuntu 22. Erlang/Elixir is installed/built via asdf
    • Target is a Beagle Bone Black

Current behavior

The assignment of logical GPIO pin numbers to the actual hardware is scrambled in v2.15.0. E.g. GPIO 49 on a BBB should be on Pin Header 9, Pin 23 - i.e. it's label in sysfs (/sys/class/gpio/gpio49/label) should equal P9_23. However in v.2.15.0 it's P8_34. Also it's no just the label. Trying to access the GPIO for output doesn't work (no LED in my case).

Expected behavior

Version v2.14.0 does show the expected behavior. I.e. /sys/class/gpio/gpio49/label yields P9_23.

How to replicate

I created a new project using the stock system (i.e. no custom system): https://github.com/insasec/nerves_scrambled_gpio

The project contains a simple CLI test which prints out and compares the actual and expected label of GPIO 49: https://github.com/insasec/nerves_scrambled_gpio/blob/078f032cb18e1344cf26f6df4556eece19b11838/lib/gpio.ex#L6

The commit using the stock v2.15.0 system (https://github.com/insasec/nerves_scrambled_gpio/tree/scrambled-gpio) shows the scrambled GPIO assignment with the simple test above:

iex(1)> Gpio.test_gpio()    
FAIL - Actual label (P8_34) does not match expected label (P9_23) for GPIO 49

The commit using a "hardcoded" v2.14.0 system in mix.exs (https://github.com/insasec/nerves_scrambled_gpio/tree/fixed-gpio) does show the expected behaviour:

iex(1)> Gpio.test_gpio()    
PASS - Actual label (P9_23) matches expected label (P9_23) for GPIO 49

MAC address seems to be persisted to SD card

Environment

  • Elixir version (elixir -v):
Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
Elixir 1.10.3 (compiled with Erlang/OTP 22)
  • Nerves environment: (mix nerves.env --info)
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_bbb
  Vsn:         2.6.2
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_system_br
  Vsn:         1.11.4
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_arm_unknown_linux_gnueabihf
  Vsn:         1.3.2
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.7.2
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     bbb
  toolchain:  /home/andrew/.nerves/artifacts/nerves_toolchain_arm_unknown_linux_gnueabihf-linux_x86_64-1.3.2
  system:     /home/andrew/.nerves/artifacts/nerves_system_bbb-portable-2.6.2
  app:        /home/andrew/repos/hello_nerves

|nerves_bootstrap| Loadpaths End

  • Additional information about your host, target hardware or environment that
    may help

I've tested this with both the current "hello_nerves" project (mix nerves.new hello_nerves), and an older one that used init_gadget instead of nerves_pack.

Current behavior

So this might be a strange one. I'm not sure if this is desired behaviour or not, but it seems like the Ethernet MAC is getting persisted to the SD card. I've tested this with projects using init_gadget and nerves_pack, so I don't think the issue is in the networking libraries (or they both have the same behaviour).

Take two Beaglebone Blacks. Burn hello nerves project onto SD card.

Insert SD card into BBB 1. MAC address is correctly reported. Move SD card to BBB 2. MAC address is that of BBB 1.

Re-burn the project to the SD card. Insert into BBB2. MAC address is correct. But when moved to BBB1, the MAC address reported is that of BBB2.

Expected behavior

MAC address is correctly reported.
I also tested an sd card with debian, and it seems to work as expected.

Extra device tree overlays `*.dts` cannot reference kernel includes

Environment

  • Elixir version (elixir -v):
Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.13.4 (compiled with Erlang/OTP 25)
  • Nerves environment: (mix nerves.env --info)
==> nerves
/usr/bin/make -C src all
make[1]: Entering directory '/home/udos/Documents/Development/nerves_playground/deps/nerves/src'
cc /home/udos/Documents/Development/nerves_playground/_build/bbb_dev/lib/nerves/obj/port.o  -o /home/udos/Documents/Development/nerves_playground/_build/bbb_dev/lib/nerves/priv/port
make[1]: Leaving directory '/home/udos/Documents/Development/nerves_playground/deps/nerves/src'
if [ -f test/fixtures/port/Makefile ]; then /usr/bin/make -C test/fixtures/port; fi
==> nerves_playground
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_bbb
  Vsn:         2.15.2
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, [make_args: ["source", "all", "legal-info"]]}

  Pkg:         nerves_system_br
  Vsn:         1.20.4
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_armv7_nerves_linux_gnueabihf
  Vsn:         1.6.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.9.0
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start

|nerves_bootstrap| Precompile Start

|nerves_bootstrap| Env Start

|nerves_bootstrap| Env End

==> nerves_system_br
Generated nerves_system_br app
==> nerves_toolchain_ctng
Compiling 1 file (.ex)
Generated nerves_toolchain_ctng app
==> nerves_toolchain_armv7_nerves_linux_gnueabihf
|nerves_bootstrap| Compile.NervesPackage start

|nerves_bootstrap| Compile.NervesPackage end

Generated nerves_toolchain_armv7_nerves_linux_gnueabihf app
==> nerves_system_bbb
Generated nerves_system_bbb app
|nerves_bootstrap| Compile.NervesPackage start

|nerves_bootstrap| Compile.NervesPackage end

==> nerves_playground
|nerves_bootstrap| Precompile End


Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     bbb
  toolchain:  /home/udos/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.6.0
  system:     /home/udos/.nerves/artifacts/nerves_system_bbb-portable-2.15.2
  app:        .

|nerves_bootstrap| Loadpaths End
  • Additional information about your host, target hardware or environment that
    may help

Current behavior

The current implementation of package/extra-dts/extra-dts.mk allows for simple dropping of additional *.dts files into package/extra-dts. Those will automatically be compiled by dtc and copied to /lib/firmware/ in the target FS.

However the preprocessor run to feed into dtc does not include the Linux kernel sources. Thus #includes of Linux *.dts files and or macros are not supported. So adding device tree overlays which reference Linux includes require the developer to compile them manually and to place the *.dtbo files via rootfs_overlay.

Expected behavior

Run the preprocessor with additional includes referencing Linux kernel sources to include the include and arch directory.

This will allow (most) additional *.dts to be simply dropped into package/extra-dts while nerves takes care of compiling them and placing them under /lib/firmware in the target FS.

Nerves won't boot off the Beaglebone Black emmc

Environment

  • Elixir version (elixir -v):
Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Elixir 1.8.1 (compiled with Erlang/OTP 20)
  • Nerves environment: (mix nerves.env --info)
|nerves_bootstrap| Environment Package List

  Pkg:         nerves_system_bbb
  Vsn:         2.1.2
  Type:        system
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_system_br
  Vsn:         1.6.6
  Type:        system_platform
  BuildRunner: {nil, []}

  Pkg:         nerves_toolchain_arm_unknown_linux_gnueabihf
  Vsn:         1.1.0
  Type:        toolchain
  BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}

  Pkg:         nerves_toolchain_ctng
  Vsn:         1.5.0
  Type:        toolchain_platform
  BuildRunner: {nil, []}

|nerves_bootstrap| Loadpaths Start


Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

|nerves_bootstrap| Environment Variable List
  target:     bbb
  toolchain:  /home/andrew/.nerves/artifacts/nerves_toolchain_arm_unknown_linux_gnueabihf-linux_x86_64-1.1.0
  system:     /home/andrew/.nerves/artifacts/nerves_system_bbb-portable-2.1.2
  app:        /home/andrew/test
|nerves_bootstrap| Loadpaths End

Current behavior

I'm unable to get a project running on the beaglebone emmc. I've tried installing a nerves firmware image build from a new project onto the emmc from a debian sd card using fwup: fwup -a -d /dev/mmcblk1 -i test.fw -t complete, the write seems to succeed, but the I get the following output after removing the sdcard and rebooting:

U-Boot SPL 2018.07 (Jan 27 2019 - 16:27:38 +0000)
Trying to boot from MMC2
Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
Failed (-5)
U-Boot 2018.07 (Jan 27 2019 - 16:27:38 +0000)
CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Global external warm reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
Failed (-5)
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
board_name=[A335BNLT] ...
board_rev=[00C0] ...
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
Card did not respond to voltage select!
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
super: SQUASHFS error: Can't find a SQUASHFS superblock on 00000000
** Unrecognized filesystem type **
super: SQUASHFS error: Can't find a SQUASHFS superblock on 00000000
** Unrecognized filesystem type **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **
=> 

Expected behavior

The firmware image boots off the emmc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.