diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 188df7f0c37b15ac2a9431e8b8df13ef916c46ed..f0cd2064d1ade6cca266a8c986d8282d65986942 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,22 @@ cache: pages: script: - - apk add ttf-dejavu ttf-freefont - "./gitlab-build.sh" artifacts: paths: - public + except: + - tags + +docs: + tags: + - docs + script: + - "./gitlab-build.sh" + artifacts: + paths: + - public + only: + - tags + except: + - branches diff --git a/boards/beaglebone/ai-64/ch03.rst b/boards/beaglebone/ai-64/ch03.rst index 5071a9bda9a9f55cbb2761335f5d03bc59e7f738..711875b8488b9f24f33849a5dfa07f13b2aacd88 100644 --- a/boards/beaglebone/ai-64/ch03.rst +++ b/boards/beaglebone/ai-64/ch03.rst @@ -7,8 +7,8 @@ This section provides instructions on how to hook up your board. This beagle req Recommended adapters: -* 5V @ 3A `USB C power supply <https://www.digikey.com/en/products/detail/raspberry-pi/RPI-USB-C-power-supply-White-US/10258760>`_ adaptor for SBCs. -* 5V > 3A laptop/mobile adaptor with USB-C cable. +* 5V @ 3A `USB C power supply <https://www.digikey.com/en/products/detail/raspberry-pi/RPI-USB-C-power-supply-White-US/10258760>`_ adapter for SBCs. +* 5V > 3A laptop/mobile adapter with USB-C cable. All the :ref:`BeagleBone AI-64 connections ports` we will use in this chapter are shown in the figure below. @@ -24,8 +24,8 @@ All the :ref:`BeagleBone AI-64 connections ports` we will use in this chapter ar Methods of operation -------------------------- -1. Tethered to a PC, or -2. As a standalone development platform in a desktop PC configuration with a Display Port Monitor, power supply, keyboard, and mouse +1. Tethered to a PC +2. Standalone development platform in a PC configurtion using external peripherals .. _whats-in-the-box: @@ -37,7 +37,7 @@ In the box you will find three main items as shown in :ref:`bbai-64-pacakage`. * BeagleBone AI-64. * Instruction card. -Get yourself a USB-A to USB-C and you have a setup for the tethered scenario and creates an out of box experience where the board can be used immediately with no other equipment needed. +A USB-C to USB-C cable is not included bot recommended for the tethered scenario and creates an out of box experience where the board can be used immediately with no other equipment needed. .. _bbai-64-pacakage: @@ -54,19 +54,18 @@ Get yourself a USB-A to USB-C and you have a setup for the tethered scenario and Main Connection Scenarios ------------------------------- -This section will describe how to connect the board for use. This section is basically a slightly more detailed description of the Quick Start Guide that came in the box. There is also a Quick Start Guide document on the board that should also be referred to. The intent here is that someone looking to purchase the board will be able to read this section and get a good idea as to what the initial set up will be like. +This section describes how to connect and power the board and serves as a slightly more detailed description of the Quick Start Guide included in the box. -The board can be configured in several different ways, but we will discuss the two most common scenarios as described in the Quick Start Guide card that comes in the box. +The board can be configured in several different ways, but we will discuss the two most common scenarios. * Tethered to a PC via the USB cable - * ``Board is accessed as a storage drive and`` - * ``a virtual Ethernet connection.`` + * ``Board is accessed as a storage drive and virtual Ethernet connection.`` -* Standalone desktop +* Standalone Desktop * ``Display`` - * ``Keyboard and mouse`` + * ``Keyboard and Mouse`` * ``External 5V > 3A power supply`` Each of these configurations is discussed in general terms in the following sections. @@ -76,7 +75,7 @@ Each of these configurations is discussed in general terms in the following sect Tethered To A PC ------------------------- -In this configuration, the board is powered by the PC via the provided USB cable --no other cables are required. The board is accessed either as a USB storage drive or via the browser on the PC. You need to use either Firefox or Chrome on the PC, Internet Explorer will not work properly. :ref:`tethered-figure` shows this configuration. +In this configuration, the board is powered by the PC via a single USB cable. The board is accessed either as a USB storage drive or via the browser on the conected PC. You need to use either Firefox or Chrome on the PC, Internet Explorer will not work properly. .. _tethered-figure: @@ -87,7 +86,7 @@ In this configuration, the board is powered by the PC via the provided USB cable Fig: Tethered Configuration -At least 5V @ 3A is required to power the board, In most cases the PC may not be able to supply sufficient power for the board. You should always use an external 5V > 3A DC power supply connected to the barrel jack. +At least 5V @ 3A is required to power the board, In most cases the PC may not be able to supply sufficient power for the board unless the connection is made over a Type-C to Type-C cable. You should always use an external 5V > 3A DC power supply connected to the barrel jack if you are unsure that the system can provide the required power or are otherwise using a USB-A to Type-C cable which will always require power from the DC barrel jack. .. _connect-the-cable-to-the-board: @@ -200,16 +199,16 @@ Connecting Up the Board Fig: Connect miniDP-DP or active miniDP-HDMI cable to BeagleBone AI-64 -2. If you have an Display Port or HDMI monitor with HDMI-HDMI or DP-DP cable you can use adapters as shown in. :ref:`display-adaptors-figure`. +2. If you have an Display Port or HDMI monitor with HDMI-HDMI or DP-DP cable you can use adapters as shown in. :ref:`display-adapters-figure`. -.. _display-adaptors-figure: +.. _display-adapters-figure: -.. figure:: images/ch03/display-adaptors.jpg +.. figure:: images/ch03/display-adapters.jpg :width: 400px :align: center - :alt: Display adaptors + :alt: Display adapters - Fig: Display adaptors + Fig: Display adapters 3. If you have wired/wireless USB keyboard and mouse such as diff --git a/boards/beaglebone/black/ch10.rst b/boards/beaglebone/black/ch10.rst index 54ca74c52e9cb208835e956dae357c63214cf3ad..b43b23a51405b1c64b254aae14575f72a8988cb2 100644 --- a/boards/beaglebone/black/ch10.rst +++ b/boards/beaglebone/black/ch10.rst @@ -4,19 +4,27 @@ Pictures ############# -.. figure:: media/image91.jpg - :width: 476px - :height: 768px +.. figure:: images/DSC00481.png + :width: 768px + :height: 476px :align: center :alt: Top Side Top Side -.. figure:: media/image92.jpg - :width: 486px - :height: 764px +.. figure:: images/DSC00484.png + :width: 768px + :height: 476px :align: center :alt: Bottom Side Bottom Side +.. figure:: images/DSC00505.png + :width: 768px + :height: 768px + :align: center + :alt: 45 Degree Top + + 45 Degree Top + diff --git a/boards/beaglebone/black/images/DSC00481.png b/boards/beaglebone/black/images/DSC00481.png new file mode 100644 index 0000000000000000000000000000000000000000..a1e64761bd3a74b852dcff6c4d27e4101376fe9d Binary files /dev/null and b/boards/beaglebone/black/images/DSC00481.png differ diff --git a/boards/beaglebone/black/images/DSC00484.png b/boards/beaglebone/black/images/DSC00484.png new file mode 100644 index 0000000000000000000000000000000000000000..b108b44cb7094660ee67f360c70bff8941c515f0 Binary files /dev/null and b/boards/beaglebone/black/images/DSC00484.png differ diff --git a/boards/beaglebone/black/images/DSC00505.png b/boards/beaglebone/black/images/DSC00505.png new file mode 100644 index 0000000000000000000000000000000000000000..3b680930d60e8161e1607bd78b35990a0c15e162 Binary files /dev/null and b/boards/beaglebone/black/images/DSC00505.png differ diff --git a/boards/capes/relay.rst b/boards/capes/relay.rst index fe9b9b6a9b1426c32190c6ad242db8352699e39c..d59de3d91de8fa60a653b56a0f92d65d325faea8 100644 --- a/boards/capes/relay.rst +++ b/boards/capes/relay.rst @@ -3,7 +3,7 @@ BeagleBoard.org BeagleBone Relay Cape ##################################### -Relay Cape, as the name suggests, is a simple Cape with a relay on it. +Relay Cape, as the name suggests, is a simple Cape with relays on it. It contains four relays, each of which can be operated independently from the BeagleBone. .. image:: images/BeagleBoneRelayCapeA2-400x274.png @@ -22,7 +22,7 @@ Installation No special configuration is required. When you plug Cape into your BeagleBoard, it is automatically recognized by the Cape Universal function. -You can check to see if Relay Cape is recognized with the following command. +You can check to see if the Relay Cape is recognized with the following command. .. code-block:: @@ -41,14 +41,14 @@ by adding the following to the U-Boot options Usage -****** +***** .. code-block:: ls /sys/class/leds -The directory "relay*" exists in the following directory. -The LEDs can be controlled by modifying the files in this directory. +The directory "relay1", for instance, exists in the following directory. +The LEDs can be controlled by modifying the files in its directory. .. code-block:: @@ -58,4 +58,195 @@ This allows you to adjust the brightness; entering 1 for brightness turns it ON, and entering 0 for OFF. The four relays can be changed individually -by changing the number after "relay. +by changing the number after "relay" in /sys/class/leds/relay. + +Code to Get Started +******************* + +Currently, using sysfs in .c files, libgpiod-dev/gpiod in .c files, and +python3 files with the Relay Cape work well! + +* For instance, a kernel that I found to work is kernel: `5.10.140-ti-r52` + +* Another idea, an image I found that works is `BeagleBoard.org Debian Bullseye Minimal Image 2022-11-01` + +There are newer images and kernels if you want to update and there are older ones in case you +would like to go back in time to use older kernels and images for the Relay Cape. Please remember +that older firmware will work differently on the BBB or other related am335x SBC. + +C Source with File Descriptors +****************************** + +You can name this file GPIO.c and use gcc to handle compiling the source into a binary like so: + +`gcc GPIO.c -o GPIO` + +.. code-block:: + + /* + + This is an example of programming GPIO from C using the sysfs interface on + a BeagleBone Black/BeagleBone Black Wireless or other am335x board with the Relay Cape. + + Use the Relay Cape attached to the BBB for a change in seconds and then exit with CTRL-C. + + The original source can be found here by Mr. Tranter: https://github.com/tranter/blogs/blob/master/gpio/part5/demo1.c + + Jeff Tranter <jtranter@ics.com> + + and...Seth. I changed the source a bit to fit the BBB and Relay Cape while using sysfs. + + */ + + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> + #include <stdlib.h> + #include <sys/stat.h> + #include <sys/types.h> + #include <unistd.h> + + int main() + { + + // Export the desired pin by writing to /sys/class/leds/relay1/brightness + + int fd = open("/sys/class/leds/relay1/brightness", O_WRONLY); + if (fd == -1) { + perror("Unable to open /sys/class/leds/relay1/brightness"); + exit(1); + } + + fd = open("/sys/class/leds/relay1/brightness", O_WRONLY); + if (fd == -1) { + perror("Unable to open /sys/class/leds/relay1/brightness"); + exit(1); + } + + // Toggle LED 50 ms on, 50ms off, 100 times (10 seconds) + + for (int i = 0; i < 100; i++) { + if (write(fd, "1", 1) != 1) { + perror("Error writing to /sys/class/leds/relay1/brightness"); + exit(1); + } + usleep(50000); + + if (write(fd, "0", 1) != 1) { + perror("Error writing to /sys/class/leds/relay1/brightness"); + exit(1); + } + usleep(50000); + } + + close(fd); + + // And exit + return 0; + } + +C Source with LibGPIOd-dev and File Descriptors +*********************************************** + +Also...if you are looking to dive into the new interface, libgpiod-dev/gpiod.h, here is another form of +source that can toggle the same GPIO listed from the file descriptor. + +One thing to note: `sudo apt install cmake` + +1. mkdir GPIOd && cd GPIOd + +2. nano LibGPIO.c + +3. add the below source into the file LibGPIO.c + +.. code-block:: + + /* + Simple gpiod example of toggling a LED connected to a gpio line from + the BeagleBone Black Wireless and Relay Cape. + Exits with or without CTRL-C. + */ + + // This source can be found here: https://github.com/tranter/blogs/blob/master/gpio/part9/example.c + // It has been changed by me, Seth, to handle the RelayCape and BBBW Linux based SiP SBC. + + // kernel: 5.10.140-ti-r52 + // image : BeagleBoard.org Debian Bullseye Minimal Image 2022-11-01 + + // type gpioinfo and look for this line: line 20: "P9_41B" "relay1" output active-high [used] + // That line shows us the info. we need to make an educated decision on what fd we will use, i.e. relay1. + // We will also need to locate which chipname is being utilized. For instance: gpiochip0 - 32 lines: + + // #include <linux/gpio.h> + #include <gpiod.h> + #include <stdio.h> + #include <unistd.h> + + int main(int argc, char **argv) + { + const char *chipname = "gpiochip0"; + struct gpiod_chip *chip; + struct gpiod_line *lineLED; + + int i, ret; + + // Open GPIO chip + chip = gpiod_chip_open_by_name(chipname); + if (!chip) { + perror("Open chip failed\n"); + return 1; + } + + // Open GPIO lines + lineLED = gpiod_chip_get_line(chip, 20); + if (!lineLED) { + perror("Get line failed\n"); + return 1; + } + + // Open LED lines for output + ret = gpiod_line_request_output(lineLED, "relay1", 0); + if (ret < 0) { + perror("Request line as output failed\n"); + return 1; + } + + // Blink a LED + i = 0; + while (true) { + ret = gpiod_line_set_value(lineLED, (i & 1) != 0); + if (ret < 0) { + perror("Set line output failed\n"); + return 1; + } + usleep(1000000); + i++; + } + + // Release lines and chip + gpiod_line_release(lineLED); + gpiod_chip_close(chip); + return 0; + } + +4. mkdir build && touch CMakeLists.txt + +5. In CMakeLists.txt, add these values and text + +.. code-block:: + + cmake_minimum_required(VERSION 3.22) + + project(gpiod LANGUAGES C) + + add_executable(LibGPIO LibGPIO.c) + + target_link_libraries(LibGPIO gpiod) + +6. cd build && cmake .. + +7. make + +8. ./LibGPIO + +These are a few examples on how to use the RelayCape and am335x supported BBBW/BBB SBCs. \ No newline at end of file diff --git a/boards/terms-and-conditions.rst b/boards/terms-and-conditions.rst index 9540d4a2eb847dbf008180760428011e85b80377..8406f4837ba6c4ae55bd123349189ef483ada594 100644 --- a/boards/terms-and-conditions.rst +++ b/boards/terms-and-conditions.rst @@ -1,7 +1,7 @@ .. _boards-terms-and-conditions: -BeagleBoard.org general Terms & Conditions -########################################### +Terms & Conditions +################## DESIGN ******* @@ -212,14 +212,14 @@ back to a distributor without contacting rma/support. For up to date SW images and technical information refer to -https://beagleboard.org/latest-images +https://www.beagleboard.org/distros -All support for this board is provided via community support at -`BeagleBoard.org forum <https://forum.beagleboard.org/>`_ +All support for is provided via community support at +`https://forum.beagleboard.org <https://forum.beagleboard.org/>`_ -To return a defective board for repair, please request an RMA at +To return a defective board for repair, please request a return materials authorization (RMA) at https://www.beagleboard.org/rma diff --git a/books/pru-cookbook/02start/start.rst b/books/pru-cookbook/02start/start.rst index 3889fa931a3ef4757e2b94df5d521ca723af9aa3..12af13b8deb62f808ced7600eb06d2bedde8b954 100644 --- a/books/pru-cookbook/02start/start.rst +++ b/books/pru-cookbook/02start/start.rst @@ -285,14 +285,15 @@ it on your Beagle. .. code-block:: shell-session + bone$ cd /opt/source bone$ git clone https://git.beagleboard.org/beagleboard/pru-cookbook-code bone$ cd pru-cookbook-code + bone$ sudo ./install.sh bone$ ls -F 01case/ 03details/ 05blocks/ 07more/ README.md 02start/ 04details/ 06io/ 08ai/ -Each chapter has its own directory and within that directory -is a **code** directory that has all of the code. +Each chapter has its own directory that has all of the code. .. code-block:: shell-session @@ -334,8 +335,10 @@ to run it right now do the following. .. code-block:: shell-session + bone$ cd /opt/source bone$ git clone https://git.beagleboard.org/beagleboard/pru-cookbook-code bone$ cd pru-cookbook-code/02start + bone$ sudo ../install.sh .. tip:: @@ -351,14 +354,16 @@ Running Code on the Black or Pocket .. code-block:: shell-session bone$ make TARGET=hello.pru0 - /var/lib/cloud9/common/Makefile:28: MODEL=TI_AM335x_BeagleBone_Black,TARGET=hello.pru0,COMMON=/var/lib/cloud9/common - /var/lib/cloud9/common/Makefile:147: GEN_DIR=/tmp/cloud9-examples,CHIP=am335x,PROC=pru,PRUN=0,PRU_DIR=/sys/class/remoteproc/remoteproc1,EXE=.out + /opt/source/pru-cookbook-code/common/Makefile:27: MODEL=TI_AM335x_BeagleBone_Green_Wireless,TARGET=hello.pru0,COMMON=/opt/source/pru-cookbook-code/common - Stopping PRU 0 - - copying firmware file /tmp/cloud9-examples/hello.pru0.out to /lib/firmware/am335x-pru0-fw + CC hello.pru0.c + "/opt/source/pru-cookbook-code/common/prugpio.h", line 53: warning #1181-D: #warning directive: "Found else" + LD /tmp/vsx-examples/hello.pru0.o + - copying firmware file /tmp/vsx-examples/hello.pru0.out to /lib/firmware/am335x-pru0-fw + - Starting PRU 0 write_init_pins.sh writing "none" to "/sys/class/leds/beaglebone:green:usr3/trigger" - - Starting PRU 0 - MODEL = TI_AM335x_BeagleBone_Black + MODEL = TI_AM335x_BeagleBone_Green_Wireless PROC = pru PRUN = 0 PRU_DIR = /sys/class/remoteproc/remoteproc1 diff --git a/books/pru-cookbook/03details/details.rst b/books/pru-cookbook/03details/details.rst index 6dd6cdddefe28b7a1387198bd11809e45d3f6e83..82a71dfa9e3e0cabac245bce75c6b79f0135c703 100644 --- a/books/pru-cookbook/03details/details.rst +++ b/books/pru-cookbook/03details/details.rst @@ -34,8 +34,10 @@ It's all on a GitHub repository. .. code-block:: shell-session + bone$ cd /opt/source bone$ git clone https://git.beagleboard.org/beagleboard/pru-cookbook-code - + bone$ cd pru-cookbook-code + bone$ sudo ./install.sh .. note:: #TODO#: The version of code used needs to be noted in the documentation. @@ -166,23 +168,19 @@ Now you are ready to compile and run. This is automated for you in the Makefile .. code-block:: shell-session bone$ make - /var/lib/cloud9/common/Makefile:28: MODEL=TI_AM335x_BeagleBone_Black,TARGET=gpio.pru0,COMMON=/var/lib/cloud9/common - /var/lib/cloud9/common/Makefile:147: GEN_DIR=/tmp/cloud9-examples,CHIP=am335x,PROC=pru,PRUN=0,PRU_DIR=/sys/class/remoteproc/remoteproc1,EXE=.out + /opt/source/pru-cookbook-code/common/Makefile:27: MODEL=TI_AM335x_BeagleBone_Green_Wireless,TARGET=gpio.pru0,COMMON=/opt/source/pru-cookbook-code/common - Stopping PRU 0 - /bin/sh: 1: echo: echo: I/O error - Cannot stop 0 CC gpio.pru0.c - "/var/lib/cloud9/common/prugpio.h", line 53: warning #1181-D: #warning directive: "Found am335x" - LD /tmp/cloud9-examples/gpio.pru0.o - - copying firmware file /tmp/cloud9-examples/gpio.pru0.out to /lib/firmware/am335x-pru0-fw - write_init_pins.sh - writing "out" to "/sys/class/gpio/gpio30/direction" + "/opt/source/pru-cookbook-code/common/prugpio.h", line 53: warning #1181-D: #warning directive: "Found else" + LD /tmp/vsx-examples/gpio.pru0.o + - copying firmware file /tmp/vsx-examples/gpio.pru0.out to /lib/firmware/am335x-pru0-fw - Starting PRU 0 - MODEL = TI_AM335x_BeagleBone_Black + write_init_pins.sh + MODEL = TI_AM335x_BeagleBone_Green_Wireless PROC = pru PRUN = 0 PRU_DIR = /sys/class/remoteproc/remoteproc1 - rm /tmp/cloud9-examples/gpio.pru0.o + rm /tmp/vsx-examples/gpio.pru0.o Congratulations, your are now running a PRU. If you have an LED attached to ``P9_11`` on the Black, or ``P2_05`` on the Pocket, it should be blinking. diff --git a/index.rst b/index.rst index 9b46acf9ae6ba4ed76156ac66366704ee7fa439b..b2b1b365e18772431cda76a89fed33cff4cd59e4 100644 --- a/index.rst +++ b/index.rst @@ -315,7 +315,6 @@ Capes :hidden: :caption: Boards - /boards/terms-and-conditions.rst /boards/beaglebone/ai-64/index /boards/beaglebone/ai/index /boards/beaglebone/black/index @@ -325,6 +324,7 @@ Capes /boards/pocketbeagle/original/index /boards/beagleconnect/freedom/index /boards/beagleboard/index + /boards/terms-and-conditions.rst Projects diff --git a/projects/bb-config/detail.rst b/projects/bb-config/detail.rst index ff983d8d3f656f631ff3ce25a9da6c6c90fdc47a..c9269d4bf019061c67ab390fd16f968957051091 100644 --- a/projects/bb-config/detail.rst +++ b/projects/bb-config/detail.rst @@ -13,16 +13,15 @@ Configure your beagle devices easily. What is BB-Config ****************** -BB-Config is a software that makes the most common low-level -configuration changes in beagle devices easily and provides a +BB-Config is software that makes the most common low-level +configuration changes of beagle devices easily and provides a terminal UI. BB-Config is using `FTXUI <https://github.com/ArthurSonzogni/FTXUI>`_ (C++ Functional Terminal User Interface) -which have simple and elegant UI looking. +which provides a simple and elegant looking UI. -Look Like ========== .. image:: images/about.png :align: center - :alt: bb-config about \ No newline at end of file + :alt: bb-config about