Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 4e8cdd68 authored by Deepak Khatri's avatar Deepak Khatri :dog:
Browse files

Merge branch 'main' into 'main'

Fixes, contnet and release script

See merge request docs/docs.beagleboard.io!27
parents 8db16c85 3e1b480f
Branches
Tags
2 merge requests!37Making Additional References and Text to My Previous Merge,!27Fixes, contnet and release script
Pipeline #917 passed with warnings with stage
in 5 minutes and 57 seconds
Showing
with 1286 additions and 634 deletions
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
image: beagle/sphinx-build-env:latest
stages:
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: bbdocs
paths:
- public
- public
pages:
stage: deploy
script:
- ./gitlab-build.sh
- "./gitlab-build.sh"
artifacts:
paths:
- public
- public
[submodule "books/beaglebone-cookbook/code"]
path = books/beaglebone-cookbook/code
url = https://git.beagleboard.org/beagleboard/beaglebone-cookbook-code.git
......@@ -8,3 +8,4 @@ RUN apk add librsvg
RUN pip install sphinx_rtd_theme
RUN apk add texlive-full
RUN apk add make
RUN apk add rsync
from docutils import nodes
from sphinx.util.docutils import SphinxDirective
from sphinx.transforms import SphinxTransform
from docutils.nodes import Node
# BASE_NUM = 2775 # black circles, white numbers
BASE_NUM = 2459 # white circle, black numbers
class CalloutIncludePostTransform(SphinxTransform):
"""Code block post-processor for `literalinclude` blocks used in callouts."""
default_priority = 400
def apply(self, **kwargs) -> None:
visitor = LiteralIncludeVisitor(self.document)
self.document.walkabout(visitor)
class LiteralIncludeVisitor(nodes.NodeVisitor):
"""Change a literal block upon visiting it."""
def __init__(self, document: nodes.document) -> None:
super().__init__(document)
def unknown_visit(self, node: Node) -> None:
pass
def unknown_departure(self, node: Node) -> None:
pass
def visit_document(self, node: Node) -> None:
pass
def depart_document(self, node: Node) -> None:
pass
def visit_start_of_file(self, node: Node) -> None:
pass
def depart_start_of_file(self, node: Node) -> None:
pass
def visit_literal_block(self, node: nodes.literal_block) -> None:
if "<1>" in node.rawsource:
source = str(node.rawsource)
for i in range(1, 20):
source = source.replace(
f"<{i}>", "``" + chr(int(f"0x{BASE_NUM + i}", base=16)) + "``"
)
node.rawsource = source
node[:] = [nodes.Text(source)]
class callout(nodes.General, nodes.Element):
"""Sphinx callout node."""
pass
def visit_callout_node(self, node):
"""We pass on node visit to prevent the
callout being treated as admonition."""
pass
def depart_callout_node(self, node):
"""Departing a callout node is a no-op, too."""
pass
class annotations(nodes.Element):
"""Sphinx annotations node."""
pass
def _replace_numbers(content: str):
"""
Replaces strings of the form <x> with circled unicode numbers (e.g. ①) as text.
Args:
content: Python str from a callout or annotations directive.
Returns: The formatted content string.
"""
for i in range(1, 20):
content.replace(f"<{i}>", chr(int(f"0x{BASE_NUM + i}", base=16)))
return content
def _parse_recursively(self, node):
"""Utility to recursively parse a node from the Sphinx AST."""
self.state.nested_parse(self.content, self.content_offset, node)
class CalloutDirective(SphinxDirective):
"""Code callout directive with annotations for Sphinx.
Use this `callout` directive by wrapping either `code-block` or `literalinclude`
directives. Each line that's supposed to be equipped with an annotation should
have an inline comment of the form "# <x>" where x is an integer.
Afterwards use the `annotations` directive to add annotations to the previously
defined code labels ("<x>") by using the syntax "<x> my annotation" to produce an
annotation "my annotation" for x.
Note that annotation lines have to be separated by a new line, i.e.
.. annotations::
<1> First comment followed by a newline,
<2> second comment after the newline.
Usage example:
-------------
.. callout::
.. code-block:: python
from ray import tune
from ray.tune.search.hyperopt import HyperOptSearch
import keras
def objective(config): # <1>
...
search_space = {"activation": tune.choice(["relu", "tanh"])} # <2>
algo = HyperOptSearch()
tuner = tune.Tuner( # <3>
...
)
results = tuner.fit()
.. annotations::
<1> Wrap a Keras model in an objective function.
<2> Define a search space and initialize the search algorithm.
<3> Start a Tune run that maximizes accuracy.
"""
has_content = True
def run(self):
self.assert_has_content()
content = self.content
content = _replace_numbers(content)
callout_node = callout("\n".join(content))
_parse_recursively(self, callout_node)
return [callout_node]
class AnnotationsDirective(SphinxDirective):
"""Annotations directive, which is only used nested within a Callout directive."""
has_content = True
def run(self):
content = self.content
content = _replace_numbers(content)
joined_content = "\n".join(content)
annotations_node = callout(joined_content)
_parse_recursively(self, annotations_node)
return [annotations_node]
def setup(app):
# Add new node types
app.add_node(
callout,
html=(visit_callout_node, depart_callout_node),
latex=(visit_callout_node, depart_callout_node),
text=(visit_callout_node, depart_callout_node),
)
app.add_node(annotations)
# Add new directives
app.add_directive("callout", CalloutDirective)
app.add_directive("annotations", AnnotationsDirective)
# Add post-processor
app.add_post_transform(CalloutIncludePostTransform)
return {
"version": "0.1",
"parallel_read_safe": True,
"parallel_write_safe": True,
}
......@@ -16,4 +16,5 @@ BeagleBone® AI-64 brings a complete system for developing artificial intelligen
/boards/beaglebone/ai-64/ch09.rst
/boards/beaglebone/ai-64/ch10.rst
/boards/beaglebone/ai-64/ch11.rst
/boards/beaglebone/ai-64/update.rst
/boards/beaglebone/ai-64/edge_ai_apps/index.rst
.. _bbai64-update:
Update software on BeagleBone AI-64
###################################
Production boards currently ship with the factory-installed 2022-01-14-8GB image. To upgrade from the software image on your BeagleBone AI-64 to the latest, you don't need to completely reflash the board. If you do want to reflash it, visit the flashing instructions on the getting started page.
Factory Image update (without reflashing)…
.. code-block:: bash
:linenos:
sudo apt update
sudo apt install --only-upgrade bb-j721e-evm-firmware generic-sys-mods
sudo apt upgrade
Update U-Boot:
==============
to ensure only tiboot3.bin is in boot0, the pre-production image we tried to do more in boot0, but failed…
.. code-block:: bash
:linenos:
sudo /opt/u-boot/bb-u-boot-beagleboneai64/install-emmc.sh
sudo /opt/u-boot/bb-u-boot-beagleboneai64/install-microsd.sh
sudo reboot
Update Kernel and SGX modules:
==============================
.. code-block:: bash
:linenos:
sudo apt install bbb.io-kernel-5.10-ti-k3-j721e
Update xfce:
============
.. code-block:: bash
:linenos:
sudo apt install bbb.io-xfce4-desktop
Update ti-edge-ai 8.2 examples
==============================
.. code-block:: bash
:linenos:
sudo apt install ti-edgeai-8.2-base ti-vision-apps-8.2 ti-vision-apps-eaik-firmware-8.2
Cleanup:
========
.. code-block:: bash
:linenos:
sudo apt autoremove --purge
......@@ -10,7 +10,8 @@ The most popular design is :ref:`beagleboneblack-home`, a staple reference for a
embedded Linux single board computer.
:ref:`bbai64-home` is our most powerful design with tremendous machine learning inference
performance and
performance, 64-bit processing and a mixture of microcontrollers for various types of
highly-reliable and low-latency control.
For simplicity of developing small, mobile robotics, check out :ref:`beaglebone-blue-home`, a highly
integrated board with motor drivers, battery support, altimeter, gyroscope, accelerometer,
......@@ -24,6 +25,6 @@ of your screen.
* `BeagleBone (original) <https://git.beagleboard.org/beagleboard/beaglebone/-/blob/master/BeagleBone_SRM_A6_0_1.pdf>`__
* :ref:`beagleboneblack-home`
* :ref:`beaglebone-blue-home`
* :ref:`bbai64-home`
* :ref:`beaglebone-ai-home`
* :ref:`bbai64-home`
.. _beagleconnect_freedom_home:
BeagleConnect Freedom
######################
.. important::
Currently under development
.. image:: media/image1.jpg
:width: 600
:align: center
......@@ -29,12 +35,12 @@ devices within the first year after the initial release.
BeagleConnect™ Freedom
**********************
BeagleConnect™ Freedom is based on the `TI CC1352 <https://www.ti.com/product/CC1352P7>`_
BeagleConnect™ Freedom is based on a `TI Arm Cortex-M4 wireless-enabled microcontroller <https://www.ti.com/product/CC1352P7>`_
and is the first available BeagleConnect™ solution. It implements:
* BeagleConnect™ gateway device function for Sub-GHz 802.15.4 long-range
wireless
* BeagleConnect™ node device function for Bluetooth Low-Energe (BLE) and
* BeagleConnect™ node device function for Bluetooth Low-Energy (BLE) and
Sub-GHz 802.15.4 long range wireless
* USB-based serial console and firmware updates
* 2x `mikroBUS sockets <https://www.mikroe.com/mikrobus>`_ with BeagleConnect™
......@@ -125,7 +131,7 @@ Long-range, low-power wireless
==============================
BeagleConnect™ Freedom wireless hardware is built around a
`TI CC1352 <http://www.ti.com/product/CC1352P7>`_ multiprotocol and multi-band
`TI CC1352P7 <http://www.ti.com/product/CC1352P7>`_ multiprotocol and multi-band
Sub-1 GHz and 2.4-GHz wireless microcontroller (MCU). CC1352P7 includes a 48-MHz
Arm® Cortex®-M4F processor, 704KB Flash, 256KB ROM, 8KB Cache SRAM, 144KB of
ultra-low leakage SRAM, and `Over-the-Air <https://en.wikipedia.org/wiki/Over-the-air_programming>`_
......
......@@ -73,6 +73,57 @@ BeagleBone® Green Gateway host.
#TODO: describe how to know it is working
Other systems
-------------
.. important::
If you are using the image above, none of the instructions in this section are required.
#. Update the system.
.. code-block:: bash
sudo apt update
#. Install all BeagleConnect™ management software.
.. code-block:: bash
sudo apt install -y \
beagleconnect beagleconnect-msp430 \
git vim \
build-essential \
cmake ninja-build gperf \
ccache dfu-util device-tree-compiler \
make gcc libsdl2-dev \
libxml2-dev libxslt-dev libssl-dev libjpeg62-turbo-dev \
gcc-arm-none-eabi libnewlib-arm-none-eabi \
libtool-bin pkg-config autoconf automake libusb-1.0-0-dev \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel
.. code-block:: bash
echo "export PATH=$PATH:$HOME/.local/bin" >> $HOME/.bashrc
.. code-block:: bash
source $HOME/.bashrc
#. Reboot
.. code-block:: bash
sudo reboot
#. Install BeagleConnect™ flashing software
.. code-block:: bash
pip3 install -U west
#. Reboot
.. code-block:: bash
sudo reboot
Log into BeagleBone Green Gateway
=================================
......@@ -86,7 +137,6 @@ computer can be used to connect to your BeagleBone Green Gateway.
* To connect you can simply type :code:`$ ssh debian@192.168.7.2` and when
asked for password just type :code:`temppwd`
* Congratulations, You are now connected to the device!
#. Connect to the `WiFi <https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshots/31280>`_
* Execute :code:`sudo nano /etc/wpa_supplicant/wpa_supplicant-wlan0.conf`
and provide the password :code:`temppwd` to edit the configuration file
......@@ -94,7 +144,8 @@ computer can be used to connect to your BeagleBone Green Gateway.
* Now edit the file (shown below) under the :code:`network={...}`
section you can set you :code:`ssid` (WiFi name) and :code:`psk` (Wifi
Password).
.. code-block::
.. code-block::
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1
......@@ -103,10 +154,12 @@ computer can be used to connect to your BeagleBone Green Gateway.
ssid="WiFi Name"
psk="WiFi Password"
}
* Now save the file with :code:`CTRL+O` and exit with :code:`CTRL+X`.
* Check if the connection is established by executing :code:`$ ping 8.8.8.8`
you should see something like shown below.
.. code-block:: bash
.. code-block:: bash
debian@BeagleBone:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
......@@ -115,62 +168,24 @@ computer can be used to connect to your BeagleBone Green Gateway.
64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 time=6.13 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=118 time=6.11 ms
...
* If everything goes well, you are ready to update your system and install
new applications for beagleconnect.
Note: If you are facing some issue during boot then you can try debugging the
boot session with a USB to serial interface cable such as those made by FTDI
plugged into J10 with the black wire of the FTDI cable toward the Ethernet
connector. Application like tio/minicom/putty can be used to make the connection
establishment procedure easy.
.. note:
TODO: Simplify and elaborate on this section, add boot session debugging walkthrough
If you are facing some issue during boot then you can try debugging the
boot session with a USB to serial interface cable such as those made by FTDI
plugged into J10 with the black wire of the FTDI cable toward the Ethernet
connector. Application like tio/minicom/putty can be used to make the connection
establishment procedure easy.
Install Zephyr development tools on BeagleBone Green Gateway
============================================================
.. note:
#. Update the system.
.. code-block:: bash
sudo apt update
#. Install all BeagleConnect™ management software.
.. code-block:: bash
#TODO#: Simplify and elaborate on this section, add boot session debugging walkthrough
sudo apt install -y \
beagleconnect beagleconnect-msp430 \
git vim \
build-essential \
cmake ninja-build gperf \
ccache dfu-util device-tree-compiler \
make gcc libsdl2-dev \
libxml2-dev libxslt-dev libssl-dev libjpeg62-turbo-dev \
gcc-arm-none-eabi libnewlib-arm-none-eabi \
libtool-bin pkg-config autoconf automake libusb-1.0-0-dev \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel
.. code-block:: bash
echo "export PATH=$PATH:$HOME/.local/bin" >> $HOME/.bashrc
.. code-block:: bash
source $HOME/.bashrc
#. Reboot
.. code-block:: bash
sudo reboot
#. Install BeagleConnect™ flashing software
.. code-block:: bash
pip3 install -U west
#. Reboot
.. code-block:: bash
sudo reboot
Install Zephyr development tools on BeagleBone Green Gateway
============================================================
#. Download and setup Zephyr for BeagleConnect™
.. code-block:: bash
......@@ -193,32 +208,37 @@ Build applications for BeagleConnect Freedom on BeagleBone Green Gateway
Now you can build various Zephyr applications
#. Change directory to BeagleConnect Freedom zephyr repository.
.. code-block:: bash
cd $HOME/bcf-zephyr
#. Build blinky example
.. code-block:: bash
west build -d build/blinky zephyr/samples/basic/blinky
.. code-block:: bash
west build -d build/blinky zephyr/samples/basic/blinky
#. TODO
.. code-block:: bash
west build -d build/sensortest zephyr/samples/boards/beagle_bcf/sensortest -- -DOVERLAY_CONFIG=overlay-subghz.conf
#. TODO
.. code-block:: bash
west build -d build/wpanusb modules/lib/wpanusb_bc -- -DOVERLAY_CONFIG=overlay-subghz.conf
#. TODO
.. code-block:: bash
west build -d build/bcfserial modules/lib/wpanusb_bc -- -DOVERLAY_CONFIG=overlay-bcfserial.conf -DDTC_OVERLAY_FILE=bcfserial.overlay
#. TODO
.. code-block:: bash
west build -d build/greybus modules/lib/greybus/samples/subsys/greybus/net -- -DOVERLAY_CONFIG=overlay-802154-subg.conf
......
......@@ -3,6 +3,10 @@
BeagleConnect
###############
.. important::
Currently under development
BeagleConnect™ is a revolutionary technology virtually eliminating low-level
software development for `IoT <https://en.wikipedia.org/wiki/Internet_of_things>`_
and `IIoT <https://en.wikipedia.org/wiki/Industrial_internet_of_things>`_
......
This diff is collapsed.
boards/images/beaglebone-ai-64-400x.webp

21.2 KiB

......@@ -22,8 +22,13 @@ started.
.. toctree::
:maxdepth: 1
:hidden:
/boards/beaglebone/index
/boards/beaglebone/black/index
/boards/beaglebone/blue/index
/boards/beaglebone/ai/index
/boards/beaglebone/ai-64/index
/boards/pocketbeagle/original/index
/boards/capes/index
/boards/beagleconnect/index
......
......@@ -170,15 +170,13 @@ Connect your Bone to the Internet and log into it. From the command line run:
.. code-block::
bone$ git clone git@github.com:MarkAYoder/BoneCookbook.git
bone$ cd BoneCookbook/docs
bone$ git clone https://git.beagleboard.org/beagleboard/beaglebone-cookbook-code
bone$ cd beaglebone-cookbook-code
bone$ ls
You can look around from the command line, or explore from Visual Sudio Code.
If you ar using VSC, go to the *File* menu and select *Open Folder ...* and
select BoneCookbook/docs. Then explore. You'll find there is a directory
for each chapter and most chapters have a *code* directory for the sample
scripts and a *figures* directory for the figures.
select beaglebone-cookbook-code. Then explore.
.. _basics_wire_breadboard:
......
#!/usr/bin/env node
// Install with: npm install nmea
// Need to add exports.serialParsers = m.module.parsers;
// to the end of /usr/local/lib/node_modules/bonescript/serial.js
var b = require('bonescript');
var nmea = require('nmea');
var port = '/dev/ttyO4';
var options = {
baudrate: 9600,
parser: b.serialParsers.readline("\n")
};
b.serialOpen(port, options, onSerial);
function onSerial(x) {
if (x.err) {
console.log('***ERROR*** ' + JSON.stringify(x));
}
if (x.event == 'open') {
console.log('***OPENED***');
}
if (x.event == 'data') {
console.log(String(x.data));
console.log(nmea.parse(x.data));
}
}
#!/usr/bin/env node
//////////////////////////////////////
// analogin.js
// Reads the analog value of the light sensor.
//////////////////////////////////////
const fs = require("fs");
const ms = 500; // Time in milliseconds
const pin = "2"; // light sensor, A2, P9_37
const IIOPATH='/sys/bus/iio/devices/iio:device0/in_voltage'+pin+'_raw';
console.log('Hit ^C to stop');
// Read every 500ms
setInterval(readPin, ms);
function readPin() {
var data = fs.readFileSync(IIOPATH).slice(0, -1);
console.log('data = ' + data);
}
// Bone | Pocket | AIN
// ----- | ------ | ---
// P9_39 | P1_19 | 0
// P9_40 | P1_21 | 1
// P9_37 | P1_23 | 2
// P9_38 | P1_25 | 3
// P9_33 | P1_27 | 4
// P9_36 | P2_35 | 5
// P9_35 | P1_02 | 6
#!/usr/bin/env python3
#//////////////////////////////////////
# analogin.py
# Reads the analog value of the light sensor.
#//////////////////////////////////////
import time
import os
pin = "2" # light sensor, A2, P9_37
IIOPATH='/sys/bus/iio/devices/iio:device0/in_voltage'+pin+'_raw'
print('Hit ^C to stop')
f = open(IIOPATH, "r")
while True:
f.seek(0)
x = float(f.read())/4096
print('{}: {:.1f}%, {:.3f} V'.format(pin, 100*x, 1.8*x), end = '\r')
time.sleep(0.1)
# // Bone | Pocket | AIN
# // ----- | ------ | ---
# // P9_39 | P1_19 | 0
# // P9_40 | P1_21 | 1
# // P9_37 | P1_23 | 2
# // P9_38 | P1_25 | 3
# // P9_33 | P1_27 | 4
# // P9_36 | P2_35 | 5
# // P9_35 | P1_02 | 6
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
#!/usr/bin/node
// 'childprocess' help at:
// http://nodejs.org/api/child_process.html\
// #child_process_child_process_spawn_command_args_options
"use strict";
var b = require('bonescript'),
spawn = require('child_process').spawn;
var audioRate = 48000,
bufferSize = 4800,
format = "S16_LE"; // 16-bit signed, little endian
var audioIn = spawn(
"/usr/bin/arecord",
[
"-c2", "-r"+audioRate, "-f"+format, "-traw",
"--buffer-size="+bufferSize, "--period-size="+bufferSize, "-N"
]
);
var audioOut = spawn(
"/usr/bin/aplay",
[
"-c2", "-r"+audioRate, "-f"+format, "-traw",
"--buffer-size="+bufferSize, "--period-size="+bufferSize, "-N"
]
);
audioIn.stdout.on('data', function(data) {
audioOut.stdin.write(data);
});
audioIn.on('close', function(code) {
if(code !== 0) {
console.log('arecord process exited with code: ' + code);
audioOut.stdin.end();
}
})
audioOut.on('close', function(code) {
if(code !== 0) {
console.log('aplay process exited with code: ' + code);
}
})
\ No newline at end of file
/*
* Copyright (C) 2013 Nathaniel R. Lewis - http://nathanielrlewis.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Enable eQEP2 on the Beaglebone White and Black
* These pins don't conflict with the HDMI
*/
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "bone_eqep2";
version = "00A0";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
pinctrl_eqep2: pinctrl_eqep2_pins {
pinctrl-single,pins = <
0x038 0x24 /* P8_16 = GPIO2_12 = EQEP2_index, MODE4 */
0x03C 0x24 /* P8_15 = GPIO2_13 = EQEP2_strobe, MODE4 */
0x030 0x34 /* P8_12 = GPIO2_10 = EQEP2A_in, MODE4 */
0x034 0x34 /* P8_11 = GPIO2_11 = EQEP2B_in, MODE4 */
>;
};
};
};
fragment@1 {
target = <&epwmss2>;
__overlay__ {
status = "okay";
};
};
fragment@2 {
target = <&eqep2>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqep2>;
count_mode = < 0 >;
/* 0 - Quadrature mode, normal 90 phase offset cha & chb.
1 - Direction mode. cha input = clock, chb input = direction */
swap_inputs = < 0 >; /* Are chan A & chan B swapped? (0-no,1-yes) */
invert_qa = < 1 >; /* Should we invert the channel A input? */
invert_qb = < 1 >; /* Should we invert the channel B input?
These are inverted because my encoder outputs drive transistors
that pull down the pins */
invert_qi = < 0 >; /* Should we invert the index input? */
invert_qs = < 0 >; /* Should we invert the strobe input? */
status = "okay";
};
};
};
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment