| Bluetooth Low Energy scripts

OTA_Central.py File Reference

## Detailed Description

- The script is implemented using the new BlueNRG GUI language scripts based on the BLE ACI APIs. The BlueNRG GUI with script engine is delivered within BlueNRG GUI SW package.
- The script can also be run using the script launcher standalone utility available within BlueNRG GUI SW package.
- A PC running Windows Vista/7 operating systems (64 and 32 bit version) or Windows XP operating systems (32 bit edition), with available USB ports is required for installing the BlueNRG GUI SW package.

# OTA_Central.py, preliminary steps: configure a BLE Peripheral device with a application providing the OTA service and related characteristics

- On a BLE device load an application image providing the OTA service (reference example application are BLE Chat and SensorDemo applications with OTA service configuration).
- Make sure application is on discoverable mode and it offers the OTA service capability (refer to related BLE OTA FW upgrade Application Note for more detailed description)

# OTA_Central.py script execution steps through BlueNRG GUI Script Engine

- Open BlueNRG GUI
- BlueNRG/BlueNRG-MS platform configuration steps :
  1. Connect the selected platform to a PC USB port
  2. Put selected platform in DFU mode and download the "C:\Program Files (x86)\STMicroelectronics\BlueNRG GUI x.x.x\Firmware\STM32L1_prebuilt_images\BlueNRG_VCOM_x_x.hex" using the BlueNRG GUI, Tools, Flash Motherboard FW... utility
- BlueNRG-1 platform configuration steps:
  1. Connect the selected platform to a PC USB port
  2. Download the "C:\Program Files (x86)\STMicroelectronics\BlueNRG GUI x.x.x\Firmware\BlueNRG1\DTM\DTM_UART_16MHz.hex or DTM_SPI.hex" file on the BlueNRG-1 platform using the BlueNRG Flasher utility available on BlueNRG-1 DK SW package (STSW-BLUENRG1-DK)
     - NOTES: SPI Network coprocessor configuration file (DTM_SPI.hex) requires some HW changes to be applied to the BlueNRG-1 development platform. Refer to STSW-BNRGUI user manual UM2058.
- On BlueNRG GUI, open the USB Port associated to the plugged platform
- On BlueNRG GUI, select the Scripts window
- On BlueNRG GUI, Scripts window, Scripts Engine section, click on ... tab and browse to the OTA_Central.py script location and select it
- On BlueNRG GUI, click on Run Script tab for running the selected script
- BLE OTA central device searches for BLE Peripheral devices offering the OTA service and it allows user to select the identified device (by pressing the related index key on keyboard)
- Then user is asked to select a binary application image (*.bin file) built with the proper base address (based on the peer device available free flash memory layout) and to start the FW upgrade process
- When the FW upgrade process is completed a specific message is displayed
- NOTE: OTA_Central.py can also be run using the BlueNRG script launcher standalone utility (refer to the related doxygen documentation for instrunctions about how to use it)

# Supported platforms

- BlueNRG-1 development platform (order code: STEVAL-IDB007V1)
- BlueNRG-MS development platform (order code: STEVAL-IDB005V1)
- BlueNRG-MS Daughter Board (order code: STEVAL-IDB005V1D)
- BlueNRG-MS USB dongle (order code: STEVAL-IDB006V1)
- BlueNRG development platform (order code: STEVAL-IDB002V1)
- BlueNRG USB dongle (order code: STEVAL-IDB003V1)

# Supported BLE devices and stack versions

- BlueNRG-1 stack v1.x
- BlueNRG-MS stack v7.2x
- BlueNRG stack v6.4x