Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| network_protocol_programming_lab:4_prepareppl [2022/04/12 16:54] – [SPI Library] fangenoorth | network_protocol_programming_lab:4_prepareppl [2022/04/18 17:40] (current) – fangenoorth | ||
|---|---|---|---|
| Line 22: | Line 22: | ||
| To avoid damage of devices, the colors shown must match. Also take care of the pins. They should be firmly fixed. | To avoid damage of devices, the colors shown must match. Also take care of the pins. They should be firmly fixed. | ||
| - | ===== Get PPL Files for BeagleBone Black ===== | ||
| - | |||
| - | First leave the root shell you have used in the previous steps by entering //exit// and continue as a regular user. | ||
| - | |||
| - | To get all the stuff for the PPL on the BeagleBone Black, go to your favorite directory (e.g. /// | ||
| - | |||
| - | <code bash> | ||
| - | wget http:// | ||
| - | </ | ||
| - | |||
| - | Extract the archive by executing the command: | ||
| - | |||
| - | <code bash> | ||
| - | tar -xzf Beaglebone.tar.gz | ||
| - | </ | ||
| - | |||
| - | Now you will see a new directory called Beaglebone, containing additional directories: | ||
| - | |||
| - | <code bash> | ||
| - | ls Beaglebone | ||
| - | dts spi SPI_test | ||
| - | </ | ||
| - | |||
| - | Now change to directory // | ||
| - | |||
| - | ===== Install 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 some modifications of the device tree are needed. In order to install the modifications go to directory | ||
| - | |||
| - | <code bash> | ||
| - | cd dts | ||
| - | </ | ||
| - | |||
| - | 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> | ||
| - | sudo cp BB-BONE-CC1200-00A0.dtbo / | ||
| - | </ | ||
| - | |||
| - | ===== Booting with BB-BONE-CC1200 ===== | ||
| - | |||
| - | In order to boot with the BB-BONE-CC1200 device tree overlay, we have to instruct the bootloader to do so: | ||
| - | |||
| - | Edit the file /// | ||
| - | |||
| - | <code bash> | ||
| - | # | ||
| - | </ | ||
| - | |||
| - | Now uncomment this line and edit it so that it loads our own device tree overlay blob: | ||
| - | |||
| - | <code bash> | ||
| - | dtb_overlay=/ | ||
| - | </ | ||
| - | |||
| - | After that, reboot. | ||
| ===== SPI Library ===== | ===== SPI Library ===== | ||
| Line 95: | Line 27: | ||
| The PRU controls the SPI bus and offers a software user space interface for reading and writing to and from the SPI bus. | The PRU controls the SPI bus and offers a software user space interface for reading and writing to and from the SPI bus. | ||
| - | === Install PRU devtools === | + | ==== Install PRU devtools |
| In order to build and use the SPI library we need access to the development tools for the PRU. Since these aren't available anymore in the repositories, | In order to build and use the SPI library we need access to the development tools for the PRU. Since these aren't available anymore in the repositories, | ||
| Line 121: | Line 53: | ||
| Now we should have access to the PRU assembler //pasm// as well as the prussdrv library. | Now we should have access to the PRU assembler //pasm// as well as the prussdrv library. | ||
| - | === Build and install the SPI library === | + | ==== Build and install the SPI library |
| To generate the SPI library go to the //spi// directory of the Beaglebone archive. | To generate the SPI library go to the //spi// directory of the Beaglebone archive. | ||
| Line 148: | Line 80: | ||
| - | === Test Setup === | + | ==== Test Setup ==== |
| To test, if everything is working fine, go to the directory | To test, if everything is working fine, go to the directory | ||
