Skip to content

wisol-SFM/WSSFM20Rx_12x

Repository files navigation

Caution!

This version is no longer supported. New SDK released. See the following link. https://github.com/seongji-SFM/SFM_15x

old documents # Introduction

The purpose of this tutorial is to help you getting started with Wisol quad-mode module SFM20Rx, especially how-to setup their SDK with gcc.

SFM20Rx is a multi-mode module including Sigfox connectivity, WiFi, BLE and GPS and multiple sensors (magnetic, temperature, accelerometer). The EVK also comes with an NFC tag. The main core of the module is based on the Nordic nRF52832 SOC. Wisol has developed an application layer on top of Nordic SDK to interact with all connectivity blocks and sensors. BLE can be directly programmed using Nordic SDK directives as it is embedded into the nRF52 chip.

Issue

  • Acceleration sensor inside the module could be changed after around Q3, 2018 from BMA205E to BMA253.
    • BOSH notified E.O.L of the BMA250E in Jan.,2018.
    • Main difference between two parts is resolution of the acceleration. 10bit for BMA250E and 12bit for BMA253.
    • Please refer to the application note for accelerometer. BMA253_Datasheet

Keil development environment (windows)

Development_Environment_Setup_Guide

GCC development environment (linux or mac)

Prerequisites

  • Hardware

    • Wisol SFM20Rx evaluation board
    • JLink/SWD cable
    • nRF52 DK board: optional, used as a master to connect to the Wisol dev kit using SWD. Can be bypassed if you own JTAG/SWD debugger probe.
    • Block diagram
  • Software

    • MinGW and MSys: Windows users only (http://www.mingw.org/). Provides open-source GNU tools required to use the Makefiles. Don't use Cygwin as there are incompatibilities. (test by git bash for windows64, mingw64-make)
    • J-Link software for debugging (https://www.segger.com/downloads/jlink/)
    • nrfutil: for Linux/macOS only. If you have python and pip already installed, just run the following command:
pip install nrfutil

For more information, see the link https://github.com/NordicSemiconductor/pc-nrfutil

Architecture of the SDK

AppNote_SFM20R_Architecture_of_SW

The Wisol SDK is based on top of Nordic nRF5x SDK (based on v12.1 as of today). You will find the regular Nordic directories:

  • components
  • documentation
  • examples
  • external
  • svd

In addition to them, Wisol SDK has been created into the development/sigfox_cfg2 directory, including the following:

  • binary: Nordic softdevice including BLE stack with DFU over-the-air
  • documentation: Wisol manuals and application notes
  • source_bootloader_secure: source code for the bootloader (already flashed on the module)
  • source_xxx_example: different examples to use gps, sensors, wifi and sigfox
  • source_simplework_example: this is a more complete example. The application starts by broadcasting a BLE beacon. Then it scans WiFi band and sends BSSID with highest RSSI using Sigfox. Afterwards, if a GPS location has been detected it is also sent using Sigfox. This process is repeated every 10 minutes by default.

Keil projects are embedded into the SDK. We have added additional Makefiles to the different examples in order to compile with gcc.

Support Modules and devices

need to modify "development\sigfox_cfg2\source\cfg_board_def.h"

modules Defines (need to modify MODEL_NAME, MODULE_TYPE)
SFM20R : MODEL_NAME to "SFM20R" and MODULE_TYPE to CDEV_MODULE_SFM20R
SFM40R : MODEL_NAME to "SFM40R" and MODULE_TYPE to CDEV_MODULE_SFM40R
SFM50R : MODEL_NAME to "SFM50R" and MODULE_TYPE to CDEV_MODULE_SFM50R
SFM60R : MODEL_NAME to "SFM60R" and MODULE_TYPE to CDEV_MODULE_SFM60R
Device Defines (need to modify CDEV_BOARD_TYPE)
CDEV_BOARD_EVB                         (1)
CDEV_BOARD_IHERE                       (2)
CDEV_BOARD_IHEREV2                     (4)
CDEV_BOARD_M3                          (5)
eg. (Do not change comments and spaces)
SFM20R EVB
define CDEV_MODEL_NAME "SFM20R"   //MODEL NAME SIZE IS 6BYTE
define CDEV_MODULE_TYPE                        CDEV_MODULE_SFM20R
define CDEV_BOARD_TYPE                        CDEV_BOARD_EVB  //REPLACE_DEVICE_DEFINE_HERE

Flashing the module

Wisol SDK includes Nordic tools and gcc-arm to compile and flash the code for Windows. Linux/macOS version has been added in tools/sfxtools_embedded.

  • How to use J-LINK with DK board (EVB) Alt
  • How to use J-LINK (iHere) Alt
  • How to fix SWD path of DK board (The SWD of the DK board is fixed) Alt

Go into the example directory to be flashed, ie source_sigfox_example:

Linux/macOS users

cd development/sigfox_cfg2/source/
make

mingw64 users

cd development/sigfox_cfg2/source/s132/armgcc
make

To flash the device via JLink/SWD:

make flash
or
make flashall

How to flash the application via DFU

how to download over FOTA

Debugging via JLink/SWD

To debug messages via SWD link, J-Link software must be installed first. For Windows, starts the program J-Link RTT Viewer with following parameters

Alt

Once connected, debug messages will be displayed in the terminal window.

The debug messages are printed with the function cPrintLog()

Alt

For Linux/macOS users, a shell script can directly be launched:

cd tools/scripts/
./JLinkRTT.sh

RTT Command

"CC" : Connect RTT over cTBC (use PC Tool)
"CR" : Reset
"CF" : Setting Value Reset
"CMx" : set bootmode (x-0:normal, 1:wifi rf test, 2:wifi always on, 3:ble test, 4:gps test mode, 5:wifi rf test bridge from RTT to uart, 6:sigfox over RTT, 7:sigfox over Uart, 8:WIFI AP(SFMTEST0000) and BLE BEACON)
"CL" : debug log get