Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
network_protocol_programming_lab:4_prepareppl [2019/04/11 10:25] – [Connecting the CC1200 Evaluation Module Kit to the Beagle Bone Black] adminnetwork_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 Tranceiver CC1200 manufactured by Texas Instruments will be normally used in conjunction with a development kit for test pruposesdiscribed later. The CC1200 Evaluation Module Kit is shown in figure 1.+The wireless Transceiver CC1200 manufactured by Texas Instruments will be normally used in conjunction with a development kit for test purposesdescribed later. The CC1200 Evaluation Module Kit is shown in figure 1.
  
  
Line 15: Line 15:
  
  
- To avoid damage of the devices, link the connector is shown in figure 2. +Now, link the connector as shown in figure 2. 
  
  
 <imgcaption image2 | Connector from Beagle Bone Black to CC1200 Evaluation Module Kit >{{:network_protocol_programming_lab:2019-04-11 08.32.02.jpg}}</imgcaption> <imgcaption image2 | Connector from Beagle Bone Black to CC1200 Evaluation Module Kit >{{:network_protocol_programming_lab:2019-04-11 08.32.02.jpg}}</imgcaption>
  
-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, the colors shown must match. Also take care of the pins. They should be firmly fixed.
  
-<code bash> +===== SPI Library =====
-git clone git@gitlab.tubit.tu-berlin.de:Protocol_Programming_Lab/Beaglebone.git +
-</code>+
  
-===== 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 PRU devtools ====
-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, we have to compile and install them on our own.
-cd dts +
-</code>+
  
-Directory //dts// contains the file //BB-BONE-CC1200-00A0.dts//. In this file the device tree modification are included. To convert it to a binary file enter:+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://github.com/beagleboard/am335x_pru_package.git
 </code> </code>
  
-//dtc// ist the device tree compiler. Die compiler produces the bizarre overlay file //BB-BONE-CC1200-00A0.dtbo//. Next copy this file to the firmware directory:+Then we change directory and build the dev tools:
  
 <code bash> <code bash>
-cp BB-BONE-CC1200-00A0.dtbo /lib/firmware/.+cd am335x_pru_package 
 +make
 </code> </code>
  
-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 > /sys/devices/platform/bone_capemgr/slots+sudo make install
 </code> </code>
  
-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 /sys/devices/platform/bone_capemgr/slots +
-</code>+
  
-will produce the following output:+To generate the SPI library go to the //spi// directory of the Beaglebone archive.
  
 <code bash> <code bash>
-0: PF----  -1  +cd ~/Beaglebone/spi
- 1: PF----  -1  +
- 2: PF----  -1  +
- 3: PF----  -1  +
- 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-BONE-CC1200+
 </code> </code>
  
-===== 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 ///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+cmake . 
 +make 
 +sudo make install
 </code> </code>
  
-Second, go to the directory //dts// of the Beaglebone git repository and copy the overlay:+//cmake// will generate a //makefile//. Then make will produce the library and make install will install the library under ///usr/local/lib//. A header file will be stored under ///usr/local/include//
 + 
 +In the last step run
  
 <code bash> <code bash>
-cp BB-BONE-CC1200-00A0.dts /opt/source/bb.org-overlays/src/arm/.+sudo ldconfig
 </code> </code>
  
-Now, go to the directory:+to make the dynamic linker aware of the newly created SPI library.
  
-<code bash> 
-cd /opt/source/bb.org-overlays/ 
-</code> 
  
-and execute the command+==== Test Setup ====
  
 +To test, if everything is working fine, go to the directory
 <code bash> <code bash>
-./install.sh+cd ~/Beaglebone/SPI_test/built/
 </code> </code>
  
-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 ..
 </code> </code>
  
-Now execute+''cmake'' will output a ''Makefile''. Execute it by entering:
  
 <code bash> <code bash>
-cmake . 
 make make
-make install 
 </code> </code>
  
-//cmake// will generate the //makefile//. Then make will produce the library and make install will install the library at ///usr/local/lib//. An include file will be stored at ///usr/local/include//+This will create a binary called ''SPIv1_test''
- +The output of ''SPIv1_test'' will look like the following
-To make the library accessible, go to <code bash>cd /etcld.so.conf.d</code> +
- +
-In this directory create the file  //libspi.conf// with the content  +
-<file> +
-/usr/local/lib +
-</file> +
- +
-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/built</code>. 
- 
-and enter  
- 
-<code bash>cmake ../.</code> 
- 
-''cmake'' will output a ''Makefile''. Execute the Makefile by entering 
- 
-<code bash>make</code>. 
- 
-This will install the binary called ''SPIv1_test''. 
-The output of ''SPIv1_test'' will look like the following 
- 
-<code bash> 
- ./SPIv1_test  
 INFO:read Adr:0x1 Val:0x7 INFO:read Adr:0x1 Val:0x7
 INFO: Status:IDLE INFO: Status:IDLE
Line 261: Line 212:
 </code> </code>
  
-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.
network_protocol_programming_lab/4_prepareppl.1554971101.txt.gz · Last modified: 2019/04/11 10:25 by admin
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0