Setting up the BLE OAD Environment

This section will cover the steps required to setup a BLE OAD environment.

The BLE OAD topology is described below. Refer to Figure 158. for a review of the devices involved in an OAD.

  • OAD Distributor: BTool connected to Host Test on CC13x2 or CC26x2 LaunchPad.
  • OAD Target: BLE sample application (simple_peripheral, project_zero) with OAD functionality enabled.

Note

TI provides mobile applications that support OAD, these are outside of the scope of the OAD guide. Refer to the Quick Start Guide for more information. Project zero does not support secure OAD at this time

Prerequisites

This section requires the following hardware and software components

OAD Target Setup

In order to perform a BLE OAD, an OAD capable image must be loaded onto the OAD target device. This section will cover the steps required to load the CC13x2 or CC26x2 LaunchPad with an OAD enabled BLE image.

Note

Per default, BLE5-Stack projects use the Secure OAD feature. For steps on how to disable this feature (and perform a non-secure/unsecure OAD) please see Disable Secure OAD.

  1. Navigate to the simple_peripheral_oad_offchip or simple_peripheral_oad_onchip folder inside the BLE5-Stack.

  2. Import the projects into the workspace of your selected IDE.

    • See the Quick Start Guide for instructions on how to work with your selected IDE.
  3. Navigate to bim_offchip or bim_onchip folder (respective to your chosen project) inside the nortos folder.

  4. Import the project into the workspace.

  5. Select the proper build configuration based on debug needs (make sure to use the same as for BIM).

    • Debug
    • Release
  6. Build the stack project

  7. (on-chip OAD only) Build and flash the persistent app project

    • The build steps must be done in order, or errors will occur
  8. Build and flash the app project

    • Uniflash must be used to flash the _oad.bin image that is produced by the oad_image_tool or the device will not boot after a reset.
    • The _oad.bin file contains CRC and (if applicable) security information about the image. This is used by the BIM on boot to determine which image to run. If the image is flashed directly from the IDE, the device will not boot after subsequent resets as either CRC or security information is missing
    • See Loading a Production Image for more information.
  9. Build the flash the BIM project

    • The BIM debug configuration does not do CRC checks on the image, making it possible to flash an image straight from the IDE.
    • If your device does not boot, it is likely that the incorrect version of BIM was flashed, see Loading a Production Image for more info.
  10. Verify the device has booted up and is advertising

    • Verification: Open a terminal window with 115200 8N1 to the XDS110 Class Application/User UART port corresponding to your CC13x2 or CC26x2 LaunchPad.
    • The console should display the text below, use it to get the BLE address.
    ../_images/sbp_oad_boot_screen.png
  11. Alternatively, you can get the BLE address of the device using Uniflash.

    • See the screen shot below for how to do this in Uniflash.
    ../_images/verify_bdaddr_uniflash.png
  12. Plug/unplug the device to prevent Halt In Boot (HIB)

    • If the device does not advertise after reset, ensure the _oad.bin file was loaded.

Disable Secure OAD

Most steps for performing non-secure/unsecure OAD are the same as for Secure OAD. However there are some configuration changes to be made.

  1. After importing the projects, select the proper build configuration for the BIM project. Choose Debug_unsecure or Release_unsecure in order to not use Secure OAD.

  2. Make sure the corresponding build configuration (Debug/Release) is used for the app project (and persistent app project if applicable). E.g., if the BIM is set to use Debug_unsecure, make sure the ble5_project_zero_cc26x2r1lp_app also uses the FlashROM_Debug build configuration.

  3. Disable the SECURITY preprocessor define. This define is found in the Options/Properties Predefined Symbols list, or in the .opt file in the TOOLS/defines folder. Disabling this define impacts the following files:

    • ble_release.cfg/ble_debug.cfg
    • oad_image_header.h
    • oad_image_header_app.c
    • bim_main.c
  4. Disable the SECURITY linker define. Disabling this define impacts the linker command file (.cmd or .icf).

OAD Distributor Setup

As per the Introduction section, the OAD Distributor is the device responsible for fragmenting an OAD enabled image in to chunks of OAD blocks and sending each block over the to the OAD Target device as they are requested.

In the case of BLE, the OAD Distributor is a combination of BTool running on the PC connected to host_test running on a CC13x2 or CC26x2 LaunchPad. host_test is a BLE enabled network processor application. BTool is a PC tool that is capable of interfacing to host_test and performing various BLE functions in addition to OAD. For more information, refer to the host_test README file or the BTool User’s Guide.

Flashing the host_test Image

See below for the steps to setup the host_test image on a CC13x2 or CC26x2 LaunchPad.

  1. Navigate to hexfiles folder within the BLE5-Stack.
  2. Select the host_test_*.hex file.
  3. Flash the above hexfile using UNIFLASH. See image below
../_images/host_test_uniflash.png

Connecting BTool to host_test

BTool and host_test communicate via USB through the XDS110 UART back channel. See below for a diagram

../_images/ditaa-a59affabe57be29f72a0c4b1672569165bb04124.png
  1. Find the port used by the UART backchannel of the CC13x2 or CC26x2 LaunchPad running host_test. This is the one with the name XDS110 Class Application/User UART

  2. Open BTool (see the BTool executable in the tools folder of the BLE5-Stack)

  3. Use the following serial port settings, hit OK

    • Port: <PORT_FROM_ABOVE_STEP>
    • Other settings: 115200 8N1
  4. This should open and initialize the host_test device.

  5. Pressing the scan button should populate a list of devices in the log

    • A screen shot of a properly initialized BTool session is shown below
    ../_images/btool_init_success.png