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 10:24] – [Connecting the CC1200 Evaluation Module Kit to the Beagle Bone Black] admin | 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 15: | Line 15: | ||
| - | To avoid damage of the devices, link the connector | + | Now, link the connector |
| < | < | ||
| - | Be careful than the colours shown match. Also take care of the pins. They should be firmly fixed. | ||
| - | ===== Clone GIT Repository for BeagleBone Black ===== | ||
| - | To get all the stuff for the PPL on the BeagleBone Black, go to your favorite directory an execute((Do not forget to install your SSH key for git)) | + | To avoid damage of devices, |
| - | <code bash> | + | ===== SPI Library ===== |
| - | git clone git@gitlab.tubit.tu-berlin.de: | + | |
| - | </ | + | |
| - | ===== Install device tree overlay ===== | + | The PRU controls the SPI bus and offers a software user space interface for reading and writing to and from the SPI bus. |
| - | For PPL the CC1200 ist connected to the SPI of the BealeBone Black and the SPI is controlled by the PRU. | + | ==== Install |
| - | Therefor some modifications of the device tree are needed. In order to install the modifications go to directory | + | |
| - | <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, |
| - | cd dts | + | |
| - | </ | + | |
| - | Directory //dts// contains the file // | + | To do so we first have to download the sources: |
| <code bash> | <code bash> | ||
| - | dtc -O dtb -o BB-BONE-CC1200-00A0.dtbo -b 0 -@ BB-BONE-CC1200-00A0.dts | + | cd ~ |
| + | git clone https:// | ||
| </ | </ | ||
| - | //dtc// ist the device tree compiler. Die compiler produces the bizarre overlay file // | + | Then we change directory and build the dev tools: |
| <code bash> | <code bash> | ||
| - | cp BB-BONE-CC1200-00A0.dtbo / | + | cd am335x_pru_package |
| + | make | ||
| </ | </ | ||
| - | in the next step activate the overlay: | + | After the compilation is done, it's time to install them: |
| <code bash> | <code bash> | ||
| - | echo BB-BONE-CC1200 > / | + | sudo make install |
| </ | </ | ||
| - | If every thing is ok, the command | + | Now we should have access to the PRU assembler //pasm// as well as the prussdrv library. |
| - | <code bash> | + | ==== Build and install the SPI library ==== |
| - | cat / | + | |
| - | </ | + | |
| - | will produce | + | To generate |
| <code bash> | <code bash> | ||
| - | 0: PF---- | + | cd ~/ |
| - | 1: PF---- | + | |
| - | 2: PF---- | + | |
| - | 3: PF---- | + | |
| - | 4: P-O-L- | + | |
| </ | </ | ||
| - | ===== Booting with BB-BONE-CC1200 ===== | + | Now execute |
| - | + | ||
| - | 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 | + | cmake . |
| + | make | ||
| + | sudo make install | ||
| </ | </ | ||
| - | Second, go to the directory | + | //cmake// will generate a // |
| + | |||
| + | In the last step run | ||
| <code bash> | <code bash> | ||
| - | cp BB-BONE-CC1200-00A0.dts / | + | sudo ldconfig |
| </ | </ | ||
| - | Now, go to the directory: | + | to make the dynamic linker aware of the newly created SPI library. |
| - | <code bash> | ||
| - | cd / | ||
| - | </ | ||
| - | and execute the command | + | ==== Test Setup ==== |
| + | To test, if everything is working fine, go to the directory | ||
| <code bash> | <code bash> | ||
| - | ./install.sh | + | cd ~/ |
| </ | </ | ||
| - | 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). | + | and enter |
| - | + | ||
| - | Now, reboot. After reboot the overlay should be loaded automatically. | + | |
| - | + | ||
| - | ===== SPI Library ===== | + | |
| - | + | ||
| - | 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. | + | |
| <code bash> | <code bash> | ||
| - | cd spi | + | cmake .. |
| </ | </ | ||
| - | Now execute | + | '' |
| <code bash> | <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 261: | 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. |
