Presentation is loading. Please wait.

Presentation is loading. Please wait.

Over the Air Download Peripheral Device Central Device Slave Master

Similar presentations


Presentation on theme: "Over the Air Download Peripheral Device Central Device Slave Master"— Presentation transcript:

1 Over the Air Download Peripheral Device Central Device Slave Master
Bluetooth low energy Over the Air Download New version firmware Peripheral Device Slave Central Device Master

2 Over the Air Download OAD Target OAD Manager BIM OAD Application
OAD Manager(typically iOS devices, Android devices, or PC) runs an OAD application(it is a TI proprietary BLE profile) and has an OAD image (new firmware) to send to OAD target. OAD Target(real BLE products) has BIM(Boot Image Manager), an old image, and prepared area for new image. OAD Manager send new image over-the-air by OAD application. OAD Target stores new image and with BIM, system will jump to new image to execute. OAD Target OAD Manager BIM Old Image(A) OAD Application OAD Image Area for new Image(B) Binary image over BLE

3 Over the Air Download The following sections will show how to use OAD.
With Keyfob sample code and BLE Device Monitor. It contains 4 parts: Configure BIM Configure image A Configure image B Over-the-Air Downloading

4 Configure BIM (Boot Image Manger)
The boot code is separately built and debugged or programmed via the IAR IDE. The project is located at: $INSTALL_DIR\Projects\ble\util\BIM Before debugging or physically programming the OAD application code produced in the next section, this OAD boot code must first be programmed into the flash. The .hex file produced by this project build can be programmed directly using a tool like the SmartRF Programmer.

5 Configure image A First of all, it is very important for this example, if “DEFAULT_ENABLE_UPDATE_REQUEST” is set to be “TRUE” in your keyfobdemo.c file, please set it to be “FALSE”. Otherwise it will effect BLE Device Monitor’s OAD application. In the real product you do NOT need to do this.

6 Configure image A Select ProjectEdit ConfigurationsNew… and add a new build target as shown

7 Configure image A Select PROFILESAddAdd Files and add the files for OAD Profile as show below from the following directory: INSTALL_DIR\Projects\ble\Profiles\OAD

8 Configure image A Select TARGETCC2540EBDriversAddAdd Files and add hal_crc.c as show below from the following directory: INSTALL_DIR\Components\hal\target\CC2540EB

9 Configure image A Enable the OAD Profile in the Application by adding a call to OADTarget_AddService() function wherever the other BLE Profiles are activated. For keyfob project is in KeyFobApp_Init().

10 Configure image A Add an include of the OAD Profile header file in the module accessed in last step. As an example, this is done at the top of the keyfobdemo.c module as shown below:

11 Configure image A Select Project->OptionsC/C++ CompilerPreprocessorDefined symbols and add the following 4 new definitions as shown in the figure: FEATURE_OAD, OAD_KEEP_NV_PAGES, FEATURE_OAD_BIM, HAL_IMAGE_A And include the path to the OAD Profile as shown above in the ‘Additional include directories’: $PROJ_DIR$\..\..\Profiles\OAD

12 Configure image A Select Project->Options->Build Actions->Post-build command line and paste the following line (with no carriage return and exactly one single space between quote marks): "$PROJ_DIR$\..\..\common\CC2540\cc254x_ubl_pp.bat" "$PROJ_DIR$" "ProdUBL" "$PROJ_DIR$\CC2541DK-mini Keyfob Slave OAD-imgA\Exe\KeyFobDemo" Note that the relative path above will contain different names as you work with projects other than the CC2541 Keyfob.

13 Configure image A Select Project->Options->Linker->Config->Linker configuration file and paste the following line: $PROJ_DIR$\..\..\common\CC2541\cc254x_f256_imgA.xcl

14 Configure image A Select Project->Options->Linker->Output->Format->Allow C-SPY-specific extra output as shown below.

15 Configure image A Select Project->Options->Linker->Extra Output->Format Select the ‘Format->Output format’ to be ‘intel-extended’ and check the box for ‘Output fileOverride default’ and use the ‘.hex’ suffix for the output file.

16 Configure image A Select Project->Options->Debugger->Texas Instruments->Download. Uncheck the box to ‘Erase flash’ and check the box to ‘Retain unchanged pages’ so that the BIM is not erased when this application image is downloaded from IAR.

17 Build image A Build and download the project on Keyfob.
You may receive a post-build error. This is because you have not yet produced the .sim file. You can ignore this error at this point. Relax, don’t be scared or panic, nothing is wrong!

18 Configure image B Similar steps as above will be followed to create the Image-B build target, using the Image- A build target as the source.

19 Configure image B The preprocessor definition needs to be changed from HAL_IMAGE_A to HAL_IMAGE_B. Very easy.

20 Configure image B The post-processing build actions path to the EXE must be changed:

21 Configure image B The linker control file must be the one for Image-B.

22 Configure image B Now you have configured the image B, you can compile and program the .hex file into Keyfob. Then the Keyfob will contain BIM, image A and image B. (Note: programming image B into Keyfob is NOT a must step) In order to do OAD, the image file must be a .bin file, the following steps will show how to create it.

23 Configure image B Change the ‘FormatOutput format’ to be ‘simple-code’ and do not check the box for ‘Output fileOverride default’ as shown below.

24 Configure image B Open the ‘oad_target.c’ module and change the version field in the Image Header from 0x0000 to 0x0002 as shown in the below figure. This will mimic an updated version of the image when the BIM checks the image header.

25 Configure image B Build but do not download the target build. This will produce the output binary file for OAD in the output directory here: INSTALL_DIR\Projects\ble\KeyFob\CC2541DB\CC2541DK-mini Keyfob Slave OAD-imgB\Exe\KeyFobDemo.bin If this is your first time building with simple-code (.sim) output, you will have to build the project twice for the binary file to be produced. We will use BLE Device Monitor to do OAD with the Keyfob. Please connect a CC2540 USB dongle to PC and start BLE Device Monitor.

26 Over-the-Air Downloading
Once BLE Device Monitor has discovered the keyfob, connect it. Then BLE Device Monitor will show the device supports OAD in the event log:

27 Over-the-Air Downloading
Select File->Program(OAD), you will get Target Firmware Update window. Browse to the .bin file location you have just compiled, then you will see the version information of the .bin file below. Click “Start”, then everything begins!


Download ppt "Over the Air Download Peripheral Device Central Device Slave Master"

Similar presentations


Ads by Google