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:
Fri Feb 02 14:13:24 2018 +0100
Revision:
82:a18c22d2b83a
Parent:
34:edda6a7238ec
Correct comments/documentation

Who changed what in which revision?

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