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 [2020/03/23 12:23] – [Get PPL Files for BeagleBone Black] rathke | network_protocol_programming_lab:4_prepareppl [2022/04/18 17:40] (current) – fangenoorth | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ===== Connecting the CC1200 Evaluation Module Kit to the Beagle Bone Black ===== | ===== Connecting the CC1200 Evaluation Module Kit to the Beagle Bone Black ===== | ||
| - | The wireless | + | The wireless |
| Line 21: | Line 21: | ||
| - | To avoid damage of devices, the colours | + | To avoid damage of devices, the colors |
| - | ===== Get PPL Files for BeagleBone Black ===== | + | |
| - | To get all the stuff for the PPL on the BeagleBone Black, go to your favorite directory (e.g. ///root//) an execute: | + | ===== SPI Library ===== |
| - | <code bash> | + | The PRU controls the SPI bus and offers a software user space interface for reading and writing to and from the SPI bus. |
| - | wget http:// | + | |
| - | </ | + | |
| - | and extract the archive by executing the command: | + | ==== Install PRU devtools ==== |
| - | <code bash> | + | 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, |
| - | tar -xzf Beaglebone.tar.gz | + | |
| - | </ | + | |
| - | Now you will see a new directory called Beaglebone, containing additional directories: | + | To do so we first have to download the sources: |
| <code bash> | <code bash> | ||
| - | ls Beaglebone | + | cd ~ |
| - | dts spi SPI_test | + | git clone https:// |
| </ | </ | ||
| - | Noe change | + | Then we change directory and build the dev tools: |
| - | + | ||
| - | ===== Install device tree overlay ===== | + | |
| - | + | ||
| - | For PPL the CC1200 ist connected to the SPI of the BealeBone Black and the SPI is controlled by the PRU. | + | |
| - | Therefor some modifications of the device tree are needed. In order to install the modifications go to directory | + | |
| <code bash> | <code bash> | ||
| - | cd dts | + | cd am335x_pru_package |
| + | make | ||
| </ | </ | ||
| - | Directory //dts// contains | + | After the compilation is done, it's time to install them: |
| <code bash> | <code bash> | ||
| - | dtc -O dtb -o BB-BONE-CC1200-00A0.dtbo -b 0 -@ BB-BONE-CC1200-00A0.dts | + | sudo make install |
| </ | </ | ||
| - | //dtc// ist the device tree compiler. Die compiler produces the bizarre overlay file // | + | Now we should have access to the PRU assembler |
| - | <code bash> | + | ==== Build and install the SPI library ==== |
| - | cp BB-BONE-CC1200-00A0.dtbo / | + | |
| - | </ | + | |
| - | in the next step activate | + | To generate |
| <code bash> | <code bash> | ||
| - | echo BB-BONE-CC1200 > /sys/devices/ | + | cd ~/Beaglebone/spi |
| </ | </ | ||
| - | If every thing is ok, the command | + | Now execute |
| <code bash> | <code bash> | ||
| - | cat / | + | cmake . |
| + | make | ||
| + | sudo make install | ||
| </ | </ | ||
| - | will produce the following output: | + | //cmake// will generate a // |
| - | <code bash> | + | In the last step run |
| - | 0: PF---- | + | |
| - | 1: PF---- | + | |
| - | 2: PF---- | + | |
| - | 3: PF---- | + | |
| - | 4: P-O-L- | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Booting with BB-BONE-CC1200 ===== | + | |
| - | + | ||
| - | In order to boot with the BB-BONE-CC1200 device tree overlay, two things has to be done: | + | |
| - | + | ||
| - | First, edit file /// | + | |
| <code bash> | <code bash> | ||
| - | cape_enable=bone_capemgr.enable_partno=BB-BONE-CC1200 | + | sudo ldconfig |
| </ | </ | ||
| - | Second, go to the directory // | + | to make the dynamic linker aware of the newly created SPI library. |
| - | <code bash> | ||
| - | cp BB-BONE-CC1200-00A0.dts / | ||
| - | </ | ||
| - | Now, go to the directory: | + | ==== Test Setup ==== |
| + | To test, if everything is working fine, go to the directory | ||
| <code bash> | <code bash> | ||
| - | cd /opt/source/bb.org-overlays/ | + | cd ~/Beaglebone/SPI_test/built/ |
| </ | </ | ||
| - | and execute the command | + | and enter |
| <code bash> | <code bash> | ||
| - | ./install.sh | + | cmake .. |
| </ | </ | ||
| - | In the first step, the boot loader is instructed to load the overlay file. In order, that the overlay file can be located by the boot loader, the overlay file will be included in the initrd (second step). | + | '' |
| - | + | ||
| - | Now, reboot. After reboot the overlay should be loaded automatically. | + | |
| - | + | ||
| - | ===== SPI Library ===== | + | |
| - | + | ||
| - | The PRU controls the SPI and offers | + | |
| - | + | ||
| - | To generate the SPI library go to the //spi// directory of the Beaglebone git repository. | + | |
| <code bash> | <code bash> | ||
| - | cd spi | ||
| - | </ | ||
| - | |||
| - | Now execute | ||
| - | |||
| - | <code bash> | ||
| - | cmake . | ||
| make | make | ||
| - | make install | ||
| </ | </ | ||
| - | // | + | This will create |
| - | + | The output of '' | |
| - | To make the library accessible, go to <code bash>cd / | + | |
| - | + | ||
| - | In this directory | + | |
| - | < | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | In the last step run | + | |
| <code bash> | <code bash> | ||
| - | ldconfig | + | ./SPIv1_test |
| - | </code> | + | |
| - | to make the change effective. | ||
| - | |||
| - | To test, if everything is working fine, go to the directory <code bash>cd SPI_test/ | ||
| - | |||
| - | and enter | ||
| - | |||
| - | <code bash> | ||
| - | |||
| - | '' | ||
| - | |||
| - | <code bash> | ||
| - | |||
| - | This will install the binary called '' | ||
| - | The output of '' | ||
| - | |||
| - | <code bash> | ||
| - | | ||
| INFO:read Adr:0x1 Val:0x7 | INFO:read Adr:0x1 Val:0x7 | ||
| INFO: Status:IDLE | INFO: Status:IDLE | ||
| Line 277: | Line 212: | ||
| </ | </ | ||
| - | If all of the register values are equal to zero, the SPI ist not working, or wiring between the Beaglebone and the SPI is not correct or the CC1200 itself is dam damaged. In this case repair the broken part. | + | If all of the register values are equal to zero, the SPI connection is not working, or wiring between the Beaglebone and the SPI pins is not correct or the CC1200 itself is damaged. In this case repair the broken part. |
