How to use the X-CUBE-SUBG1 for SPIRIT1


0

X-CUBE-SUBG1 – Sub-1 GHz RF communication software expansion for STM32Cube is here, at the end of the page.
Here I explain the way to use the example P2P (point-to-point) that is present in the package X-CUBE-SUBG1.


How to use this example

For do the test we use the NUCLEO-L053R8 and the expansion board X-NUCLEO-IDS01A4 (868 MHz).

How P2P works
In the P2P example, the two node, working in the same way.
If you press the Blue Button on the NUCLEO_1 it send a message to the
NUCLEO_2.
If NUCLEO_2 receives the transmission, flashes a LED and send back an ACK.
At this point, on the NUCLEO_1, flashes a LED that means that NUCLEO_2 has
received the message sent before. See the diagram below.

p2p_1

How to use the P2P SW
After downloaded the SW, unzip it where you want but remember to remove the
protection of the directory, see below.

sg_1

C Compiler – IDE
We want to use KEIL because is free for STM32F0xx and STM32L0xx

NUCLEO board and Working directory
We want to use the NUCLEO-L053R8, the related P2P example is present in this directory:
C:\…\STM32CubeExpansion_SUBG1_V1.0.0\Projects\Multi\Example
s\P2P_demo\MDK-ARM\STM32L053R8-Nucleo

How to open the project
For open the project double click on the: Project.uvprojx

Test if all is OK
First, for test if all is OK, compile the project.
You must see something like below, this means that all is OK.

sg_2

Important file for the configurations
The file:
spirit1_appli.h
contain the SPIRIT1 parameters, that can be modified by the user according to the
application.
For a deep description see this manual (UM1904)

We are interest on this two define, see below:
#define MY_ADDRESS 0x34
#define DESTINATION_ADDRESS 0x44

MY_ADDRESS is the address of the transmitter
DESTINATION_ADDRESS is the address of the receiver

sg_3

The changes that are necessary for configure the two NUCLEO-L053R8
It is clear that we must program the first NUCLEO-L053R8 with this two define:
#define MY_ADDRESS 0x34
#define DESTINATION_ADDRESS 0x44
and program the second NUCLEO-L053R8 with this two define that are inverted respect the first one:
#define MY_ADDRESS 0x44
#define DESTINATION_ADDRESS 0x34

sg_4

Now you are ready to test the P2P communication.

Go on TOP



Extra Informations

Please see the UM1904 manual.

SPIRIT1 packet handler overview

Please see the UM1904 manual. The setup are in the file: spirit1_appli.h
Before on-air transmission, raw data is arranged in a packet structure. The SPIRIT1
offers a highly flexible and fully programmable packet: the structure of the packet, the
number, the type, and the dimension of the fields inside the packet depend on one of
the possible configuration settings.

The setup are in the file spirit1_appli.h at line n.81

sg_5

A detailed description of the SPIRIT1 embedded packet handler is given in the SPIRIT1 datasheet.
Since the P2P communication requires the destination address of the receiving node, the
P2P demo is based on STack and Basic packet handlers.

6

7

User configuration
The file: spirit1_appli.h contain the SPIRIT1 parameters, that can be modified by the
user according to the application.
For a deep description see this manual (UM1904).

8

For selecting SPIRIT1 expansion board, see below.

9

Radio configuration parameters are below.

10

Packet configuration parameters are below.

11

Setting the address of the nodes are below.

12untitled

Setting the user defined commands are below.

untitled13

 

Go on TOP