Fork of my MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:45:51 2017 +0000
Revision:
0:f1d3878b8dd9
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vpcola 0:f1d3878b8dd9 1 Getting Started with Contiki for STM32 Nucleo equipped with sub-1GHz SPIRIT1 expansion boards
vpcola 0:f1d3878b8dd9 2 =============================================================================================
vpcola 0:f1d3878b8dd9 3
vpcola 0:f1d3878b8dd9 4 This guide explains how to get started with the STM32 Nucleo and expansion boards port to Contiki.
vpcola 0:f1d3878b8dd9 5
vpcola 0:f1d3878b8dd9 6 Port Feature
vpcola 0:f1d3878b8dd9 7 ============
vpcola 0:f1d3878b8dd9 8
vpcola 0:f1d3878b8dd9 9 The port supports the following boards from ST:
vpcola 0:f1d3878b8dd9 10 - NUCLEO-L152RE board, based on the STM32L152RET6 ultra-low power microcontroller
vpcola 0:f1d3878b8dd9 11 - X-NUCLEO-IDS01A4 based on sub-1GHz SPSGRF-868 SPIRIT1 module (operating at 868 MHz)
vpcola 0:f1d3878b8dd9 12 - X-NUCLEO-IDS01A5 based on sub-1GHz SPSGRF-915 SPIRIT1 module (operating at 915 MHz)
vpcola 0:f1d3878b8dd9 13 - X-NUCLEO-IKS01A1 featuring motion MEMS and environmental sensors (optional)
vpcola 0:f1d3878b8dd9 14
vpcola 0:f1d3878b8dd9 15 The following drivers are included:
vpcola 0:f1d3878b8dd9 16 - LEDs and buttons (user, reset)
vpcola 0:f1d3878b8dd9 17 - USB
vpcola 0:f1d3878b8dd9 18 - SPIRIT1 sub-1GHz transceiver
vpcola 0:f1d3878b8dd9 19 - HTS221, LIS3MDL, LPS25HB, LSM6DS0 sensors
vpcola 0:f1d3878b8dd9 20
vpcola 0:f1d3878b8dd9 21
vpcola 0:f1d3878b8dd9 22 Hardware Requirements
vpcola 0:f1d3878b8dd9 23 =====================
vpcola 0:f1d3878b8dd9 24
vpcola 0:f1d3878b8dd9 25 * NUCLEO-L152RE development board
vpcola 0:f1d3878b8dd9 26
vpcola 0:f1d3878b8dd9 27 >The NUCLEO-L152RE board belongs to the STM32 Nucleo family.
vpcola 0:f1d3878b8dd9 28 It features an STM32L152RET6 ultra-low power microcontroller based on ARM Cortex M3 MCU.
vpcola 0:f1d3878b8dd9 29 Detailed information on the NUCLEO-L152RE development board can be found at:
vpcola 0:f1d3878b8dd9 30 http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260002
vpcola 0:f1d3878b8dd9 31
vpcola 0:f1d3878b8dd9 32
vpcola 0:f1d3878b8dd9 33 * X-NUCLEO-IDS01Ax sub-1GHz expansion board
vpcola 0:f1d3878b8dd9 34
vpcola 0:f1d3878b8dd9 35 >The X-NUCLEO-IDS01A4 and X-NUCLEO-IDS01A5 are STM32 Nucleo expansion boards that use
vpcola 0:f1d3878b8dd9 36 the module SPSGRF-868 or SPSGRF-915 based on SPIRIT1 low data rate, low power sub-1 GHz transceiver.
vpcola 0:f1d3878b8dd9 37
vpcola 0:f1d3878b8dd9 38 >The user can select the X-NUCLEO-IDS01A4 board to operate the SPIRIT1 transceiver at 868MHz or the X-NUCLEO-IDS01A5 board to operate the SPIRIT1 transceiver at 915MHz.
vpcola 0:f1d3878b8dd9 39
vpcola 0:f1d3878b8dd9 40 >Detailed information on the X-NUCLEO-IDS01A4 expansion board can be found at:
vpcola 0:f1d3878b8dd9 41 http://www.st.com/web/catalog/tools/FM146/CL2167/SC2006/PF261982
vpcola 0:f1d3878b8dd9 42
vpcola 0:f1d3878b8dd9 43 >Detailed information on the X-NUCLEO-IDS01A5 expansion board can be found at:
vpcola 0:f1d3878b8dd9 44 http://www.st.com/web/catalog/tools/FM146/CL2167/SC2006/PF261983
vpcola 0:f1d3878b8dd9 45
vpcola 0:f1d3878b8dd9 46 >Detailed information on the SPIRIT1 sub-1GHz transceiver can be found at:
vpcola 0:f1d3878b8dd9 47 http://www.st.com/web/catalog/sense_power/FM2185/SC1845/PF253167
vpcola 0:f1d3878b8dd9 48
vpcola 0:f1d3878b8dd9 49 * X-NUCLEO-IKS01A1, motion MEMS and environmental sensors expansion board (OPTIONAL)
vpcola 0:f1d3878b8dd9 50
vpcola 0:f1d3878b8dd9 51 >The X-NUCLEO-IKS01A1 is a motion MEMS and environmental sensor evaluation board.
vpcola 0:f1d3878b8dd9 52 The use of this board is optional in the stm32nucleo-spirit1 Contiki platform.
vpcola 0:f1d3878b8dd9 53
vpcola 0:f1d3878b8dd9 54 >Detailed information on the X-NUCLEO-IKS01A1 expansion board can be found at:
vpcola 0:f1d3878b8dd9 55 http://www.st.com/web/catalog/tools/FM146/CL2167/SC2006/PF261191
vpcola 0:f1d3878b8dd9 56
vpcola 0:f1d3878b8dd9 57
vpcola 0:f1d3878b8dd9 58 * USB type A to Mini-B USB cable, to connect the STM32 Nucleo board to the PC
vpcola 0:f1d3878b8dd9 59
vpcola 0:f1d3878b8dd9 60 Software Requirements
vpcola 0:f1d3878b8dd9 61 =====================
vpcola 0:f1d3878b8dd9 62
vpcola 0:f1d3878b8dd9 63 The following software are needed:
vpcola 0:f1d3878b8dd9 64
vpcola 0:f1d3878b8dd9 65 * ST port of Contiki for STM32 Nucleo and expansion boards.
vpcola 0:f1d3878b8dd9 66
vpcola 0:f1d3878b8dd9 67 >The port is automatically installed when both the Contiki and the submodule repository are cloned: the former hosts the Contiki distribution and the ST platform interface, the latter hosts the actual library. The following commands are needed to download the full porting:
vpcola 0:f1d3878b8dd9 68
vpcola 0:f1d3878b8dd9 69 git clone https://github.com/STclab/contiki.git
vpcola 0:f1d3878b8dd9 70 cd contiki/
vpcola 0:f1d3878b8dd9 71 git checkout stm32nucleo-spirit1
vpcola 0:f1d3878b8dd9 72 git submodule init
vpcola 0:f1d3878b8dd9 73 git submodule update
vpcola 0:f1d3878b8dd9 74
vpcola 0:f1d3878b8dd9 75
vpcola 0:f1d3878b8dd9 76 Note: the first and third steps are required only if using the STclab GitHub repository, they won't be needed any more once the Pull Request is accepted.
vpcola 0:f1d3878b8dd9 77
vpcola 0:f1d3878b8dd9 78 The platform name is: stm32nucleo-spirit1
vpcola 0:f1d3878b8dd9 79
vpcola 0:f1d3878b8dd9 80 * A toolchain to build the firmware: The port has been developed and tested with GNU Tools
vpcola 0:f1d3878b8dd9 81 for ARM Embedded Processors.
vpcola 0:f1d3878b8dd9 82 >The toolchain can be found at: https://launchpad.net/gcc-arm-embedded
vpcola 0:f1d3878b8dd9 83 The port was developed and tested using this version: gcc-arm-none-eabi v4.8.3
vpcola 0:f1d3878b8dd9 84
vpcola 0:f1d3878b8dd9 85
vpcola 0:f1d3878b8dd9 86 Examples
vpcola 0:f1d3878b8dd9 87 ========
vpcola 0:f1d3878b8dd9 88
vpcola 0:f1d3878b8dd9 89 The following examples have been successfully tested:
vpcola 0:f1d3878b8dd9 90
vpcola 0:f1d3878b8dd9 91 * examples/stm32nucleo-spirit1/sensor-demo
vpcola 0:f1d3878b8dd9 92 * examples/ipv6/simple-udp-rpl (multicast, rpl-border-router, simple-udp-rpl)
vpcola 0:f1d3878b8dd9 93
vpcola 0:f1d3878b8dd9 94
vpcola 0:f1d3878b8dd9 95 Build an example
vpcola 0:f1d3878b8dd9 96 ================
vpcola 0:f1d3878b8dd9 97 In order to build an example go to the selected example directory (see a list of tested
vpcola 0:f1d3878b8dd9 98 examples in the previous section).
vpcola 0:f1d3878b8dd9 99
vpcola 0:f1d3878b8dd9 100 For example, go to examples/ipv6/simple-udp-rpl directory.
vpcola 0:f1d3878b8dd9 101
vpcola 0:f1d3878b8dd9 102
vpcola 0:f1d3878b8dd9 103 If the X-NUCLEO-IDS01A4 sub-1GHz RF expansion board is used, the following must be run:
vpcola 0:f1d3878b8dd9 104
vpcola 0:f1d3878b8dd9 105 make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 clean
vpcola 0:f1d3878b8dd9 106 make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4
vpcola 0:f1d3878b8dd9 107
vpcola 0:f1d3878b8dd9 108 If the X-NUCLEO-IDS01A5 sub-1GHz RF expansion board is used, the following must be run:
vpcola 0:f1d3878b8dd9 109
vpcola 0:f1d3878b8dd9 110 make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A5 clean
vpcola 0:f1d3878b8dd9 111 make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A5
vpcola 0:f1d3878b8dd9 112
vpcola 0:f1d3878b8dd9 113
vpcola 0:f1d3878b8dd9 114 This will create executables for UDP sender and receiver nodes.
vpcola 0:f1d3878b8dd9 115
vpcola 0:f1d3878b8dd9 116 In order to generate binary files that can be flashed on the STM32 Nucleo the following command must be run:
vpcola 0:f1d3878b8dd9 117
vpcola 0:f1d3878b8dd9 118 arm-none-eabi-objcopy -O binary unicast-sender.stm32nucleo-spirit1 unicast-sender.bin
vpcola 0:f1d3878b8dd9 119 arm-none-eabi-objcopy -O binary unicast-receiver.stm32nucleo-spirit1 unicast-receiver.bin
vpcola 0:f1d3878b8dd9 120
vpcola 0:f1d3878b8dd9 121 These executables can be programmed on the nodes using the procedure described hereafter.
vpcola 0:f1d3878b8dd9 122
vpcola 0:f1d3878b8dd9 123
vpcola 0:f1d3878b8dd9 124 In case you need to build an example that uses the additional sensors expansion board
vpcola 0:f1d3878b8dd9 125 (for example, considering a system made of NUCLEO-L152RE, X-NUCLEO-IDS01A4 and X-NUCLEO-IKS01A1)
vpcola 0:f1d3878b8dd9 126 then the command to be run would be:
vpcola 0:f1d3878b8dd9 127
vpcola 0:f1d3878b8dd9 128 make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 USE_SENSOR_BOARD=1
vpcola 0:f1d3878b8dd9 129
vpcola 0:f1d3878b8dd9 130 System setup
vpcola 0:f1d3878b8dd9 131 ============
vpcola 0:f1d3878b8dd9 132
vpcola 0:f1d3878b8dd9 133 1. Check that the jumper on the J1 connector on the X-NUCLEO-IDS01Ax expansion board is connected.
vpcola 0:f1d3878b8dd9 134 This jumper provides the required voltage to the devices on the board.
vpcola 0:f1d3878b8dd9 135
vpcola 0:f1d3878b8dd9 136 2. Connect the X-NUCLEO-IDS01Ax board to the STM32 Nucleo board (NUCLEO-L152RE) from the top.
vpcola 0:f1d3878b8dd9 137
vpcola 0:f1d3878b8dd9 138 3. If the optional X-NUCLEO-IKS01A1 board is used, connect it on top of the X-NUCLEO-IDS01Ax board.
vpcola 0:f1d3878b8dd9 139
vpcola 0:f1d3878b8dd9 140 4. Power the STM32 Nucleo board using the Mini-B USB cable connected to the PC.
vpcola 0:f1d3878b8dd9 141
vpcola 0:f1d3878b8dd9 142 5. Program the firmware on the STM32 Nucleo board.
vpcola 0:f1d3878b8dd9 143 This can be done by copying the binary file on the USB mass storage that is
vpcola 0:f1d3878b8dd9 144 automatically created when plugging the STM32 Nucleo board to the PC.
vpcola 0:f1d3878b8dd9 145
vpcola 0:f1d3878b8dd9 146 6. Reset the MCU by using the reset button on the STM32 Nucleo board
vpcola 0:f1d3878b8dd9 147
vpcola 0:f1d3878b8dd9 148
vpcola 0:f1d3878b8dd9 149
vpcola 0:f1d3878b8dd9 150
vpcola 0:f1d3878b8dd9 151
vpcola 0:f1d3878b8dd9 152
vpcola 0:f1d3878b8dd9 153
vpcola 0:f1d3878b8dd9 154
vpcola 0:f1d3878b8dd9 155