Prototype RF driver for STM Sub-1 GHz RF expansion board based on the SPSGRF-868 module for STM32 Nucleo.

Prototype RF Driver for STM Sub-1 GHz RF Expansion Boards based on the SPSGRF-868 and SPSGRF-915 Modules for STM32 Nucleo

Currently supported boards:

Note, in order to use expansion board X-NUCLEO-IDS01A4 in mbed you need to perform the following HW modifications on the board:

  • Unmount resistor R4
  • Mount resistor R7

Furthermore, on some Nucleo development boards (e.g. the NUCLEO_F429ZI), in order to be able to use Ethernet together with these Sub-1 GHz RF expansion boards, you need to compile this driver with macro SPIRIT1_SPI_MOSI=PB_5 defined, while the development board typically requires some HW modification as e.g. described here!

This driver can be used together with the 6LoWPAN stack (a.k.a. Nanostack).

Committer:
Wolfgang Betz
Date:
Thu Oct 13 15:41:39 2016 +0200
Revision:
0:4fb29d9ee571
First compiling version (without warnings)

Who changed what in which revision?

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