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 [2019/04/11 09:55] – [Connecting the CC1200 Evaluation Module Kit to the Beagle Bone 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 |
| - | In our setup we are connecting set same the evaluation module directly to the Beagle Bone Black. A picture of the CC1200 Evaluation Module Kit is shown in the following picture. | + | |
| Line 13: | Line 12: | ||
| - | To avoid damage of the devices, connect | + | In our setup we are connecting |
| - | < | + | Now, link the connector as shown in figure 2. |
| - | ===== Clone GIT Repository for BeagleBone Black ===== | ||
| - | To get all the stuff for the PPL on the BeagleBone | + | < |
| - | <code bash> | ||
| - | git clone git@gitlab.tubit.tu-berlin.de: | ||
| - | </ | ||
| - | ===== Install device tree overlay ===== | + | To avoid damage of devices, the colors shown must match. Also take care of the pins. They should be firmly fixed. |
| - | For PPL the CC1200 ist connected to the SPI of the BealeBone Black and the SPI is controlled by the PRU. | + | ===== SPI Library ===== |
| - | Therefor some modifications of the device tree are needed. In order to install the modifications go to directory | + | |
| - | <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. |
| - | cd dts | + | |
| - | </ | + | |
| - | Directory //dts// contains the file // | + | ==== 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, |
| - | dtc -O dtb -o BB-BONE-CC1200-00A0.dtbo -b 0 -@ BB-BONE-CC1200-00A0.dts | + | |
| - | </ | + | |
| - | //dtc// ist the device tree compiler. Die compiler produces the bizarre overlay file // | + | To do so we first have to download |
| <code bash> | <code bash> | ||
| - | cp BB-BONE-CC1200-00A0.dtbo | + | cd ~ |
| + | git clone https://github.com/ | ||
| </ | </ | ||
| - | in the next step activate the overlay: | + | Then we change directory and build the dev tools: |
| <code bash> | <code bash> | ||
| - | echo BB-BONE-CC1200 > / | + | cd am335x_pru_package |
| + | make | ||
| </ | </ | ||
| - | If every thing is ok, the command | + | After the compilation |
| <code bash> | <code bash> | ||
| - | cat / | + | sudo make install |
| </ | </ | ||
| - | will produce | + | Now we should have access to the PRU assembler //pasm// as well as the prussdrv library. |
| - | <code bash> | + | ==== Build and install the SPI library ==== |
| - | 0: PF---- | + | |
| - | 1: PF---- | + | |
| - | 2: PF---- | + | |
| - | 3: PF---- | + | |
| - | 4: P-O-L- | + | |
| - | </ | + | |
| - | ===== Booting with BB-BONE-CC1200 ===== | + | To generate the SPI library go to the //spi// directory |
| - | + | ||
| - | In order to boot with the BB-BONE-CC1200 device tree overlay, two things has to be done: | + | |
| - | + | ||
| - | First, edit file ///boot/uEnv.txt// and add the following line at the end of the file: | + | |
| <code bash> | <code bash> | ||
| - | cape_enable=bone_capemgr.enable_partno=BB-BONE-CC1200 | + | cd ~/ |
| </ | </ | ||
| - | Second, go to the directory //dts// of the Beaglebone git repository and copy the overlay: | + | Now execute |
| <code bash> | <code bash> | ||
| - | cp BB-BONE-CC1200-00A0.dts / | + | cmake . |
| + | make | ||
| + | sudo make install | ||
| </ | </ | ||
| - | Now, go to the directory: | + | //cmake// will generate a // |
| - | <code bash> | + | In the last step run |
| - | cd / | + | |
| - | </ | + | |
| - | + | ||
| - | and execute | + | |
| <code bash> | <code bash> | ||
| - | ./ | + | sudo ldconfig |
| </ | </ | ||
| - | In the first step, the boot loader is instructed | + | to make the dynamic linker aware of the newly created SPI library. |
| - | Now, reboot. After reboot the overlay should be loaded automatically. | ||
| - | ===== SPI Library | + | ==== Test Setup ==== |
| - | + | ||
| - | The PRU controls the SPI and offers a software user space interface for reading and writing to and from the SPI. | + | |
| - | + | ||
| - | To generate the SPI library go to the //spi// directory of the Beaglebone git repository. | + | |
| + | To test, if everything is working fine, go to the directory | ||
| <code bash> | <code bash> | ||
| - | cd spi | + | cd ~/ |
| </ | </ | ||
| - | Now execute | + | and enter |
| <code bash> | <code bash> | ||
| - | cmake . | + | cmake .. |
| - | make | + | |
| - | make install | + | |
| </ | </ | ||
| - | //cmake// will generate the // | + | '' |
| - | + | ||
| - | To make the library accessible, go to <code bash>cd / | + | |
| - | + | ||
| - | In this directory create the file // | + | |
| - | < | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | In the last step run | + | |
| <code bash> | <code bash> | ||
| - | ldconfig | + | make |
| </ | </ | ||
| - | to make the change effective. | + | This will create |
| - | + | ||
| - | 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 '' | The output of '' | ||
| <code bash> | <code bash> | ||
| - | ./ | + | ./ |
| INFO:read Adr:0x1 Val:0x7 | INFO:read Adr:0x1 Val:0x7 | ||
| INFO: Status:IDLE | INFO: Status:IDLE | ||
| Line 258: | 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. |
