Forum | Documentation | Website | Blog

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

Fix build errors

parent 384e833a
1 merge request!116Feedback mechanism, terms & condition modal, and BeagleY-AI updates
...@@ -13,5 +13,5 @@ PCIe ...@@ -13,5 +13,5 @@ PCIe
For software reference, you can see how PCIe is used on NVMe HATs. For software reference, you can see how PCIe is used on NVMe HATs.
* :ref:`beagley-ai-expansion-nvme` * :ref:`beagley-ai-expansion-nvme`
* :ref:`beagley-ai-imx219-csi-cameras` * :ref:`beagley-ai-connecting-imx219-csi-cameras`
* :ref:`beagley-ai-rtc` * :ref:`beagley-ai-using-rtc`
...@@ -6,9 +6,9 @@ Demos and tutorials ...@@ -6,9 +6,9 @@ Demos and tutorials
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
demos/using-rtc demos/beagley-ai-using-rtc
demos/expansion-nvme demos/beagley-ai-expansion-nvme
demos/pca9685-motor-drivers demos/beagley-ai-pca9685-motor-drivers
demos/arducam-imx219-v3link-dual-camera-kit demos/beagley-ai-arducam-imx219-v3link-dual-camera-kit
demos/connecting-imx219-csi-cameras demos/beagley-ai-connecting-imx219-csi-cameras
.. _beagley-ai-arducam-imx219-v3link-dual-camera-kit: .. _beagley-ai-arducam-imx219-v3link-dual-camera-kit:
.. note:: This page is a work in progress. Further drive testing and images will be added soon
Using the Arducam Dual V3Link Camera Kit Using the Arducam Dual V3Link Camera Kit
############################################ ############################################
.. todo:: This page is a work in progress. Further drive testing and images will be added soon
`The Arducam Dual V3Link Camera Kit <https://www.arducam.com/product/arducam-imx219-v3link-camera-kit-for-raspberry-pi/>`_ is an IMX219 based kit that leverages Texas Instruments' FPDLink technology to enable using two CSI cameras over a single port up to 15 meters away using twisted pair cables. `The Arducam Dual V3Link Camera Kit <https://www.arducam.com/product/arducam-imx219-v3link-camera-kit-for-raspberry-pi/>`_ is an IMX219 based kit that leverages Texas Instruments' FPDLink technology to enable using two CSI cameras over a single port up to 15 meters away using twisted pair cables.
.. image:: ../images/arducam_dual_1.jpg .. image:: ../images/arducam_dual_1.jpg
......
.. _beagley-ai-rtc: .. _beagley-ai-connecting-imx219-csi-cameras:
.. note:: This page is a work in progress. Further drive testing and images will be added soon
Using IMX219 CSI Cameras Using IMX219 CSI Cameras
############################ ############################
.. todo::
Need to add `gstreamer` and/or `cheese` commands to show how to make use of connected cameras.
To enable an IMX219 CSI camera, modify the following file: `/boot/firmware/extlinux/extlinux.conf` To enable an IMX219 CSI camera, modify the following file: `/boot/firmware/extlinux/extlinux.conf`
We can check the available list of Device Tree Overlays as such: We can check the available list of Device Tree Overlays as such:
...@@ -43,6 +44,7 @@ Your /boot/firmware/extlinux/extlinux.conf file should look something like this: ...@@ -43,6 +44,7 @@ Your /boot/firmware/extlinux/extlinux.conf file should look something like this:
Now reboot... Now reboot...
.. code:: console .. code:: console
debian@BeagleBone:~$ ls /dev/ | grep "video" debian@BeagleBone:~$ ls /dev/ | grep "video"
video0 video0
video1 video1
...@@ -56,6 +58,7 @@ Troubleshooting ...@@ -56,6 +58,7 @@ Troubleshooting
******************* *******************
.. code:: console .. code:: console
Found /extlinux/extlinux.conf Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf
beagley-ai microSD (extlinux.conf) beagley-ai microSD (extlinux.conf)
......
...@@ -51,8 +51,8 @@ Once logged in and at the terminal, make sure your system is up to date (a reboo ...@@ -51,8 +51,8 @@ Once logged in and at the terminal, make sure your system is up to date (a reboo
.. code:: console .. code:: console
sudo apt-get update && sudo apt-get full-upgrade -y sudo apt-get update && sudo apt-get full-upgrade -y
sudo reboot sudo reboot
Step 2. Verify that your NVMe drive is detected Step 2. Verify that your NVMe drive is detected
...@@ -102,9 +102,9 @@ The following 3 commands will change your U-boot prompt to boot from NVMe by def ...@@ -102,9 +102,9 @@ The following 3 commands will change your U-boot prompt to boot from NVMe by def
.. code:: bash .. code:: bash
sudo cp -v /opt/u-boot/bb-u-boot-beagley-ai/beagley-microsd-to-nvme /etc/default/beagle-flasher sudo cp -v /opt/u-boot/bb-u-boot-beagley-ai/beagley-microsd-to-nvme /etc/default/beagle-flasher
sudo beagle-flasher-boot-emmc-rootfs-nvme sudo beagle-flasher-boot-emmc-rootfs-nvme
sudo reboot sudo reboot
Enjoy NVMe speeds! Enjoy NVMe speeds!
================== ==================
......
.. _beagley-ai-rtc: .. _beagley-ai-using-rtc:
Using the on-board Real Time Clock (RTC) Using the on-board Real Time Clock (RTC)
################################################# #################################################
...@@ -17,18 +17,15 @@ Fortunately, BeagleY-AI comes with a built-in `DS1340 <https://www.analog.com/me ...@@ -17,18 +17,15 @@ Fortunately, BeagleY-AI comes with a built-in `DS1340 <https://www.analog.com/me
Required Hardware Required Hardware
********************** **********************
<<<<<<< HEAD
BeagleY provides a **1.00 mm pitch, 2-pin JST SH connector** for a coin cell battery to enable the RTC to keep time even if power is lost to the board. BeagleY provides a **1.00 mm pitch, 2-pin JST SH connector** for a coin cell battery to enable the RTC to keep time even if power is lost to the board.
=======
BeagleY-AI provides a **1.25 mm pitch, 2-pin JST GH connector** for a coin cell battery to enable the RTC to keep time even if power is lost to the board.
>>>>>>> 12aa969 (Using RTC review items)
These batteries are available from several vendors: These batteries are available from several vendors:
* `Raspberry Pi 5 RTC Battery via Adafruit <https://www.adafruit.com/product/5817>`_ * `Raspberry Pi 5 RTC Battery via Adafruit <https://www.adafruit.com/product/5817>`_
* `Raspberry Pi 5 RTC Battery via DigiKey <https://www.digikey.com/en/products/detail/raspberry-pi/SC1163/21658274>`_ * `Raspberry Pi 5 RTC Battery via DigiKey <https://www.digikey.com/en/products/detail/raspberry-pi/SC1163/21658274>`_
* `CR2023 battery holder for Pi 5 via Amazon <https://www.amazon.com/KODASW-RTCBattery-Holder-Include-Battery/dp/B0CRKQ2MG1/>`_ * `CR2023 battery holder for Pi 5 via Amazon <https://www.amazon.com/KODASW-RTCBattery-Holder-Include-Battery/dp/B0CRKQ2MG1/>`_
demos/connecting-imx219-csi-cameras
.. image:: ../images/beagley_rtc.png .. image:: ../images/beagley_rtc.png
Uses for an RTC Uses for an RTC
......
.. _beagley-ai-rtc:
.. note:: This page is a work in progress. Further testing and images will be added soon
Using the on-board Real Time Clock (RTC)
#################################################
Real Time Clocks (RTCs) provide precise and reliable timekeeping capabilities, which are beneficial for applications ranging from simple timekeeping to complex scheduling and secure operations.
Without an RTC, a computer must rely on something called Network Time Protocol (NTP) to obtain the current time from a network source. There are many cases however where an SBC such as BeagleY may not have
a constant or reliable network connection. In situations such as these, an RTC allows the board to keep time even if the network connection is severed or the board loses power for an extended period of time.
Fortunately, BeagleY-AI comes with a built-in `DS1340 <https://www.analog.com/media/en/technical-documentation/data-sheets/DS1340-DS1340C.pdf>`_ RTC for all your fancy time keeping needs!
Required Hardware
**********************
BeagleY provides a **1.25 mm pitch, 2-pin JST GH connector** for a coin cell battery to enable the RTC to keep time even if power is lost to the board.
These batteries are available from several vendors:
* Adafruit - `Link <https://www.adafruit.com/product/5817>`_
* DigiKey - `Link <https://www.digikey.com/en/products/detail/raspberry-pi/SC1163/21658274>`_
* Amazon (reusable battery holder) - `Link <https://www.amazon.com/KODASW-RTCBattery-Holder-Include-Battery/dp/B0CRKQ2MG1/>`_
.. image:: ../images/beagley_rtc.png
Uses for an RTC
**********************
1. **Maintaining Accurate Time:** RTCs provide an accurate clock that continues to run even when the SBC is powered down. This is crucial for maintaining the correct time and date across reboots.
2. **Timestamping:** Many applications need to know the current time for timestamping data, logs, or events. For example, IoT devices may need to log sensor data with precise timestamps.
3. **Scheduling Tasks:** In some applications, tasks need to be scheduled at specific times. An RTC allows the SBC to keep track of time accurately, ensuring that tasks are performed at the correct times.
4. **Network Synchronization:** If the SBC is part of a larger network, having an accurate time helps with synchronizing data and events across the network.
5. **Standby Power Efficiency:** Many RTCs operate with a very low power requirement and can keep time even when the rest of the board is in a low-power or sleep mode. This helps in reducing overall power consumption.
Reading time
**********************
.. note:: If you have not connected your BeagleY to a network so it can get time from an NTP server, you must set the time before being able to read it. If you don't do this first, you'll see errors.
Reading the current time on the RTC is achieved using the **hwclock** command.
.. code:: console
debian@BeagleY:~$ sudo hwclock
2024-05-10 00:00:02.224187-05:00
Setting time
**********************
You can set time manually by running the following command:
.. code:: console
hwclock --set --date "10/05/2024 21:01:05"
Diving Deeper
**********************
There are actually two different "times" that your Linux system keeps track of.
* System time, which can be read using the **date** or **timedatectl** commands
* RTC (hardware) time which can be read using the **hwclock** command shown above.
Comparing the time, we see something interesting, they're different!
You can just type "date" but the format will be different, so we add some extra instructions to match the format.
.. code:: console
debian@BeagleBone:~$ date +%Y-%m-%d' '%H:%M:%S.%N%:z
2024-05-10 21:06:50.058595373+00:00
debian@BeagleBone:~$ sudo hwclock
2024-05-10 21:06:56.692874+00:00
But why? We see here that our system and hardware clock are over 9 seconds apart!
Ok, in this particular case we set the HW clock slightly ahead to illustrate the point, but in real life "drift" is a real problem
that has to be dealt with. Environmental conditions like temperature or stray cosmic rays can cause electronics to become ever so slightly out of sync, and these effects only grow over time unless corrected. It's why RTCs and other fancier time keeping instruments implement various methods to help account for this
such as temperature compensated oscillators.
Let's fix our hardware clock. We assume here that the system clock is freshly synced over NTP so it's going to be our true time "source".
.. code:: console
debian@BeagleBone:~$ sudo hwclock --systohc
Let's write a simple script to get the two times, we'll call it **getTime.sh**:
.. code:: console
HWTIME=$(sudo hwclock)
echo "RTC - ${HWTIME} "
SYSTIME=$(date +%Y-%m-%d' '%H:%M:%S.%N%:z)
echo "SYS - ${SYSTIME} "
Now let's run it!
.. code:: console
debian@BeagleBone:~$ sudo chmod +x getTime.sh
debian@BeagleBone:~$ ./getTime.sh
RTC - 2024-05-10 21:52:58.374954+00:00
SYS - 2024-05-10 21:52:59.048442940+00:00
As we can see, we're still about a second off, but this is because it takes a bit of time to query the RTC via I2C.
If you want to learn more, the **Going Further** at the end of this article is a good starting point!
Troubleshooting
*******************
The most common error results from not having initialized the RTC at all.
This usually happens if the system is powered on without an RTC battery and without a network connection.
In such cases, you should be able to read the time after setting the time as follows:
.. code:: console
debian@BeagleBone:~$ sudo hwclock --systohc
debian@BeagleBone:~$ sudo hwclock
2024-05-10 21:06:56.692874+00:00
Going Further
*******************
Consider learning about topics such as time keeping over GPS and Atomic Clocks!
Some good YouTube Videos and sources for inspiration -
* `Network Time Protocol - Computerphile <https://www.youtube.com/watch?v=BAo5C2qbLq8>`_
* `Nanosecond Clock Sync - Jeff Geerling <https://www.youtube.com/watch?v=RvnG-ywF6_s>`_
* `Using GPS with PPS to synchronize clocks over the network <https://www.youtube.com/watch?v=7aTZ66ZL6Dk>`_
\ No newline at end of file
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