Forum | Documentation | Website | Blog

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

Merge branch 'main' of git.beagleboard.org:docs/docs.beagleboard.io

parents 1fc69351 62b36760
Branches
Tags
No related merge requests found
Pipeline #5270 passed with stage
in 8 minutes and 5 seconds
......@@ -69,6 +69,8 @@ into the Visual Studio Code IDE environment.
A big part of what is missing here is to put your BeaglePlay on the Internet such
that we can download things in later steps. That has been initially brushed over.
.. _zephyr_flash_radio :
Flash existing IEEE 802.15.4 radio bridge (WPANUSB) firmware
************************************************************
......@@ -111,13 +113,23 @@ Steps
#. Download and flash the `WPANUSB` Zephyr application firmware onto the CC1352P7 on BeaglePlay from the `releases on git.beagleboard.org <https://git.beagleboard.org/beagleconnect/zephyr/zephyr/-/releases>`_ or `distros on www.beagleboard.org/distros <https://www.beagleboard.org/distros>`_.
.. code-block:: bash
.. code-block:: shell-session
cd
wget https://files.beagle.cc/file/beagleboard-public-2021/images/download
unzip download
build/play/cc2538-bsl.py build/play/wpanusb
.. note::
I got a `File Not Found` error on the ``wget`` command above. If it doesn't
work for you try:
.. code-block:: shell-session
bone:~$ wget https://files.beagle.cc/file/beagleboard-public-2021/images/zephyr-beagle-cc1352-0.2.2.zip
bone:~$ unzip zephyr-beagle-cc1352-0.2.2.zip
bone:~$ build/play/cc2538-bsl.py build/play/wpanusb
#. Ensure the `bcfserial` driver is set to load.
.. code-block:: bash
......
books/beaglebone-cookbook/11misc/figures/gateway-start.png

439 KiB

books/beaglebone-cookbook/11misc/figures/wireshark_ping.png

192 KiB

......@@ -7,6 +7,151 @@ Misc
Here are bits and pieces of ideas that are being developed.
BeagleConnect Freedom
=====================
Here are some notes on how to setup and use the Connect.
First get the flasher image from:
https://rcn-ee.net/rootfs/debian-arm64-11-bullseye-home-assistant-v5.10-ti/2023-07-20/
Flash the eMMC (which also loads the cc1352 with
the correct firmware)
Here's Jason's demo at the 2023 EOSS:
https://youtu.be/ZT9GEs3_ZYU?t=2195
.. figure:: figures/gateway-start.png
:align: center
:alt: beagleconnect-start-gateway
beagleconnect-start-gateway
.. code-block:: shell-session
bone$ sudo beagleconnect-start-gateway
setting up wpanusb gateway for IEEE 802154 CHANNEL 1(906 Mhz)
RTNETLINK answers: File exists
RTNETLINK answers: Device or resource busy
PING 2001:db8::1(2001:db8::1) from fe80::212:4b00:29b9:9884%lowpan0 lowpan0: 56 data bytes
64 bytes from 2001:db8::1: icmp_seq=1 ttl=64 time=70.0 ms
64 bytes from 2001:db8::1: icmp_seq=2 ttl=64 time=66.6 ms
64 bytes from 2001:db8::1: icmp_seq=3 ttl=64 time=37.6 ms
64 bytes from 2001:db8::1: icmp_seq=4 ttl=64 time=37.6 ms
64 bytes from 2001:db8::1: icmp_seq=5 ttl=64 time=37.6 ms
--- 2001:db8::1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 37.559/49.868/70.035/15.084 ms
Useful Links
------------
https://docs.micropython.org/en/latest/zephyr/quickref.html
https://docs.zephyrproject.org/latest/boards/arm/beagle_bcf/doc/index.html
micropython Examples
--------------------
Here is the output from running the examples from here:
https://docs.beagleboard.org/latest/boards/beagleconnect/freedom/demos-and-tutorials/using-micropython.html
Plug the BeagleConnect Freedom into the USB on the Play.
.. code-block:: shell-session
bone:~$ sudo systemd-resolve --set-mdns=yes --interface=lowpan0
bone:~$ avahi-browse -r -t _zephyr._tcp
+ lowpan0 IPv6 zephyr _zephyr._tcp local
= lowpan0 IPv6 zephyr _zephyr._tcp local
hostname = [zephyr.local]
address = [2001:db8::1]
port = [12345]
txt = []
bone:~$ avahi-resolve -6 -n zephyr.local
zephyr.local 2001:db8::1
bone:~$ mcumgr conn add bcf0 type="udp" connstring="[2001:db8::1%lowpan0]:1337"
Connection profile bcf0 successfully added
bone:~$ mcumgr -c bcf0 image list
Images:
image=0 slot=0
version: hu.hu.hu
bootable: true
flags: active confirmed
hash: 16a97391d2570eae80667cfd8c475cb051d4a4a600430b64cb52b59f5db4ce22
Split status: N/A (0)
bone:~$ mcumgr -c bcf0 shell exec "device list"
status=0
devices:
- GPIO_0 (READY)
- random@40028000 (READY)
- UART_1 (READY)
- UART_0 (READY)
- i2c@40002000 (READY)
- I2C_0S (READY)
requires: GPIO_0
requires: i2c@40002000
- flash-controller@40030000 (READY)
- spi@40000000 (READY)
requires: GPIO_0
- ieee802154g (READY)
- gd25q16c@0 (READY)
requires: spi@40000000
- leds (READY)
- HDC2010-HUMIDITY (READY)
requires: I2C_0S
-
bone:~$ mcumgr -c bcf0 shell exec "net iface"
status=0
Hostname: zephyr
Interface 0x20002de4 (IEEE 802.15.4) [1]
========================================
Link addr : 3D:9A:B9:29:00:4B:12:00
MTU : 125
Flags : AUTO_START,IPv6
IPv6 unicast addresses (max 3):
fe80::3f9a:b929:4b:1200 autoconf preferred infinite
2001:db8::1 manual preferred infinite
IPv6 multicast addresses (max 4):
ff02::1
ff02::1:ff4b:1200
ff02::1:ff00:1
bone:~$ tio /dev/ttyACM0
Press the ``RST`` button on the Connect.
.. code-block:: shell-session
I: gd25q16c@0: SFDP v 1.6 AP ff with 2 PH
I: PH0: ff00 rev 1.6: 16 DW @ 30
I: gd25q16c@0: 2 MiBy flash
I: PH1: ffc8 rev 1.0: 3 DW @ 90
*** Booting Zephyr OS build zephyr-v3.2.0-3470-g14e193081b1f ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: primary slot
I: Swap type: none
I: Bootloader chainload address offset: 0x20000
I: Jumping to the first image slot
[00:00:00.001,464] <inf> spi_nor: gd25q16c@0: SFDP v 1.6 AP ff with 2 PH
[00:00:00.001,464] <inf> spi_nor: PH0: ff00 rev 1.6: 16 DW @ 30
[00:00:00.001,983] <inf> spi_nor: gd25q16c@0: 2 MiBy flash
[00:00:00.002,014] <inf> spi_nor: PH1: ffc8 rev 1.0: 3 DW @ 90
uart:~$ build time: Feb 22 2023 08:09:25MicroPython v1.19.1 on 2023-02-22; zephyr-beagleconnect_freedom with unknown-cpu
Type "help()" for more information.
>>>
.. _misc_shortcuts:
Setting up shortcuts to make life easier
......@@ -208,11 +353,41 @@ packets to the named pipe:
.. code-block::
host$ ssh root@bone "tcpdump -s 0 -U -n -w - -i eth0 not port 22" > /tmp/remote
host$ ssh root@192.168.7.2 "tcpdump -s 0 -U -n -w - -i any not port 22" > /tmp/remote
.. tip::
For this to work you will need to follow in instructions in :ref:`root_login`.
Sharking the wpan radio
-----------------------
Now that you have Wireshark set up, you can view traffice from the Play's
wpan radio. First, set up the network by running:
.. code-block:: shell-session
bone:~$ beagleconnect-start-gateway
Go to Wireshark and in the field that says `Apply a display filter...` enter,
``wpan || 6lowpan || ipv6``. This will dispaly three types of packets.
Be sure to hit Enter.
Now generate some traffic:
.. code-block:: shell-session
bone:~$ ping6 -I lowpan0 2001:db8::1 -c 5 -p ca11ab1ebeef
.. _wireshark_ping:
.. figure:: figures/wireshark_ping.png
:align: center
:alt: Wireshark ping6 -I lowpan0 2001:db8::1 -c 5 -p ca11ab1ebeef
Wireshark ping6 -I lowpan0 2001:db8::1 -c 5 -p ca11ab1ebeef
You can see the pattern ``ca11ab1ebeef`` appears in the packets.
Converting a tmp117 to a tmp114
================================
......@@ -862,6 +1037,11 @@ the Play will boot from the micro SD card.
Booting for the Developer
-------------------------
.. tip::
These diagrams might help:
https://github.com/u-boot/u-boot/blob/6e8fa0611f19824e200fe4725f18bce7e2000071/doc/board/ti/k3.rst
If you are developing firmware for the Play you may need to have
access to the processor early in the booting sequence. Much can
happen before the Linux kernel starts its boot process.
......
......@@ -10,6 +10,7 @@ BeagleBoard Docs
.. toctree::
intro/blinkLED
intro/index.rst
boards/beagleplay/index
boards/beaglebone/ai-64/index
......
......@@ -30,6 +30,7 @@ Get started engaging the BeagleBoard.org developer community by reading our :ref
:hidden:
:caption: Introduction
/intro/blinkLED
/intro/support/index
/intro/beagle101/index
/intro/contribution/index
......
..
BeagleBoard projects Blink LED demo
.. _blinkLED:
Blink LED
#########
The "Hello World!" of the embedded world is to blink an LED.
Here we'll show you how to do just that in three simple steps.
#. Plug in the Beagle
#. Log into the Beagle
#. Blink the LED
These steps will work for any of the Beagles.
Plug in the Beagle
------------------
For this step you need to get a USB cable and attach your Beagle
to your host computer with it.
Once attached you will see some LEDs blinking.
Wait a bit and the blinking will settle down to a steady
heart beat.
The Beagle is now up and running, but you didn't have to
load up Linux. This is because all Beagles
(except the PocketBeagle, see :ref:`flash-latest-image`
to install an image on the Pocket) have built-in flash memory
that has the Debian distribution of Linux preinstalled.
Login
-----
Next you login to the Beagle from your host computer.
This is slightly different if you host is running Windows.
Login from Windows
^^^^^^^^^^^^^^^^^^
If you are running Window you need to run an ``ssh`` client
to connect to the Beagle. I suggest you use ``putty``.
You can download it here: https://www.putty.org/.
Once installed, launch it and connect to your Beagle
by sshing to ``192.168.7.2``.
.. figure:: putty.png
Login with user ``debian``
and password ``temppwd``.
Login from Linux
^^^^^^^^^^^^^^^^
If you are running a Linux host, open a terminal widow and run
.. code-block:: shell-session
host:~$ ssh debian@192.168.7.2
Use password ``temppwd``.
Blink an LED
------------
Once logged in the rest is easy. First:
.. code-block:: shell-session
bone:~$ cd /sys/class/LEDs
bone:~$ ls
beaglebone:green:usr0 beaglebone:green:usr2 mmc0::
beaglebone:green:usr1 beaglebone:green:usr3 mmc1::
Here you see a list of LEDs. Your list may be slightly
different depending on which Beagle you are running.
You can blink any of them. Let's try ``usr1``.
.. code-block:: shell-session
bone:~$ cd beaglebone\:green\:usr1/
bone:~$ ls
brightness device max_brightness power subsystem trigger uevent
bone:~$ echo 1 > brightness
bone:~$ echo 0 > brightness
When you echo 1 into ``brightness`` the LED turns on.
Echoing a 0 turns it off. Congratulations, you've blinked
your first LED!
Blinking other LEDs
-------------------
You can blink the other LEDs by changing in to thier
directories and doing the same.
.. code-block:: shell-session
bone:~$ cd ../beaglebone\:green\:usr0/
bone:~$ echo 1 > brightness
bone:~$ echo 0 > brightness
Did you notice that LED ``usr0`` blinks on it's own in a
heartbeat pattern? You can set an LED trigger. Here's
what triggers you can set:
.. code-block:: shell-session
bone:~$ cat trigger
none usb-gadget usb-host rfkill-any rfkill-none
kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock
kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock
kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock
timer oneshot disk-activity disk-read disk-write i
de-disk mtd nand-disk [heartbeat] backlight gpio c
pu cpu0 cpu1 cpu2 cpu3 activity default-on panic
netdev mmc0 mmc1 mmc2 phy0rx phy0tx phy0assoc phy0radio
rfkill0 gpio-0:00:link gpio-0:00:1Gbps gpio-0:00:100Mbps
gpio-0:00:10Mbps gpio-0:01:link gpio-0:01:10Mbps
bone:~$ echo none > trigger
Notice ``[heartbeat]`` is in brackets. This shows it's the
current trigger. The echo changes the trigger to ``none``.
Try experimenting with some of the other triggers and see if you
can figure them out.
Another way to Blink an LED
---------------------------
An interesting thing about Linux is there are often many ways
to do the same thing. FOr example, I can think of at least six ways to blink
an LED. Here's another way using the ``gpiod`` system.
.. code-block:: shell-session
bone:~$ gpioinfo | grep -e chip -ie led
gpiochip0 - 32 lines:
gpiochip1 - 32 lines:
line 21: "[usr0 led]" "beaglebone:green:usr0" output active-high [used]
line 22: "[usr1 led]" "beaglebone:green:usr1" output active-high [used]
line 23: "[usr2 led]" "beaglebone:green:usr2" output active-high [used]
line 24: "[usr3 led]" "beaglebone:green:usr3" output active-high [used]
gpiochip2 - 32 lines:
gpiochip3 - 32 lines:
Here we asked how the LEDs are attached to the General Purpose
IO (gpio) system. The answer is, (yours will be different for a
different Beagle)
there are four interface chips and the LEDs are attached to
chip 1. You can control the gpios (and thus the LEDs) using
the ``gpioset`` command.
.. code-block:: shell-session
bone:~$ gpioset --mode=time --sec=2 1 22=1
bone:~$ gpioset --mode=time --sec=2 1 22=0
The first command sets chip 1, line 22 (the usr1 led) to 1 (on) for
2 seconds. The second command turns it off for 2 seconds.
Try it for the other LEDs.
.. note::
This may not work on all Beagles since it depends on which
version of Debian you are running.
intro/putty.png

19.5 KiB

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