diff --git a/examples/platforms/cc2538/README.md b/examples/platforms/cc2538/README.md index 54e0c5852..f4539899f 100644 --- a/examples/platforms/cc2538/README.md +++ b/examples/platforms/cc2538/README.md @@ -16,6 +16,14 @@ Cortex-M][gnu-toolchain]. [gnu-toolchain]: https://launchpad.net/gcc-arm-embedded +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` + ## Building In a Bash terminal, follow these instructions to build the cc2538 examples. diff --git a/examples/platforms/cc2650/README.md b/examples/platforms/cc2650/README.md index 903d1bc6b..2550e6219 100644 --- a/examples/platforms/cc2650/README.md +++ b/examples/platforms/cc2650/README.md @@ -47,6 +47,13 @@ consult this [community help wiki article][ubuntu-wiki-virtualbox]. [mingw]: http://www.mingw.org [ubuntu-wiki-virtualbox]: https://help.ubuntu.com/community/VirtualBox +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` ## Building diff --git a/examples/platforms/cc2652/README.md b/examples/platforms/cc2652/README.md index f981730d5..afdc02008 100644 --- a/examples/platforms/cc2652/README.md +++ b/examples/platforms/cc2652/README.md @@ -38,6 +38,14 @@ article][ubuntu-wiki-virtualbox]. [mingw]: http://www.mingw.org [ubuntu-wiki-virtualbox]: https://help.ubuntu.com/community/VirtualBox +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` + ## Building In a Bash terminal, follow these instructions to build the cc2652 examples. diff --git a/examples/platforms/da15000/README.md b/examples/platforms/da15000/README.md index 6f0ae08bc..b301fc62c 100755 --- a/examples/platforms/da15000/README.md +++ b/examples/platforms/da15000/README.md @@ -4,11 +4,26 @@ This directory contains example platform drivers for the [Dialog Semiconductor D [da15000]: https://support.dialog-semiconductor.com/connectivity/product/openthread-sandbox -**NOTE:** Each Thread node requires a unique EUI-64. +**NOTE:** Each Thread node requires a unique EUI-64. Please make sure all Thread nodes in your network have a unique EUI-64 by setting HARDCODED_NODE_ID in radio.c to a unique value. **NOTE:** Current version works only with DA15000 rev. BA +## Toolchain + +Download and install the [GNU toolchain for ARM +Cortex-M][gnu-toolchain]. + +[gnu-toolchain]: https://launchpad.net/gcc-arm-embedded + +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` + ## Build Examples (How to build and flash): ```bash $ cd @@ -68,7 +83,7 @@ Board will indicate state of device according to LED blink speed. Done ``` Wait and see that LED started to blink with 5Hz. - + Check node state: ``` > state @@ -98,7 +113,7 @@ Board will indicate state of device according to LED blink speed. List addresses on terminal with Leader: - ``` + ``` > ipaddr fdde:ad00:beef:0:0:ff:fe00:4400 fdde:ad00:beef:0:92f5:9844:67ad:a0c9 @@ -116,16 +131,16 @@ Board will indicate state of device according to LED blink speed. * Validation The DA15000 example has been validated by Dialog Semiconductor with commit d250105 included. - + * Build environment The DA15000 example code and all required dependencies have been complied with gcc version 5.4.0 (20160609). - -## Troubleshooting + +## Troubleshooting * Why can’t I see the VCOM port? - - The Segger Virtual COM port can be disabled by software configuration. If you can see the Segger + + The Segger Virtual COM port can be disabled by software configuration. If you can see the Segger driver properly installed but the VCOM not showing up in the device manager, it’s probably disabled by software. To re-enable it you have to run JLinkExe and issue the command ` vcom enable`.It is - required to power cycle the device to apply the change. - + required to power cycle the device to apply the change. + diff --git a/examples/platforms/efr32/README.md b/examples/platforms/efr32/README.md index 33f86f7b6..6e8f2e309 100644 --- a/examples/platforms/efr32/README.md +++ b/examples/platforms/efr32/README.md @@ -20,6 +20,14 @@ Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain]. [gnu-toolchain]: https://launchpad.net/gcc-arm-embedded +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` + ## Build Examples 1. Download and install the [Simplicity Studio][simplicity_studio]. @@ -176,7 +184,7 @@ $ make -f examples/Makefile-efr32 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_S ``` For a list of all available commands, visit [OpenThread CLI Reference README.md][CLI]. - + [CLI]: https://github.com/openthread/openthread/blob/master/src/cli/README.md ## Verification diff --git a/examples/platforms/emsk/README.md b/examples/platforms/emsk/README.md index d5a37824f..de9ae9351 100644 --- a/examples/platforms/emsk/README.md +++ b/examples/platforms/emsk/README.md @@ -31,6 +31,7 @@ Download and install [Digilent Adept Software][digilent-adept] for the Digilent ```bash $ cd +$ ./script/bootstrap $ ./bootstrap $ make -f examples/Makefile-emsk clean $ make -f examples/Makefile-emsk diff --git a/examples/platforms/gp712/README.md b/examples/platforms/gp712/README.md index 10b149281..48fe3bfd4 100644 --- a/examples/platforms/gp712/README.md +++ b/examples/platforms/gp712/README.md @@ -18,6 +18,7 @@ The build process will complain if additional packages are required. ```bash $ cd +$ ./script/bootstrap $ ./bootstrap $ CERT_LOG=1 CLI_LOGGING=1 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 BORDER_ROUTER=1 make -f examples/Makefile-gp712 ``` @@ -27,7 +28,7 @@ After a successful build, the `elf` files are found in Building a variant which interfaces via a tcp socket is also possible. Replace the uart-posix.c with uart-socket.c in the Makefile.am from examples/platforms/gp712/Makefile.am and rebuild. Now it should be possible to open a telnet to socket 9190 of the raspberry pi from a remote PC. This also easier testing with the official Thread Test Harness. -## +## ## Interact diff --git a/examples/platforms/kw41z/README.md b/examples/platforms/kw41z/README.md index 2aab5141f..184c16731 100644 --- a/examples/platforms/kw41z/README.md +++ b/examples/platforms/kw41z/README.md @@ -16,6 +16,14 @@ Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain]. [gnu-toolchain]: https://launchpad.net/gcc-arm-embedded +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` + ## Build Examples ```bash @@ -34,7 +42,7 @@ $ arm-none-eabi-objcopy -O binary ot-cli-ftd ot-cli-ftd.bin ## Flash Binaries Compiled binaries may be flashed onto the MKW41Z512 using drag-and-drop into the board's MSD Bootloader - or the [NXP(Freescale) Test Tool][test-tool] or [JTAG interface][jtag]. + or the [NXP(Freescale) Test Tool][test-tool] or [JTAG interface][jtag]. The [NXP(Freescale) Test Tool][test-tool] provides a convenient method for flashing a MKW41Z512 via the [J-Link][jlink]. [test-tool]: http://www.nxp.com/webapp/sps/download/license.jsp?colCode=TESTTOOL_SETUP diff --git a/examples/platforms/nrf52840/README.md b/examples/platforms/nrf52840/README.md index 45ee72af0..dc28c5cd4 100644 --- a/examples/platforms/nrf52840/README.md +++ b/examples/platforms/nrf52840/README.md @@ -14,6 +14,14 @@ Download and install [GNU toolchain for ARM Cortex-M][gnu-toolchain]. [gnu-toolchain]: https://launchpad.net/gcc-arm-embedded +In a Bash terminal, follow these instructions to install the GNU toolchain and +other dependencies. + +```bash +$ cd +$ ./script/bootstrap +``` + ## Building the examples ```bash diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 000000000..5004a3583 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,100 @@ +#!/bin/sh +# +# Copyright (c) 2017, The OpenThread Authors. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# Description: +# This file installs all needed dependencies and toolchains needed for +# example compilation and programming. +# + +# Establish some key directories + +srcdir=`dirname ${0}` +abs_srcdir=`pwd` +abs_top_srcdir="${abs_srcdir}" + +install_packages_apt() +{ + # apt update and install dependencies + sudo apt-get update + sudo apt-get install -y build-essential git make autoconf \ + autoconf-archive automake dbus libtool gcc \ + g++ gperf flex bison texinfo ncurses-dev \ + libexpat-dev python sed python-pip gawk \ + libreadline6-dev libreadline6 libdbus-1-dev \ + libboost-dev + + # add gcc-arm-embedded ppa + sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa + sudo apt-get update + + sudo apt-get install gcc-arm-embedded +} + +install_packages_opkg() +{ + echo 'opkg not supported currently' && false +} + +install_packages_rpm() +{ + echo 'rpm not supported currently' && false +} + +install_packages_brew() +{ + echo 'macOS not supported currently' && false +} + +install_packages_source() +{ + echo 'source not supported currently' && false +} + +install_packages() +{ + PM=source + if which apt-get; then + PM=apt + elif which rpm; then + PM=rpm + elif which opkg; then + PM=opkg + elif which brew; then + PM=brew + fi + install_packages_$PM +} + +main() +{ + . $BEFORE_HOOK + install_packages + . $AFTER_HOOK +} + +main