This is an old revision of the document!


Protocol Programming Lab Preparations

1)

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 pruposes, discribed later. The CC1200 Evaluation Module Kit is shown in figure 1.

cc1200_evaluation_module_kit.jpgFig. 1: CC1200 Evaluation Module Kit

In our setup we are connecting the same evaluation module directly to the Beagle Bone Black.

Now, link the connector as shown in figure 2.

2019-04-11_08.32.02.jpgFig. 2: Connector from Beagle Bone Black to CC1200 Evaluation Module Kit

To avoid damage of devices, the colours shown must match. Also take care of the pins. They should be firmly fixed.

Get PPL Files for BeagleBone Black

To get all the stuff for the PPL on the BeagleBone Black, go to your favorite directory an execute:

wget http://http://kn-pr.tkn.tu-berlin.de/ppl/Beaglebone.tar.gz

and extract the archive by executing the command:

tar -xtfz Beaglebone.tar.gz

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

cd dts

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:

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 BB-BONE-CC1200-00A0.dtbo. Next copy this file to the firmware directory:

cp BB-BONE-CC1200-00A0.dtbo /lib/firmware/.

in the next step activate the overlay:

echo BB-BONE-CC1200 > /sys/devices/platform/bone_capemgr/slots

If every thing is ok, the command

cat /sys/devices/platform/bone_capemgr/slots

will produce the following output:

0: PF----  -1 
 1: PF----  -1 
 2: PF----  -1 
 3: PF----  -1 
 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-BONE-CC1200

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 /boot/uEnv.txt and add the following line at the end of the file:

cape_enable=bone_capemgr.enable_partno=BB-BONE-CC1200

Second, go to the directory dts of the Beaglebone git repository and copy the overlay:

cp BB-BONE-CC1200-00A0.dts /opt/source/bb.org-overlays/src/arm/.

Now, go to the directory:

cd /opt/source/bb.org-overlays/

and execute the command

./install.sh

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 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.

cd spi

Now execute

cmake .
make
make install

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.

To make the library accessible, go to

cd /etcld.so.conf.d

In this directory create the file libspi.conf with the content

/usr/local/lib

In the last step run

ldconfig

to make the change effective.

To test, if everything is working fine, go to the directory

cd SPI_test/built

.

and enter

cmake ../.

cmake will output a Makefile. Execute the Makefile by entering

make

.

This will install the binary called SPIv1_test. The output of SPIv1_test will look like the following

 ./SPIv1_test 
INFO:read Adr:0x1 Val:0x7
INFO: Status:IDLE
INFO:read adr:0xd val:0x14
INFO: REG DUMP 0x00-0x2E
INFO: read adr:0x0 val:0x6
INFO: read adr:0x1 val:0x7
INFO: read adr:0x2 val:0x30
INFO: read adr:0x3 val:0x3c
INFO: read adr:0x4 val:0x93
INFO: read adr:0x5 val:0xb
INFO: read adr:0x6 val:0x51
INFO: read adr:0x7 val:0xde
INFO: read adr:0x8 val:0xaa
INFO: read adr:0x9 val:0x3
INFO: read adr:0xa val:0x6
INFO: read adr:0xb val:0x3
INFO: read adr:0xc val:0x4c
INFO: read adr:0xd val:0x14
INFO: read adr:0xe val:0xda
INFO: read adr:0xf val:0xc4
INFO: read adr:0x10 val:0x94
INFO: read adr:0x11 val:0x46
INFO: read adr:0x12 val:0xd
INFO: read adr:0x13 val:0x43
INFO: read adr:0x14 val:0xa9
INFO: read adr:0x15 val:0x2a
INFO: read adr:0x16 val:0x36
INFO: read adr:0x17 val:0x0
INFO: read adr:0x18 val:0x0
INFO: read adr:0x19 val:0xb1
INFO: read adr:0x1a val:0x20
INFO: read adr:0x1b val:0x52
INFO: read adr:0x1c val:0xc3
INFO: read adr:0x1d val:0x80
INFO: read adr:0x1e val:0x0
INFO: read adr:0x1f val:0xb
INFO: read adr:0x20 val:0x2
INFO: read adr:0x21 val:0x8
INFO: read adr:0x22 val:0x21
INFO: read adr:0x23 val:0x0
INFO: read adr:0x24 val:0x0
INFO: read adr:0x25 val:0x0
INFO: read adr:0x26 val:0x4
INFO: read adr:0x27 val:0x3
INFO: read adr:0x28 val:0x0
INFO: read adr:0x29 val:0xf
INFO: read adr:0x2a val:0x0
INFO: read adr:0x2b val:0x7f
INFO: read adr:0x2c val:0x56
INFO: read adr:0x2d val:0xf
INFO: read adr:0x2e val:0x3
INFO:write adr:0x4 val:0xff
INFO:read adr:0x4 val:0xff
INFO: Status:IDLE
INFO: extended Register reads
INFO:read adr:0x0 val:0x0
INFO:read adr:0x1 val:0x20
INFO:read adr:0x2 val:0xb
INFO:read adr:0x3 val:0x0
INFO:read adr:0x4 val:0x0
INFO:read adr:0x5 val:0x8
INFO:read adr:0x6 val:0x1
INFO:read adr:0x7 val:0x0
INFO:read adr:0x8 val:0x0
INFO:read adr:0x9 val:0x0
INFO:read adr:0xa val:0x0
INFO:read adr:0xb val:0x0
INFO:read adr:0xc val:0x0
INFO:read adr:0xd val:0x0
INFO:read adr:0xe val:0x0
INFO:read adr:0xf val:0x2
INFO:read adr:0x10 val:0x5a
INFO:read adr:0x11 val:0x1a
INFO:read adr:0x12 val:0x8
INFO:read adr:0x13 val:0x5a
INFO:read adr:0x14 val:0x0
INFO:read adr:0x15 val:0x20
INFO:read adr:0x16 val:0x0
INFO:read adr:0x17 val:0x0
INFO:read adr:0x18 val:0x28
INFO:read adr:0x19 val:0x1
INFO:read adr:0x1a val:0x0
INFO:read adr:0x1b val:0x3
INFO:read adr:0x1c val:0xff
INFO:read adr:0x1d val:0x1f
INFO:read adr:0x1e val:0x0
INFO:read adr:0x1f val:0x51
INFO:read adr:0x20 val:0x2c
INFO:read adr:0x21 val:0x11
INFO:read adr:0x22 val:0x0
INFO:read adr:0x23 val:0x14
INFO:read adr:0x24 val:0x0
INFO:read adr:0x25 val:0x0
INFO:read adr:0x26 val:0x0
INFO:read adr:0x27 val:0x81
INFO:read adr:0x28 val:0x0
INFO:read adr:0x29 val:0x2
INFO:read adr:0x2a val:0x0
INFO:read adr:0x2b val:0x0
INFO:read adr:0x2c val:0x10
INFO:read adr:0x2d val:0x0
INFO:read adr:0x2e val:0x0
INFO:read adr:0x2f val:0x1
INFO:read adr:0x2f0a val:0x0
INFO:read after write 0xf0 in 0x0a adr:0x2f0a val:0xf0

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.

network_protocol_programming_lab/4_prepareppl.1584962309.txt.gz · Last modified: 2020/03/23 12:18 by rathke
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0