HelloWorld_IDS01A4 mbed application for Spirit1 P2P demo.

Dependencies:   mbed

Fork of HelloWorld_IDS01A5_Program by rosarium pila

mbed 2.0 (a.k.a classic) HelloWorld example for Spirit1 to transfer data from one node to another.
To send the predefined data packet from the sender to the receiver, user needs to press User Button on the board. The LED on the receiver expansion board will toggle on reception of data successfully.
Data packets sent and received can be seen on USB serial terminal.

EVALUATION BOARDS RF FREQUENCY DESCRIPTION :
X-NUCLEO-IDS01A4 868 MHz 868 MHz RF expansion board based on SPIRIT1

Committer:
rosarium
Date:
Thu May 25 16:38:55 2017 +0000
Revision:
0:2ddc0583bcec
First draft version of HelloWorld_IDS01A5

Who changed what in which revision?

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