Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| network_protocol_programming_lab:3_preparedebian [2022/04/14 13:53] – fangenoorth | network_protocol_programming_lab:3_preparedebian [2022/04/14 16:51] (current) – [Final Test] fangenoorth | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Debian Preparation for PPL ====== | ====== Debian Preparation for PPL ====== | ||
| - | ===== Get Package Updates | + | ===== Get PPL Files for BeagleBone Black ===== | 
| + | |||
| + | First you need to download all the stuff for the PPL on the BeagleBone Black. | ||
| + | In the home directory, execute the following command: | ||
| + | |||
| + | <code bash> | ||
| + | wget http:// | ||
| + | </ | ||
| + | |||
| + | If you are unsure in which directory you currently are, execute the '' | ||
| + | |||
| + | Now extract the archive by executing the command: | ||
| + | |||
| + | <code bash> | ||
| + | tar -xzf Beaglebone.tar.gz | ||
| + | </ | ||
| + | |||
| + | You will see a new directory called Beaglebone, containing additional directories: | ||
| + | |||
| + | <code bash> | ||
| + | ls Beaglebone | ||
| + | dts spi SPI_test | ||
| + | </ | ||
| + | |||
| + | We will need these later. For now let's focus on the proper setup and configuration of the Debian operating system that is required for this lab. | ||
| + | |||
| + | |||
| + | ===== Update Packages | ||
| All of the following commands assume to be executed by the superuser. To become superuser, you have to enter the command: | All of the following commands assume to be executed by the superuser. To become superuser, you have to enter the command: | ||
| Line 13: | Line 40: | ||
| Otherwise you have to prefix every command with the word //sudo//. E.g. instead entering the command //apt-get update// enter the command //sudo apt-get update//. | Otherwise you have to prefix every command with the word //sudo//. E.g. instead entering the command //apt-get update// enter the command //sudo apt-get update//. | ||
| - | Now, after you have become superuser, it is a good advice to update the operating system with new packages by entering the command: | + | Now, after you have become superuser, it is a good advice to update the operating system with new packages by entering the commands: | 
| <code bash> | <code bash> | ||
| apt-get update | apt-get update | ||
| - | </ | ||
| - | |||
| - | and | ||
| - | |||
| - | <code bash> | ||
| apt-get upgrade | apt-get upgrade | ||
| </ | </ | ||
| Line 38: | Line 60: | ||
| ===== Set Time Zone ===== | ===== Set Time Zone ===== | ||
| - | You can set the timezone to German standard time using the following command: | + | You may set the timezone to German standard time using the following command: | 
| <code bash> | <code bash> | ||
| Line 63: | Line 85: | ||
| </ | </ | ||
| - | After the reboot let's check our new upgraded kernel: | + | After the reboot, let's check our new upgraded kernel: | 
| <code bash> | <code bash> | ||
| Line 71: | Line 93: | ||
| Now the kernel version // | Now the kernel version // | ||
| + | |||
| ===== Device tree modifications ===== | ===== Device tree modifications ===== | ||
| ==== Device tree compiler and overlays ==== | ==== Device tree compiler and overlays ==== | ||
| - | In PPL, we need an device tree overlay | + | In PPL, we need to configure the device tree of the system. A device tree dynamically((dynamically in this context means without having | 
| - | The device tree overlay | + | In the following we will instruct the bootloader (called U-Boot) to load some device tree overlays during boot, which are required to configure the hardware peripherals to fit our needs. You will also compile and install a custom | 
| + | In first versions the wiring was made by hand. Today an adapter card is used. The wiring is shown in Fig. 1 and described [[network_protocol_programming_lab: | ||
| < | < | ||
| - | |||
| - | To install these things go to directory and update the scripts first: | ||
| - | |||
| - | <code bash> | ||
| - | cd / | ||
| - | git pull | ||
| - | </ | ||
| - | |||
| - | Now, test if the device tree compiler is installed: | ||
| - | |||
| - | <code bash> | ||
| - | dtc --version | ||
| - | Version: DTC 1.4.7 | ||
| - | </ | ||
| - | |||
| - | Update dtc by executing: | ||
| - | |||
| - | <code bash> | ||
| - | ./ | ||
| - | </ | ||
| - | |||
| - | Install the device tree overlay blobs: | ||
| - | |||
| - | <code bash> | ||
| - | ./ | ||
| - | </ | ||
| ==== Disable HDMI ==== | ==== Disable HDMI ==== | ||
| - | The pins of HDMI are multiplexed with the pins of the SPI bus. In order to use the SPI bus, the HDMI pins must be disabled by uncommenting the following line in the file /// | + | The pins of HDMI port are multiplexed with the pins of the SPI bus. In order to use the SPI bus, the HDMI pins must be disabled by uncommenting the following line in the file /// | 
| <code bash> | <code bash> | ||
| Line 141: | Line 139: | ||
| </ | </ | ||
| - | If the Hex-code is not // | + | If the Hex-code is not // | 
| - | ===== Enable UIO PRU Driver | + | ==== PRU Driver ==== | 
| ((original source: https:// | ((original source: https:// | ||
| - | The communication between the ARM host processor and the PRU (Programmable Realtime Unit) is implemented either by the Remoteproc-Driver or the UIO PRU Driver. Per default the Remoreproc | + | The communication between the ARM host processor and the PRU (Programmable Realtime Unit) is implemented either by the Remoteproc-Driver or the UIO PRU driver. Per default the Remoteproc | 
| After booting a fresh Debian image and executing the command: | After booting a fresh Debian image and executing the command: | ||
| Line 177: | Line 175: | ||
| </ | </ | ||
| - | and looking | + | Looking | 
| - | ==== Enable UIO PRU driver | + | === Enable UIO PRU driver === | 
| - | We need to instruct the bootloader to load a device tree overlay blob which enables the UIO driver. This can be done by uncommenting the the following line in the file /// | + | We need to instruct the bootloader to load the device tree overlay blob which enables the UIO driver. This can be done by uncommenting the the following line in the file /// | 
| <code bash> | <code bash> | ||
| Line 187: | Line 185: | ||
| </ | </ | ||
| - | We should also disable the device tree overlay for the unused rproc driver by commenting out the following line in the same file: | + | We should also disable the overlay for the unused rproc driver by commenting out the following line in the same file: | 
| <code bash> | <code bash> | ||
| Line 194: | Line 192: | ||
| - | ==== Disabling | + | === Disable | 
| Finally the Remoteproc driver must be disabled by editing the file /// | Finally the Remoteproc driver must be disabled by editing the file /// | ||
| Line 213: | Line 211: | ||
| </ | </ | ||
| - | ==== Test ==== | + | === Test UIO driver | 
| - | To check, if the device tree file has been loaded correctly, execute | + | To verify that the device tree modifications have been loaded correctly, execute: | 
| <code bash> | <code bash> | ||
| Line 241: | Line 239: | ||
| Now only //UIO PRU// drivers are loaded and no //rproc// drivers. | Now only //UIO PRU// drivers are loaded and no //rproc// drivers. | ||
| + | |||
| + | |||
| + | ==== Install the PPL Device Tree Overlay ==== | ||
| + | |||
| + | For PPL the CC1200 is connected to the SPI bus of the BeagleBone Black and the SPI bus is controlled by the PRU. | ||
| + | Therefore we have to tell the Linux kernel how exactly the CC1200 is wired with the PRU and the system. This is described in a device tree overlay file which you have downloaded in the very first step of this chapter. Change to the directory where you have downloaded the ppl files to, e.g.: | ||
| + | |||
| + | <code bash> | ||
| + | cd ~/ | ||
| + | </ | ||
| + | |||
| + | Directory //dts// contains the file // | ||
| + | |||
| + | <code bash> | ||
| + | dtc -O dtb -o BB-BONE-CC1200-00A0.dtbo -b 0 -@ BB-BONE-CC1200-00A0.dts | ||
| + | </ | ||
| + | |||
| + | During the compilation you can safely ignore warnings like | ||
| + | <code bash> | ||
| + | BB-BONE-CC1200-00A0.dtbo: | ||
| + | </ | ||
| + | |||
| + | //dtc// is the device tree compiler, which produces the bizarre overlay file // | ||
| + | |||
| + | <code bash> | ||
| + | cp BB-BONE-CC1200-00A0.dtbo / | ||
| + | </ | ||
| + | |||
| + | Now that we have compiled the device tree overlay and placed it in the right location, we have to instruct the bootloader to load this custom overlay. To do so open the file /// | ||
| + | |||
| + | <code bash> | ||
| + | ###Custom Cape | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | Uncomment this line and edit it so that it loads our own device tree overlay blob: | ||
| + | |||
| + | <code bash> | ||
| + | dtb_overlay=/ | ||
| + | </ | ||
| + | |||
| + | After that, reboot. | ||
| + | |||
| + | ===== Final Test ===== | ||
| + | |||
| + | After all that is done we can do a final test to verify that all the hardware is configured correctly. | ||
| + | |||
| + | Execute the command as root and inspect its output: | ||
| + | |||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | It should look like the following: | ||
| + | |||
| + | < | ||
| + | UBOOT: Booted Device-Tree: | ||
| + | UBOOT: Loaded Overlay: | ||
| + | UBOOT: Loaded Overlay: | ||
| + | UBOOT: Loaded Overlay: | ||
| + | uboot_overlay_options: | ||
| + | uboot_overlay_options: | ||
| + | uboot_overlay_options: | ||
| + | uboot_overlay_options: | ||
| + | cmdline: | ||
| + | </ | ||
| + | |||
| + | If you see any of the following lines in the output, something went wrong. Redo the above steps in this case. | ||
| + | |||
| + | < | ||
| + | UBOOT: Booted Device-Tree: | ||
| + | UBOOT: Loaded Overlay: | ||
| + | UBOOT: Loaded Overlay: | ||
| + | uboot_overlay_options: | ||
| + | uboot_overlay_options: | ||
| + | </ | ||




