Additional features

Battery service

The SDT uses the standard bluetooth low energy battery service to report its battery status and allow, for instance, to notify the user to replace a device (or recharge) when its battery is close to being depleted.

Current Time service

The SDT uses the standard bluetooth low energy current time service to allow the internal RTC configuration. As the RTC is used as a source for time stamping, one could use time synchronized event to rebuild multiple devices interactions with ease.

Shipping mode

In order to extend shelf lifetime, the device will enter hibernate mode after the first boot. Please refer to DA1469x datasheet for more information about hibernate mode.

Configuration parameters

The configuration allows a great level of application flexibility without requiring the need to modify the algorithm or even update the firmware. The content in NVMS_PARAM_PART should be written during production. The configuration will be read at boot time and used in place of the default WiRA SDK values.

The NVMS_PARAM_PART is made of the BLE parameters and the Social Distance Tag section.

Invalid value should be left to 0xFF.

BLE parameters

Start Address: 0x0FE000 (start of the NVMS_PARAM_PART) Content:

Offset Parameter Description
0 PLATFORM BD ADDRESS 6 bytes for BD Address and 1 byte at the end as “valid” flag

In the case this not set, the Application will generate a Random address and write it in this place and use the same for product lifetime (or until the FLASH is totally erased).The “valid” entry flag is one byte after the 6 bytes of the BD Address. 0x00 indicates valid BD Address, and the application will use it. The rest of the entries are of no interest for the Social Distance Tag application and should be left with 0xFF.

Social Distance Tag parameters

This section contains all the Social Distance Tag parametrization needed to fully customize the device and create all types of devices with the same code. Start Address: 0x0FE100

Offset

Parameter

Description

0

UID

The device unique ID. Must be a unique number per device. 4 bytes (uint32_t)

4

TYPE

The device type. 0 for Wearable device. 1 byte (uint8_t).Invalid/ignored value: 0xFF

5

WIRA_enabled

indicate if with the device can be used WiRa or not.
0 – No WiRa capability
1 – WiRa enabled

6

CONNECT TO ME

indicate if other devices should connect to device or not.
0 – do not connect
1 – connect

7

FIRST BOOT

Used by the code to go to Hibernation/Shipping/Box on first boot if this is 0xFF.
Then the code will change it so it will not go to hibernate in normal operation
unless the Battery voltage drops. The device will come out of Hibernation when USB
is plugged. This MUST BE LEFT 0xFF during production.

8

DANGER RSSI

The RSSI level for the limit of Danger Zone Limit when the device is in line of
sight with the target SDT.1 byte (int8_t). (Signed number expressing the RSSI
for example -55)

9

WARNING RSSI

The RSSI level for the limit of Warning Zone Limit when the device is in line of
sight with the target SDT. 1 byte (int8_t). (Signed number expressing the RSSI
for example -55)

10

COARSE RSSI

The RSSI level for the limit of Coarse Zone Limit when the device is in line of
sight with the target SDT. 1 byte (int8_t). (Signed number expressing the RSSI
for example -55)

12

DANGER DISTANCE

The distance in Centimeters of the Danger Zone Limit when the device is in line
of sight with the target SDT. 2 bytes (uint16_t). (Unsigned number expressing
distance in cm for example 200 for 2m)

14

WARNING DISTANCE

The distance in Centimeters of the Warning Zone Limit when the device is in line
of sight with the target SDT. 2 bytes (uint16_t). (Unsigned number expressing
distance in cm for example 200 for 2m)

16

COARSE DISTANCE

The distance in Centimeters of the Coarse Zone Limit when the device is in line
of sight with the target SDT. 2 bytes (uint16_t). (Unsigned number expressing
distance in cm for example 200 for 2m)

24

SDT UUID

This is a 16-bytes UUID in the advertising data so the SDTs will recognize
each-other from passive scan results and filter out all other devices. 16 bytes
(uint8_t [16]), Default: C6E9794D-EF6F-41E7-A1B7-7F1547D843D6

40

Device Name

This is a NULL terminated string representing the device name to use in the scan
response data. 29 bytes (uint8_t [16]) NULL terminated (SCAN_RSP_DATA_LEN - 2 )

70

Proximity Scan Duration

This is the time (in ms) to collect SDT devices data in the area and at the
end to start checking which ones are too close to range then and give the
corresponding Audio/Visual feedback. 4-bytes (uint32_t)

Software update

TBD

Flash partition

The partition table is designed for a 32Mb flash. One could modify the partition table to adapt your application specific needs. The WiRA SDK contains additional flash partition examples for different flash sizes which could be used as references.

/**
 * \brief NVMS Partition IDs
 */
typedef enum {
        NVMS_FIRMWARE_PART              = 1,
        NVMS_PARAM_PART                 = 2,
        NVMS_BIN_PART                   = 3,
        NVMS_LOG_PART                   = 4,
        NVMS_GENERIC_PART               = 5,
        NVMS_PLATFORM_PARAMS_PART       = 15,
        NVMS_PARTITION_TABLE            = 16,
        NVMS_FW_EXEC_PART               = 17,
        NVMS_FW_UPDATE_PART             = 18,
        NVMS_PRODUCT_HEADER_PART        = 19,
        NVMS_IMAGE_HEADER_PART          = 20,
} nvms_partition_id_t;


#define NVMS_PRODUCT_HEADER_PART_START  0x000000
#define NVMS_PRODUCT_HEADER_PART_SIZE   0x002000
#define NVMS_FIRMWARE_PART_START        0x002000        /* Alignment to 512KB is dictated by the default FLASH_REGION_SIZE. */
#define NVMS_FIRMWARE_PART_SIZE         0x07E000

/* +----------------512KB---------------------+ */

#define NVMS_GENERIC_PART_START         0x0E0000
#define NVMS_GENERIC_PART_SIZE          0x020000
#define NVMS_PLATFORM_PARAMS_PART_START 0x100000
#define NVMS_PLATFORM_PARAMS_PART_SIZE  0x0FF000
#define NVMS_PARAM_PART_START           0x1FF000
#define NVMS_PARAM_PART_SIZE            0x001000        /* Recommended location, 4KB before the end of the 1st flash section. */

/* +------------------2MB---------------------+ */

#define NVMS_LOG_PART_START             0x200000
#define NVMS_LOG_PART_SIZE              0x100000
#define NVMS_BIN_PART_START             0x300000
#define NVMS_BIN_PART_SIZE              0x0FF000
#define NVMS_PARTITION_TABLE_START      0x3FF000
#define NVMS_PARTITION_TABLE_SIZE       0x001000        /* Recommended location, 4KB before the end of the flash. */

PARTITION2( NVMS_PRODUCT_HEADER_PART  , 0 )
PARTITION2( NVMS_FIRMWARE_PART        , 0 )
PARTITION2( NVMS_GENERIC_PART         , PARTITION_FLAG_VES )
PARTITION2( NVMS_PLATFORM_PARAMS_PART , PARTITION_FLAG_READ_ONLY )
PARTITION2( NVMS_PARAM_PART           , 0 )
PARTITION2( NVMS_LOG_PART             , 0 )
PARTITION2( NVMS_BIN_PART             , 0 )
PARTITION2( NVMS_PARTITION_TABLE      , PARTITION_FLAG_READ_ONLY )