Skip to content

Sigfox End-Point library implementation example on ST Nucleo boards and various radio shields.

License

Notifications You must be signed in to change notification settings

sigfox-tech-radio/sigfox-ep-example-st-nucleo-xxxxxx

Repository files navigation

Sigfox End-Point library implementation example on Nucleo board

Description

This repository shows an implementation example of the Sigfox End-Point Library on ST-Microelectronics Nucleo boards and several radio shields. The library, addons and drivers are embedded as submodules for an easier compatibility management between all dependencies.

Supported Nucleo boards

Reference MCU Limitations
Nucleo-L053R8 STM32L053R8T6 None

Support of other MCUs will come in the future.

Supported radio shields

Reference Radio chip Limitations
STEVAL-FKI868V2 S2LP None
LR1110DVK1TBKS LR1110 None
SX1261DVK1BAS SX1261 None

Support of other radio shields will come in the future.

Applications

  • The main_button.c defines a simple application where a Sigfox message is sent when the user button is pressed.

Other applications will come soon, such as a full AT command modem exposing all Sigfox features and test modes.

Architecture

From low to top layers, the project is structured as follow:

  • drivers : hardware drivers split in 5 categories:
    • cmsis : MCU core drivers.
    • peripherals : MCU peripherals abstraction layer (MCAL) and specific MCU drivers (STM32 HAL driver embedded as submodule).
    • components : External components drivers (radio chips drivers embedded as submodules).
    • shields : Radio shields drivers (HW_API implementation required by the RF_API).
    • utils : Pure software utility functions such as AES encryption.
  • middleware : this folder contains all the Sigfox submodules, the MCU API implementation and the AT commands parser.
  • application : Main application.

Compilation flags for optimization

This example inherits all the Sigfox End-Point library flags and can be optimized accordingly.

Some dependencies require one or multiple flags to be activated, please refer to the README of the corresponding repository.

Getting started

Cloning the repository and its submodules

git clone https://github.com/sigfox-tech-radio/sigfox-ep-example-st-nucleo-xxxxxx.git
cd sigfox-ep-example-st-nucleo-xxxxxx
git submodule update --init

How to build the project

Command line

Command line requires tools to be installed :

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE="Release" \
      -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" \
      -DTOOLCHAIN_PATH="<REPLACE BY ROOT TOOLCHAIN PATH PREVIOUSLY INSTALLED>" \
      -DRADIO_SHIELD="<REPLACE BY SHIELD TYPE (lr1110dvk1tbks OR sx1261dvk1bas OR steval-fki868v2)>" \
      -DUSE_SIGFOX_EP_FLAGS_H="OFF" \
      -DRC1_ZONE="ON" \
      -DRC2_ZONE="ON" \
      -DRC3C_ZONE="ON" \
      -DRC3D_ZONE="ON" \
      -DRC4_ZONE="ON" \
      -DRC5_ZONE="ON" \
      -DRC6_ZONE="ON" \
      -DRC7_ZONE="ON" \
      -DAPPLICATION_MESSAGES="ON" \
      -DCONTROL_KEEP_ALIVE_MESSAGE="ON" \
      -DBIDIRECTIONAL="ON" \
      -DASYNCHRONOUS="ON" \
      -DLOW_LEVEL_OPEN_CLOSE="ON" \
      -DREGULATORY="ON" \
      -DLATENCY_COMPENSATION="ON" \
      -DSINGLE_FRAME="OFF" \
      -DPARAMETERS_CHECK="ON" \
      -DCERTIFICATION="ON" \
      -DPUBLIC_KEY_CAPABLE="ON" \
      -DVERBOSE="ON" \
      -DCRC_HW="OFF" \
      -DERROR_CODES="ON" \
      -DUL_BIT_RATE_BPS="OFF" \
      -DT_IFU_MS="OFF" \
      -DT_CONF_MS="OFF" \
      -DUL_PAYLOAD_SIZE="OFF" \
      -DMESSAGE_COUNTER_ROLLOVER="OFF" \
      -DERROR_STACK="32" 
      -G "Unix Makefiles" ..
make all

Note

If the UNIDFED program not found you can remove first 4 lines of middleware/sigfox/sigfox-ep-lib/cmake/precompile.cmake, middleware/sigfox/sigfox-ep-rf-api-semtech-lr11xx/cmake/precompile-lr11xx-rf-api.cmake, middleware/sigfox/sigfox-ep-rf-api-semtech-sx126x/cmake/precompile-sx126x-rf-api.cmake, middleware/sigfox/sigfox-ep-rf-api-st-s2lp/cmake/precompile-s2lp-rf-api.cmake file

- find_program(UNIFDEF unifdef REQUIRED)
- if(NOT UNIFDEF)
-     message(FATAL_ERROR "unifdef not found!")
- endif()

All binary files produced are available in build/application/"application Name"/ folder.

How to program Nucleo Board

If nucleo board is still in STLink you can directly click and drop the .bin previous produced file in the mounted disk by Nucleo board.

Replace Sigfox credential

By default this project integrate Sigfox test credentials typically used for RF&Protocol test under RSA:

EP ID  : FEDCBA98
Authentication KEY : 0123456789ABCDEF0123456789ACBDEF

EP ID and Authentication KEY are store respectivly in memory Page 511 at 0x0800FF80 and 0x0800FF84 addresses. It is possible to modify them by directly patching the output <application>.bin file or by modifying sigfoxID and sigfoxKEY variables in middleware/sigfox/mcu_api/src/mcu_api.c file.

About

Sigfox End-Point library implementation example on ST Nucleo boards and various radio shields.

Resources

License

Stars

Watchers

Forks

Packages

No packages published