| BlueNRG-1 DK: BLE examples

- Main Page
- Modules
- Files

- File List

DTM_main.c File Reference

This application configures a BlueNRG-1 device as a network coprocessor (SPI or UART) in order to be used with the BlueNRG GUI or other instruments as CBT. More...

Go to the source code of this file.

## Detailed Description

This application configures a BlueNRG-1 device as a network coprocessor (SPI or UART) in order to be used with the BlueNRG GUI or other instruments as CBT.

# ATOLLIC project

To use the project with ATOLLIC TrueSTUDIO for ARM, please follow the instructions below:

1. Open the ATOLLIC TrueSTUDIO for ARM and select File->Import... Project menu.
2. Select Existing Projects into Workspace.
3. Select the ATOLLIC project
4. Select desired configuration to build from Project->Manage Configurations
5. Select Project->Rebuild Project. This will recompile and link the entire application
6. To download the binary image, please connect STLink to JTAG connector in your board (if available).
7. Select Project->Download to download the related binary image.
8. Alternatively, open the BlueNRG1 GUI, put the board in bootloader mode and download the built binary image.

# KEIL project

To use the project with KEIL uVision 5 for ARM, please follow the instructions below:

1. Open the KEIL uVision 5 for ARM and select Project->Open Project menu.
2. Open the KEIL project `...\Project\BLE_Examples\SensorDemo\MDK-ARM\SensorDemo.uvprojx`
3. Select desired configuration to build
4. Select Project->Rebuild all target files. This will recompile and link the entire application
5. To download the binary image, please connect STLink to JTAG connector in your board (if available).
6. Select Project->Download to download the related binary image.
7. Alternatively, open the BlueNRG1 GUI, put the board in bootloader mode and download the built binary image.

# IAR project

To use the project with IAR Embedded Workbench for ARM, please follow the instructions below:

1. Open the Embedded Workbench for ARM and select File->Open->Workspace menu.
2. Open the IAR project `...\Project\BLE_Examples\SensorDemo\EWARM\SensorDemo.eww`
3. Select desired configuration to build
4. Select Project->Rebuild All. This will recompile and link the entire application
5. To download the binary image, please connect STLink to JTAG connector in your board (if available).
6. Select Project->Download and Debug to download the related binary image.
7. Alternatively, open the BlueNRG1 GUI, put the board in bootloader mode and download the built binary image.

## Project configurations

- `Release_SPI` - Network coprocessor configuration: SPI mode
- `Release_UART_16MHz` - Network coprocessor configuration: UART mode and 16MHz crystal
- `Release_UART_32MHz` - Network coprocessor configuration: UART mode and 32MHz crystal

# Boards supported

- `STEVAL-IDB007V1`

# Power configuration settings

STEVAL-IDB007V1
Jumper name |  | Description
JP1 | JP2 |
ON 1-2 | ON 2-3 | USB supply power
ON 2-3 | ON 1-2 | The supply voltage must be provided through battery pins.
ON 1-2 |  | USB supply power to STM32L1, JP2 pin 2 external power to BlueNRG1

# Jumper settings

STEVAL-IDB007V1
Jumper name | Description
JP1 | 1-2: to provide power from USB (JP2:2-3). 2-3: to provide power from battery holder (JP2:1-2)
JP2 | 1-2: to provide power from battery holder (JP1:2-3). 2-3: to provide power from USB (JP1:1-2). Pin2 to VDD to provide external power supply to BlueNRG-1 (JP1: 1-2)
JP3 | pin 1 and 2 UART RX and TX of MCU. pin 3 GND.
JP4 | Fitted: to provide VBLUE to BlueNRG1. It can be used also for current measurement.
JP5 | Fitted : TEST pin to VBLUE. Not fitted: TEST pin to GND

# Pin settings

| Release_UART_32MHz | Release_UART_16MHz | Release_SPI
PIN name | STEVAL-IDB007V1 | STEVAL-IDB007V1 | STEVAL-IDB007V1
ADC1 | Not Used | Not Used | Not Used
ADC2 | Not Used | Not Used | Not Used
IO0 | Not Used | Not Used | Not Used
IO1 | Not Used | Not Used | Not Used
IO11 | Not Used | Not Used | Not Used
IO12 | Not Used | Not Used | Not Used
IO13 | Not Used | Not Used | Not Used
IO14 | Not Used | Not Used | Not Used
IO2 | Not Used | Not Used | Not Used
IO3 | Not Used | Not Used | Not Used
IO4 | Not Used | Not Used | Not Used
IO5 | Not Used | Not Used | Not Used
IO6 | Not Used | Not Used | Not Used
IO7 | Not Used | Not Used | Not Used
IO8 | Not Used | Not Used | Not Used
TEST1 | Not Used | Not Used | Not Used

# Serial I/O

Parameter name | Value | Unit
Baudrate | 115200 [default] | bit/sec
Data bits | 8 | bit
Parity | None | bit
Stop bits | 1 | bit

# LEDs description

| Release_UART_32MHz | Release_UART_16MHz | Release_SPI
LED name | STEVAL-IDB007V1 | STEVAL-IDB007V1 | STEVAL-IDB007V1
DL1 | Not Used | Not Used | Not Used
DL2 | Not Used | Not Used | Not Used
DL3 | Not Used | Not Used | Not Used
DL4 | Not Used | Not Used | Not Used

# Buttons description

| Release_UART_32MHz | Release_UART_16MHz | Release_SPI
BUTTON name | STEVAL-IDB007V1 | STEVAL-IDB007V1 | STEVAL-IDB007V1
PUSH1 | Not Used | Not Used | Not Used
PUSH2 | Not Used | Not Used | Not Used
RESET | Reset BlueNRG1 | Reset BlueNRG1 | Reset BlueNRG1

# Usage

DTM (Direct Test Mode) application allows to configure a BlueNRG-1 as a network coprocessor and target BLE technology evaluation & RF evaluation performances tests using the BlueNRG GUI or other instruments as CBT.

Two network coprocessor configurations are available:

- UART (DTM binary file: DTM_UART_16MHz.hex; DTM_UART_32MHz.hex is also availalble for 32MHz crystal)
- SPI (DTM binary file: DTM_SPI.hex)

DTM_UART_16MHz.hex and DTM_SPI.hex binary image files are built for also including the updater code which allows to update the specific DTM FW version trough the BlueNRG GUI, Tools, BlueNRG Updater utility.

DTM binary images without updater code are also provided: DTM_UART_NOUPDATER.bin for UART configuration and DTM_SPI_NOUPDATER.bin for SPI configuration.

Once the STEVAL-IDB007V1, BlueNRG-1 platform has been configured as network coprocessor (using DTM_UART_16MHz.hex or DTM_SPI.hex binary files), new DTM binary files versions can be updated directly using the BlueNRG GUI, Tools, BlueNRG Updater utility.

The DTM project memory layout is as follows:

-----------— 0x10067FFF

- DTM

-----------— 0x10040800

- DTM Updater

-----------— 0x10040000

The DTM Updater allows to access the memory flash through ACI_HAL commands. The DTM Updater can be activated in the following way:

- Activation by using ACI_HAL_UPDATER_START
- Activation by using IO3 pin (high level at start up).
- Note: if the IO3 pin is used and is high at start up, this will cause the DTM Updater starts. So, to avoid this, the support of the DTM Updater can be removed.

If the DTM Updater support is not necessary, the DTM Updater code can be removed:

- Disable/Remove the file DTM_Updater_xxx.c inside the folder project DTM_Updater.
- Option/Linker: Change the symbol definition from MEMORY_FLASH_APP_OFFSET=0x800 to MEMORY_FLASH_APP_OFFSET=0.

Definition in file DTM_main.c.