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:27] – [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 21: | Line 21: | ||
| - | < | + | 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 colours shown must match. Also take care of the pins. They should be firmly fixed. | + | ===== SPI Library |
| - | ===== 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)) | + | The PRU controls |
| - | <code bash> | + | ==== Install PRU devtools ==== |
| - | git clone git@gitlab.tubit.tu-berlin.de: | + | |
| - | </ | + | |
| - | ===== Install device tree overlay ===== | + | 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, |
| - | For PPL the CC1200 ist connected | + | To do so we first have to download |
| - | 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 ~ |
| + | git clone https:// | ||
| </ | </ | ||
| - | Directory //dts// contains | + | Then we change directory and build the dev tools: |
| <code bash> | <code bash> | ||
| - | dtc -O dtb -o BB-BONE-CC1200-00A0.dtbo -b 0 -@ BB-BONE-CC1200-00A0.dts | + | cd am335x_pru_package |
| + | make | ||
| </ | </ | ||
| - | //dtc// ist the device tree compiler. Die compiler produces the bizarre overlay file // | + | After the compilation is done, it's time to install them: |
| <code bash> | <code bash> | ||
| - | cp BB-BONE-CC1200-00A0.dtbo / | + | sudo make install |
| </ | </ | ||
| - | in the next step activate | + | Now we should have access to the PRU assembler //pasm// as well as the prussdrv library. |
| - | <code bash> | + | ==== Build and install the SPI library ==== |
| - | echo BB-BONE-CC1200 > / | + | |
| - | </ | + | |
| - | If every thing is ok, the command | + | To generate |
| <code bash> | <code bash> | ||
| - | cat /sys/devices/ | + | cd ~/Beaglebone/spi |
| </ | </ | ||
| - | will produce the following output: | + | Now execute |
| <code bash> | <code bash> | ||
| - | 0: PF---- | + | cmake . |
| - | 1: PF---- | + | make |
| - | 2: PF---- | + | sudo make install |
| - | 3: PF---- | + | |
| - | 4: P-O-L- | + | |
| </ | </ | ||
| - | ===== Booting with BB-BONE-CC1200 ===== | + | //cmake// will generate a // |
| - | In order to boot with the BB-BONE-CC1200 device tree overlay, two things has to be done: | + | In the last step run |
| - | + | ||
| - | 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 264: | 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. |
