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 205. for a review of the devices involved in an OAD.
OAD Distributor: BTool connected to Host Test on CC13xx or CC26xx 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
2x CC13xx or CC26xx LaunchPad
SimpleLink CC13xx/CC26xx SDK installed
OAD Settings in SysConfig¶
There are a few OAD related defines that can be set in SysConfig. To view them,
open the project .syscfg file and navigate to
RF STACKS -> BLE -> Advanced Settings -> OAD Only Defines
as shown in the
screen shot below. The related defines are set in ti_ble_app_config.opt. Keep
the default settings for the procedure in this guide.
OAD Define |
Function |
|
Blink LEDs for different states in App, BIM and Persistent App (on-chip only). |
|
Enable/Disable debugging feature for external flash via UART for off-chip OAD applications (refer to oad_efl_dbg.h for details). |
|
Required for OAD functionality. |
|
Not to be confused with secure/non-secure OAD (refer to OAD Security). If defined in the user / persistent (for onchip OAD) application project, The OAD distributor will be forced to be paired with the OAD target in order for the OAD to happen. |
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 CC13xx or CC26xx 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.
Navigate to the
simple_peripheral_oad_offchip
orsimple_peripheral_oad_onchip
folder inside the BLE5-Stack.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.
Navigate to
bim_offchip
orbim_onchip
folder (respective to your chosen project) inside thenortos
folder.If
bim_onchip
is used, enable theAUTHENTICATE_PERSISTENT_IMG
define in the project’s .opt file if an authenticated persistent application is desired. By default, this is enabled.
Import the project into the workspace.
Select the proper build configuration based on debug needs (make sure to use the same as for BIM).
Debug
Release
(on-chip OAD only) Build and flash the persistent app project
Warning
The build steps must be done in order, or errors will occur
The default address mode for the simple_peripheral_oad_onchip example is set to Resolvable Private Address with Public Identity Address (
ADDRMODE_RP_WITH_PUBLIC_ID
). In the next section Performing a BLE OAD, the OAD distributor (Btool + HostTest) will reset the OAD target (simple_peripheral_oad_onchip) by writing a command to the OAD Reset Service (OAD Reset Service (0xFFD0)) to make the OAD target reboot into the OAD persistent App which will handle the OAD transfer. The persistent app use public address mode (ADDRMODE_PUBLIC
). In this case BTool will automatically try to re-connect to the previous random address which does not exist anymore. To make te OAD procedure easier with BTool you can change the default address mode for simple_peripheral_oad_onchip to public mode. Open simple_peripheral_oad_onchip.syscfg (double-click on file in CCS), navigate in the GUI toRF STACKS -> BLE -> General Configuration
, change the default address mode to Public Address and rebuild the project. The default address mode is set in the SysConfig generated fileti_ble_config.h
.Uniflash must be used to flash the
_oad.bin
persistent image that is produced by the oad_image_tool or the device will not boot after a reset. When flashing the persistent image .bin file, you must specify the binary load address as the starting address specified in the persistent application project’s linker file. By default, this is at address: 0x00038000.The
_oad.bin
file contains CRC and (if applicable) security information about the image. This is used by the BIM on boot to determine the validity of an image.See Loading a Production Image for more information.
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 missingSee Loading a Production Image for more information.
Build and 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.
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 CC13xx or CC26xx LaunchPad.The console should display the text below, use it to get the BLE address. The Resolvable Private Address (RPA) is what is broadcasted over the air in the advertisement packets.
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.
After importing the projects, select the proper build configuration for the BIM project. Choose
Debug_unsecure
orRelease_unsecure
in order to not use Secure OAD.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 theble5_project_zero_cc26x2r1lp_app
also uses theFlashROM_Debug
build configuration.Disable the
SECURITY
preprocessor define. This define is found in the Options/Properties Predefined Symbols list, or in the.opt
file in theTOOLS/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
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 CC13xx or CC26xx 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 CC13xx or CC26xx LaunchPad.
Navigate to
hexfiles
folder within the BLE5-Stack.Select the
host_test_*.hex
file.Flash the above hexfile using UNIFLASH. See image below
Connecting BTool to host_test¶
BTool and host_test communicate via USB through the XDS110 UART back channel. See below for a diagram
Find the port used by the UART backchannel of the CC13xx or CC26xx LaunchPad running host_test. This is the one with the name
XDS110 Class Application/User UART
Open BTool (see the BTool executable in the tools folder of the BLE5-Stack)
Use the following serial port settings, hit OK
Port: <PORT_FROM_ABOVE_STEP>
Other settings: 115200 8N1
This should open and initialize the host_test device.
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
Note
You might have to reset the HostTest application by pressing the RESET button on your Launchpad (button by the micro-USB connector) before you open the COM port in BTool.