Fork of my original MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:43:14 2017 +0000
Revision:
0:a1734fe1ec4b
Initial commit

Who changed what in which revision?

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