4. Software

This section describes the software-related Frequently Asked Questions.

4.1. Can I Remap SWD Pins to GPIOs?

Yes - it is possible to remap the SWD to different GPIOs.

The SWD signal mapping is defined by SYS_CTRL_REG[DEBUGGER_ENABLE] bitfield. Set the this bitfield to :

  • 0x0 to disable the debugger

  • 0x1 to configure the SW_CLK and SW_DIO to P0_2 and P0_5 accordingly ( default option for WLCSP17 package)

  • 0x2 to configure the SW_CLK and SW_DIO to P0_2 and P0_1 accordingly

  • 0x3 to configure the SW_CLK and SW_DIO to P0_2 and P0_10 accordingly (default option for FCGQFN24 package). This option is not available in WLCSP17 package

Example:

To configure the SW_CLK and SW_DIO to P0_2 and P0_1, the SYS_CTRL_REG[DEBUGGER_ENABLE] bitfield should be programmed with 0x2, as follows :

SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 2);

Note

The current settings are applicable as soon as user firmware is running. If the device resets or reboots, then the booter will revert the SWD pins back to the default settings.

The procedure is also described in Note 1 of the DA14531 datasheet .

4.2. Can I Use the Old Pro-DK (DA14580DEVKT-P) to Program a DA14531 Daughter Board via 1-wire UART?

Yes, you can use it to download firmware via 1-wire UART. When the DA14531 daughter board is attached to the old Pro-DK, then the P0_5 is exposed on header J7.Pin6 (P2_5) .

Jumper wires should be used from J5 to J7 plus a 100 Ohm resistor, as shown in Figure 1.

_images/wiring.png

Figure 1 DA1458x Pro DK Wiring

Example:

How to program the DA14531 with the Production Test Firmware via 1-wire UART using the old Pro-DK.

Steps:

  1. Use the Keil IDE to open and compile the Production Test project from the SDK6.0.14. The Keil project is located under the projects\target_apps\prod_test\prod_test\Keil_5 SDK path. The already exiting binary for the Production Test can be also used, which is located under binaries\da14531\prod_test.

  2. After compilation, the prod_test_531.hex should be generated in the Keil_5\out_DA14531\Objects folder.

  3. Open SmartSnippets Toolbox V5.0.16. See the user manual for more information.

  4. In Board Setup select single wire UART communication (see Figure 2).

_images/board_setup.png

Figure 2 SmartSnippets Toolbox Board Setup

  1. Open the RF Master.

  2. Download the prod_test_531.hex.

  3. Reset the DA1458x Pro DK. You can use the RF Master.

4.3. How to Enable and Test the Debug UART Mechanism in the DA145xx Pro Development Kit?

The ble_app_barebone example of the SDK6.0.14 is used for this demonstration. The project is located under the projects\target_apps\ble_examples SDK path. Follow the steps to enable the debug UART mechanism. The DA145xx Pro Development Kit is required as well.

Steps:

  1. Define the CFG_PRINTF macro in da1458x_config_basic.h (see Figure 3).

_images/CFG_PRINTF.png

Figure 3 Define CFG_PRINTF Macro

  1. UART2 settings are defined in user_periph_setup.h, which can be changed according to application requirements. P06 is used to enable UART2 Tx functionality (see Figure 4).

_images/UART2_settings.png

Figure 4 UART2 Configuration Settings

  1. Include the arch_console.h header file in user_barebone.c (see Figure 5).

_images/arch_console.png

Figure 5 Include arch_console.h Header

  1. Add the following code in user_app_adv_start().

char ch = 0xFF;
arch_printf("Device starts advertising") ;
arch_printf("\n\r") ;
arch_printf("Print 1 byte") ;
arch_puts(&ch);
arch_printf("\n\r");
  1. Install the wiring from J2.27 to J1.17 as shown in Figure 6.

_images/DA145xx_wiring.png

Figure 6 DA145xx Wiring

  1. Teraterm Configurations: make sure that the correct COM port is selected. The COM port is likely to be different in your setup. Select the lowest number of the two options.

  2. Run the example and the result will show in the Serial Monitor (see Figure 7).

_images/result.png

Figure 7 Result in the Serial Monitor

4.4. How Many Sleep Modes are Available in DA14531 and How to Configure These?

DA14531 SoC supports three (3) sleep modes, namely:

  1. Extended sleep mode (with or without OTP copy).

  2. Deep sleep mode (also known as shipping clocked mode).

  3. Hibernation mode (also known as shipping clock-less mode)

See the Sleep Mode Tutorial for an overview on how to configure the DA14531 SoC in any of the three available sleep modes.

In addition to the tutorial, please check out the DA14531 Bluetooth® Low Energy Eddystone beacon with Hibernation Or Deep Sleep Mode and DA14531 Configuring Hibernation and State-aware hibernation mode SW Examples.

4.5. How to Make the DA14531 Advertising with Advertising Scan Indication (ADV_SCAN_IND) Packets?

The ADV_SCAN_IND PDU is used from the peripheral to send a scan response when operating in non-connectable mode. The device should be configured in a non-connectable advertising mode and also the scan response data should be defined. For more information, see the Simple Beacon Example and Bluetooth® Low Energy Advertising Tutorial.

4.6. Can I Use Any of the DA14531 Timers in Sleep Mode?

Yes. Timer 1 can be kept active in sleep mode as the clock source is selectable between System Clock (sys_clk) and Low Power Clock (lp_clk). For more information, see the DA14531 Timer1 Software Example.

Note

When the DA14531 is configured to any of the available sleep modes, the System Clock is disabled, so the device will run with the Low Power Clock.

4.7. What Development Path Should I Follow to Migrate my FW from DA14585 to DA14531?

Our latest SDK6.0.14 is common for DA14531 and DA14585/586. If an existing application is based on DA14585/586 and SDK6.0.10, the application can be easily ported to DA14531 and SDK6.0.14. Most of the functions will be changed automatically. Just some configurations must be checked before finishing the migration. The SDK Porting Guide document describes the changes and the steps needed to port an application that has been developed under DA14585/DA14586 SDK 6.0.10 release, to the latest DA14585/586/531 SDK 6.0.14 release.

4.8. What is the difference between Clockless wake-up and Clocked wake-up controller?

The difference is that Clockless wake-up controller is only used when the system is in hibernation mode and the Clocked wake-up controller is used when the system is either in extended or deep sleep mode. In hibernation mode all clocks are stopped, but in extended or deep sleep mode the wakeup controller resides in the PD_SLP power domain and operates on the LP_CLK.

See Sections 17 and 18 in the DA14531 datasheet for more information on Clockless and Clocked wake-up controllers.

The Sleep Mode tutorial demonstrates the Clockless wake-up. The Bluetooth® Low Energy Notify Button Wakeup SW Example demonstrates the Clocked wake-up.

4.9. Can the HW Reset be Mapped to Any Other GPIO?

No, the HW reset is dedicated to P0_0 and can be only disabled.

To disable it, the WR_CTRL_REG[DISABLE_HWR] bitfield should be set to 1.

Additionally, the GPIO driver of the SDK provides a function to disable the hardware reset functionality on P0_0 : GPIO_Disable_HW_Reset()

The driver is located in 6.0.14.1114\sdk\platform\driver\gpio SDK path.

However, the Power-On-Reset (POR) can be mapped to any of the available GPIOs.

The POR_PIN_REG[POR_PIN_POLARITY] and POR_PIN_REG[POR_PIN_SELECT] bifields should be programmed to set the polarity and select the POR GPIO accordingly.

The reset time can be set by programming the POR_PIN_REG[POR_TIMER_REG].

POR_TIME: Time = POR_TIME x 4096 x RC32K clock period

The user must keep the reset pin to high or low (based on the set POLARITY) for the duration programmed for POR_TIME.

4.10. How can I put the system into hibernation (clockless or shipping) mode?

The entire process to achieve the clockless mode is explained in the Configuring to Hibernation Mode SW Example.

The Sleep Mode tutorial also demonstrates how to configure the DA14531 into hibernation mode.

4.11. How can I the QDIDs of the DA14531?

Use the links below to find the QDIDs of DA14531 for Controller, Host and Profile Subsystems:

  1. QDID Controller Subsystem

  2. QDID Host Subsystem

  3. QDID Profile Subsystem

4.12. How can I Modify Advertising Data?

According to Bluetooth LE specifications, the adverting data (and the scan response data) should follow a specific format. Refer to Section 3.1. Changing the Advertising Data in the Bluetooth® Low Energy Advertising Tutorial to see the proper step to change the advertising string.

4.13. Are the DSPS and AT CodeLess Available for the DA14531 and TINY Module?

Yes, DSPS and CodeLess available for the DA14531 and TINY module.

Dialog Serial Port Service (DSPS)

The DSPS emulates a serial cable communication. It provides a simple substitute for RS-232 connections, including the familiar software flow control logic via Bluetooth low energy. The SPS software distribution includes the application and profile source codes and supports GAP Central/Peripheral roles.

Click on the DSPS support page for more info!

CodeLess™ AT Commands

The CodeLess allows you to quickly get started with wireless IoT applications with a set of AT Commands. The CodeLess AT commands platform allows control over a local UART connected device as well as a remote device via Bluetooth® Low Energy. You can create simple demos / applications / proof of concepts without any code development or build you own application on top!

Click on the CodeLess support page for more info!