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 [2020/03/23 12:07] – [Enable UIO PRU Driver] rathke | 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 ===== | 
| - | All of the following commands assume | + | First you need to download all the stuff for the PPL on the BeagleBone Black. | 
| + | In the home directory, execute | ||
| <code bash> | <code bash> | ||
| - | sudo -s -H | + | wget http://kn-pr.tkn.tu-berlin.de/ | 
| </ | </ | ||
| - | after booting the BeagleBone Black and logging | + | If you are unsure | 
| - | Otherwise you have to prefix every command with the word //sudo//. E.g. instead entering the command //apt-get update// enter the command | + | Now extract | 
| - | Now, after you have become superuser, ist is a good advice to update the operation system with new packages by entrain the command | + | <code bash> | 
| + | tar -xzf Beaglebone.tar.gz | ||
| + | </ | ||
| + | |||
| + | You will see a new directory called Beaglebone, containing additional directories: | ||
| <code bash> | <code bash> | ||
| - | apt-get update | + | ls Beaglebone | 
| + | dts spi SPI_test | ||
| </ | </ | ||
| - | and | + | 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: | ||
| <code bash> | <code bash> | ||
| - | apt-get upgrade | + | sudo -s -H | 
| </ | </ | ||
| - | This ensured | + | after booting | 
| + | |||
| + | 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//. | ||
| - | Looking carefully at the output of the //apt-get upgrade// command, you will recognize that an error occurs upgrading the dnsmasq package. This will result, that communication via the USB interface will not work correctly. To fix the error enter the following | + | Now, after you have become superuser, it is a good advice to update | 
| <code bash> | <code bash> | ||
| - | systemctl enable dnsmasq.service | + | apt-get update | 
| - | systemctl restart dnsmasq.service | + | apt-get upgrade | 
| </ | </ | ||
| - | If you have forgotten to enable | + | This ensures | 
| ===== Install additional Packages ===== | ===== Install additional Packages ===== | ||
| Line 44: | Line 57: | ||
| </ | </ | ||
| + | |||
| + | ===== Set Time Zone ===== | ||
| + | |||
| + | You may set the timezone to German standard time using the following command: | ||
| + | |||
| + | <code bash> | ||
| + | timedatectl set-timezone Europe/ | ||
| + | </ | ||
| + | |||
| + | Issue the '' | ||
| ===== Kernel Upgrade ===== | ===== Kernel Upgrade ===== | ||
| - | at the time of writing this memo, the lastest | + | At the time of writing this memo, the  kernel version | 
| - | To get the latest stable kernel release, that mostly | + | To update to the latest stable kernel release, that most likely | 
| <code bash> | <code bash> | ||
| Line 56: | Line 79: | ||
| </ | </ | ||
| - | Unfortunately, | + | Now boot the BeagleBone Black once again. | 
| - | + | ||
| - | <code bash> | + | |
| - | touch / | + | |
| - | </ | + | |
| - | + | ||
| - | This //touch// command creates an empty file, indicating not to change the dnsmasq configuration file at the boot process. | + | |
| <code bash> | <code bash> | ||
| Line 68: | Line 85: | ||
| </ | </ | ||
| - | After the reboot | + | After the reboot, let's check our new upgraded kernel: | 
| <code bash> | <code bash> | ||
| uname -a | uname -a | ||
| - | Linux beaglebone 4.4.155-ti-r155 #1 SMP Thu May 23 05:22:53 UTC 2019 armv7l GNU/Linux | + | Linux beaglebone 4.19.94-ti-r72 #1buster | 
| </ | </ | ||
| - | Now the kernel version //4.4.155-ti-r155// is installed. | + | Now the kernel version //4.19.94-ti-r72// is installed. | 
| ===== 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 | 
| - | To install | + | 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 | 
| - | <code bash> | + | 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: | 
| - | cd / | + | |
| - | </ | + | |
| - | Now, test if the device tree compiler is installed: | + | <imgcaption image1 | Wireing of BeagleBone Black with CC1200>{{:network_protocol_programming_lab:beaglebone-cc1200.png}}</imgcaption> | 
| - | + | ||
| - | <code bash> | + | |
| - | dtc --version | + | |
| - | Version: DTC 1.4.4 | + | |
| - | </ | + | |
| - | + | ||
| - | Update dtc by executing: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | ./dtc-overlay.sh | + | |
| - | </ | + | |
| - | + | ||
| - | Install the device tree overlay blobs: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | ./install.sh | + | |
| - | </code> | + | |
| ==== Disable HDMI ==== | ==== Disable HDMI ==== | ||
| - | The pins of HDMI are multiplexed with the pins of the SPI. In order to use the SPI, 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> | ||
| - | ## | + | disable_uboot_overlay_video=1 | 
| - | dtb=am335x-boneblack-emmc-overlay.dtb | + | |
| </ | </ | ||
| + | |||
| ==== Disable default pin configuration ==== | ==== Disable default pin configuration ==== | ||
| - | Per default the pins of the BeagleBone Black are wired for universal use, meaning the pins are connected to the common | + | Per default the pins of the BeagleBone Black are wired for universal use, meaning the pins are connected to the commonly | 
| - | To disable universal use, change | + | To disable universal use, comment out the following line in the file /// | 
| <code bash> | <code bash> | ||
| - | cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable | + | enable_uboot_cape_universal=1 | 
| </ | </ | ||
| - | to | ||
| - | |||
| - | <code bash> | ||
| - | cmdline=coherent_pool=1M net.ifnames=0 quiet | ||
| - | </ | ||
| ==== Reboot | ==== Reboot | ||
| To make the changes effective, reboot. | To make the changes effective, reboot. | ||
| - | To test, that the HDMI is disables | + | To test that HDMI is disabled, | 
| <code bash> | <code bash> | ||
| - | grep "pin 41" | + | grep "pin 41" / | 
| </ | </ | ||
| Line 142: | Line 136: | ||
| <code bash> | <code bash> | ||
| - | pin 41 (44e108a4.0) 0000002f pinctrl-single | + | pin 41 (PIN41) 44e108a4 | 
| </ | </ | ||
| - | If the Hex-code is not // | + | If the Hex-code is not // | 
| - | ===== Enable UIO PRU Driver | + | ==== PRU Driver ==== | 
| - | ((original source: | + | ((original source: | 
| - | The communication between ARM host processor | + | The communication between | 
| - | After booting | + | After booting | 
| <code bash> | <code bash> | ||
| lsmod | lsmod | ||
| + | |||
| Module | Module | ||
| - | pvrsrvkm | + | pru_rproc | 
| - | evdev 14151 1 | + | irq_pruss_intc | 
| - | uio_pdrv_genirq | + | pruss                  16384 | 
| - | uio                    10972 | + | pm33xx | 
| - | 8021q 24428 0 | + | wkup_m3_ipc | 
| - | garp 7497 1 8021q | + | wkup_m3_rproc | 
| - | mrp | + | remoteproc | 
| - | stp | + | virtio | 
| - | llc | + | pvrsrvkm | 
| - | usb_f_acm | + | virtio_ring | 
| - | u_serial | + | pruss_soc_bus | 
| - | usb_f_ecm | + | usb_f_acm | 
| - | usb_f_mass_storage | + | u_serial | 
| - | usb_f_rndis | + | usb_f_ncm | 
| - | u_ether | + | usb_f_mass_storage | 
| - | libcomposite | + | uio_pdrv_genirq | 
| - | spidev | + | uio 20480 1 uio_pdrv_genirq | 
| - | tieqep | + | usb_f_rndis | 
| - | pru_rproc | + | u_ether | 
| - | pruss_intc | + | libcomposite | 
| - | pruss                  12346  1 pru_rproc | + | |
| </ | </ | ||
| - | and looking | + | Looking | 
| - | ==== Device tree modifications to enable | + | |
| + | === Enable | ||
| - | Go to the directory: | + | We need to instruct | 
| <code bash> | <code bash> | ||
| - | cd /opt/source/dtb-4.4-ti/ | + | uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo | 
| </ | </ | ||
| - | Now, modify | + | We should also disable | 
| <code bash> | <code bash> | ||
| - | /* #include " | + | uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo | 
| - | #include " | + | |
| - | </ | + | |
| - | + | ||
| - | After editing is finished, compile the device tree files by | + | |
| - | + | ||
| - | <code bash> | + | |
| - | make | + | |
| - | </ | + | |
| - | + | ||
| - | and install the device tree binary by | + | |
| - | + | ||
| - | <code bash> | + | |
| - | make install | + | |
| </ | </ | ||
| - | In the last step, the binary device tree must be enables in the file /// | ||
| - | If not already done look at [[network_protocol_programming_lab: | ||
| - | ==== Disabling | + | === Disable | 
| - | Finally | + | Finally the Remoteproc driver must be disabled | 
| - | editing the file /// | + | |
| Remove the line '// | Remove the line '// | ||
| Line 232: | 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> | ||
| lsmod | lsmod | ||
| + | |||
| Module | Module | ||
| - | pvrsrvkm | + | pm33xx | 
| - | uio_pruss | + | wkup_m3_ipc | 
| - | evdev 14151 1 | + | wkup_m3_rproc | 
| - | uio_pdrv_genirq | + | remoteproc | 
| - | uio                    10972 | + | virtio | 
| - | usb_f_acm | + | virtio_ring | 
| - | u_serial | + | pvrsrvkm | 
| - | usb_f_ecm | + | uio_pruss | 
| - | 8021q 24428 0 | + | usb_f_acm | 
| - | garp 7497 1 8021q | + | u_serial | 
| - | mrp | + | uio_pdrv_genirq | 
| - | stp | + | usb_f_ncm | 
| - | llc | + | uio 20480 2 uio_pruss,uio_pdrv_genirq | 
| - | usb_f_mass_storage | + | usb_f_mass_storage | 
| - | usb_f_rndis | + | usb_f_rndis | 
| - | u_ether | + | u_ether | 
| - | libcomposite | + | libcomposite | 
| - | tieqep | + | </ | 
| + | 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 ~/ | ||
| </ | </ | ||
| - | Now only //UIO PRU// drivers are loaded and no //Remoreproc// drivers. | + | 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: | ||
| + | </code> | ||
| + | |||
| + | 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: | ||
| + | </ | ||




