User guide

在本节中,我们将专注于如何开始使用社交疏散标记应用程序以及如何从可用的硬件获取最佳性能。

Build the application

如果您不熟悉DA1469X平台的开发,则强烈建议通过DA1469x Getting Startedas this document will guide you through the installation of the development environment as well as writing a first application in the flash.

Once accustomed with the process, the required step to build the SDT application are:

  • Download and unzip theWiRA SDK。需要注册和签署SLA以便能够下载SDK。

  • Download and unzip the社交偏移标记应用程序。

  • 确保WIRA SDK或SDT应用程序的路径中没有空间(它会导致编译器失败)

  • Start SmartSnippets Studio and select the workspace to point at the root of the SDK. The means the folder named WiRa_XXX (contains the folder sdk, binaries, utilities…)

  • To be sure the workspace is correctly set, make sure the。metadatafolder has been created along the binaries folder in the SDK root.

_images/metadata.png
  • Browse for resources to import the Social Distancing Tag application in the project

_images / browse.png.
  • Select the SDT project and finalize the import.

  • 选择IDE视图并构建项目。最终构建了应用程序,结果在SmartSnippets Studio控制台中可见

_images / build.png.
  • Proceed with flashing the application in the SDK as described in theSoftware build入门指南的一部分。请注意,需要导入python_scriptproject to the access the flash programming tool.

Development kit configuration

At this stage it is assumed the reader has two programmed development kits. The procedure is the same whether the development kit is thePro-kit.or aUSB-kit虽然行为取决于所选的开发套件。

稍后将详细描述该行为,但应用程序假定VBUS电源的存在意味着SDT负荷,应该是不是执行测距操作。为了允许测距USB-kitit is necessary to supply the DA14695 with VBAT and disconnect VBUS.

This can be achieved by disconnecting the jumper on J2 and connecting a jumper between pin 1 and pin 2. on J3

_images/sdt_jumper_setting.png

Crystal trimming

For Wireless ranging operation it is extremely important to perform crystal trimming of the development board in order to achieve a clock accuracy of below 10 ppm for the 32 MHz crystal. Dialog provides theProduction Line Tool这允许制造商在生产过程中执行这种操作。为了在开发或评估期间更轻松,这里描述了一种旨在实现最佳性能的过程。

First download theUART_XTAL_TRIM.binapplication and store it in the WiRa SDK binaries folder.

Open a terminal, go to the binaries folder and execute:

> cli_programmer.exe  boot UART_XTAL_TRIM.bin

按RESET(K2上)USB-kit) when requested.

The crystal Trimming application is now booted and the 32MHz clock is output on portP1_6。该GPIO在Pro-套件上的标题连接器J4上提供,标题J1引脚1USB-kit

打开优选的串行终端应用程序(115200/8-N-1),然后按键盘上的“+”或“ - ”键调节频率。

为了满足目标精度,在设备上电至少几分钟后,应将频率调整为+/- 64Hz,并且在室温下运行。需要使用可以测量这种精度的频率计数器。

应用输出应如下所示

_images/trimming.png

Once the frequency is trimmed as close as possible to 32MHz, it is required to write it in the DA1469x OTP in order to let the application know how to configure the oscillator at the boot. For the rest of this chapter, let’s assume the optimal value is0x000AFD1Fas shown earlier.

首先找到OTP配置脚本中的第一个自由条目。在您用于引导Crystal Trimming应用程序的同一终端中,执行:

> cli_programmer  read_otp 0x300100.

在下面的例子中,第一个自由条目是0x345(仅用0xff的第一行)

_images / first_free.png

We shall now program the optimal value in the OTP with the following command:

> cli_programmer  write_otp 0x034520x50010000 0x000AFD1F

Warning

0x0345(address) and0x000AFD1F(trim value) are provided for example. It is required to adapt those value for each device.

Please confirm the success of the operation by repeating the read command. The crystal trim value is now programmed. None of these operation have affected the content of the flash. After a reset, the application will start and it will use the optimal crystal configuration.

Application configuration

The chapteradditional featurescontains information about the application configuration parameters. The application allows, for instance, to configure which RSSI threshold is used for warning zone. In order to update these parameters it is possible to use thecli_programmer以与使用它用于存储修剪值的方式相同,但这次将数据存储在闪存中。

The base address for the application configuration database is 0xFE100. The parameter danger zone expressed in cm is at the offset 0x12. Moving the threshold of the danger zone from 200cm (default) to 150 cm would consist in issuing the command:

> ./cli_programmer  write_qspi_bytes 0xFE112 0x96 0x00

Please note this parameter is a uint16_t, as a result it is required to write two bytes with the lower byte first.

可以通过阅读内容来确认操作:

> ./cli_programmer  read_qspi 0xFE100 - 0x20

read_qspi

Distance Offset calibration

Antenna implementation will also have significant impact on the accuracy of the wireless ranging. Depending on whether the application is loaded on thePro-kit.,USB-kit, or the WiRA Development kit (modifiedUSB-Kitwith external antenna), three different antenna configurations will apply. Each configuration will introduce a different static offset in the measurement. It is required to measure and tune the offset to get the best possible performances during SDT operation.

The offset configuration procedure will be described in a future update of this document.

Software udpate over USB

Connect the USB port of the SDT device on the host computer

In a terminal from the /suousb_host execute the following command

> host_usb_updater.exe  

Make sure you use the .img file which is generated at the build time. This contains the image header with the software version. The software version can be edited using the filed in theble_social_distance_tag/flash_image_sw_version_marking.h