• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

CMakeLists.txtD11-Mar-20242.8 KiB8070

Makefile.amD11-Mar-20243.1 KiB7033

Makefile.platform.amD11-Mar-20241.9 KiB4036

README.mdD11-Mar-20244.4 KiB11383

alarm.cD11-Mar-20244 KiB14993

arm-none-eabi.cmakeD11-Mar-20242.3 KiB4338

cc2538-reg.hD11-Mar-202418.6 KiB327233

cc2538.ldD11-Mar-20244.2 KiB139122

diag.cD11-Mar-20242.5 KiB8137

entropy.cD11-Mar-20243.6 KiB11359

flash.cD11-Mar-20243.4 KiB10253

logging.cD11-Mar-20242.1 KiB4812

misc.cD11-Mar-20242 KiB5015

openthread-core-cc2538-config-check.hD11-Mar-20241.9 KiB376

openthread-core-cc2538-config.hD11-Mar-20247.9 KiB25641

platform-cc2538.hD11-Mar-20243.6 KiB12326

radio.cD11-Mar-202437.3 KiB1,274919

rom-utility.hD11-Mar-20243.5 KiB7738

startup-gcc.cD11-Mar-20249.7 KiB216145

system.cD11-Mar-20242.3 KiB6725

uart.cD11-Mar-20248.4 KiB319184

README.md

1# OpenThread on CC2538 Example
2
3This directory contains example platform drivers for the [Texas Instruments CC2538][cc2538].
4
5[cc2538]: http://www.ti.com/product/CC2538
6
7The example platform drivers are intended to present the minimal code necessary to support OpenThread. As a result, the example platform drivers do not necessarily highlight the platform's full capabilities.
8
9## Toolchain
10
11Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
12
13[gnu-toolchain]: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm
14
15In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
16
17```bash
18$ cd <path-to-openthread>
19$ ./script/bootstrap
20```
21
22## Building
23
24In a Bash terminal, follow these instructions to build the cc2538 examples.
25
26```bash
27$ cd <path-to-openthread>
28$ ./bootstrap
29$ make -f examples/Makefile-cc2538
30```
31
32### CC2592 support
33
34If your board has a CC2592 range extender front-end IC connected to the CC2538 (e.g. the CC2538-CC2592 EM reference design), you need to initialise this part before reception of radio traffic will work.
35
36Support is enabled in OpenThread by building with `CC2592=1`:
37
38```bash
39$ make -f examples/Makefile-cc2538 CC2592=1
40```
41
42The default settings should work for any design following the integration advice given in TI's application report ["AN130 - Using CC2592 Front End With CC2538"](http://www.ti.com/lit/pdf/swra447).
43
44Additional settings can be customised:
45
46- `CC2592_PA_EN`: This specifies which pin (on port C of the CC2538) connects to the CC2592's `PA_EN` pin. The default is `3` (PC3).
47- `CC2592_LNA_EN`: This specifies which pin (on port C of the CC2538) connects to the CC2592's `LNA_EN` pin. The default is `2` (PC2).
48- `CC2592_USE_HGM`: This defines whether the HGM pin of the CC2592 is under GPIO control or not. If not, it is assumed that the HGM pin is tied to a power rail.
49- `CC2592_HGM_PORT`: The HGM pin can be connected to any free GPIO. TI recommend using PD2, however if you've used a pin on another GPIO port, you may specify that port (`A`, `B` or `C`) here.
50- `CC2592_HGM_PORT`: The HGM pin can be connected to any free GPIO. TI recommend using PD2, however if you've used a pin on another GPIO port, you may specify that port (`A`, `B` or `C`) here. Default is `D`.
51- `CC2592_HGM_PIN`: The HGM pin can be connected to any free GPIO. TI recommend using PD2, however if you've used a pin on another GPIO pin, you can specify the pin here. Default is `2`.
52- `CC2592_HGM_DEFAULT_STATE`: By default, HGM is enabled at power-on, but you may want to have it default to off, specify `CC2592_HGM_DEFAULT_STATE=0` to do so.
53- `CC2538_RECEIVE_SENSITIVITY`: If you have tied the HGM pin to a power rail, this allows you to calibrate the RSSI values according to the new receive sensitivity. This has no effect if `CC2592_USE_HGM=1` (the default).
54- `CC2538_RSSI_OFFSET`: If you have tied the HGM pin to a power rail, this allows you to calibrate the RSSI values according to the new RSSI offset. This has no effect if `CC2592_USE_HGM=1` (the default).
55
56## Flash Binaries
57
58If the build completed successfully, the `elf` files may be found in `<path-to-openthread>/output/cc2538/bin`.
59
60To flash the images with [Flash Programmer 2][ti-flash-programmer-2], the files must have the `*.elf` extension.
61
62```bash
63$ cd <path-to-openthread>/output/cc2538/bin
64$ cp ot-cli ot-cli.elf
65```
66
67To load the images with the [serial bootloader][ti-cc2538-bootloader], the images must be converted to `bin`. This is done using `arm-none-eabi-objcopy`
68
69```bash
70$ cd <path-to-openthread>/output/cc2538/bin
71$ arm-none-eabi-objcopy -O binary ot-cli ot-cli.bin
72```
73
74The [cc2538-bsl.py script][cc2538-bsl-tool] provides a convenient method for flashing a CC2538 via the UART. To enter the bootloader backdoor for flashing, hold down SELECT for CC2538DK (corresponds to logic '0') while you press the Reset button.
75
76[ti-flash-programmer-2]: http://www.ti.com/tool/flash-programmer
77[ti-cc2538-bootloader]: http://www.ti.com/lit/an/swra466a/swra466a.pdf
78[cc2538-bsl-tool]: https://github.com/JelmerT/cc2538-bsl
79
80## Interact
81
821. Open terminal to `/dev/ttyUSB1` (serial port settings: 115200 8-N-1).
832. Type `help` for list of commands.
84
85```bash
86> help
87help
88channel
89childtimeout
90contextreusedelay
91extaddr
92extpanid
93ipaddr
94keysequence
95leaderweight
96mode
97netdata register
98networkidtimeout
99networkkey
100networkname
101panid
102ping
103prefix
104releaserouterid
105rloc16
106route
107routerupgradethreshold
108scan
109start
110state
111stop
112```
113