I'm trying out OAD on the cc254x. I've added FEATURE_OAD to the preprocessor defines.
I've also added /profiles/OAD to the library search path.
When building my app or the sensortag app, I see this error:
Fatal Error[e72]: Segment IMAGE_HEADER must be defined in a segment definition option (-Z, -b or -P)
Error while running Linker.
Did I miss a step? I'm not sure where IMAGE_HEADER should be defined.
Is there a reference guide to OAD showing how to build for normal flash programming (with OAD enabled), and how to build an image for loading in over the air?
There are some steps you are missing. There should be documentation somewhere, I can't find it personally right now.
However, open up the SensorTag project or SimpleBLEPeripheral project, and select the OAD- build configurations from the dropdown menu at the top of the Workspace pane at the left of the IAR IDE.
You will then notice some changes..Extra preprocessor defines:FEATURE_OAD_BIMHAL_IMAGE_AFEATURE_OADOAD_KEEP_NV_PAGES
$PROJ_DIR$\..\..\Profiles\Oad added to include path.
"$PROJ_DIR$\..\..\common\cc2540\cc254x_ubl_pp.bat" "$PROJ_DIR$" "ProdUBL" "$PROJ_DIR$\CC2541DK-Sensor-OAD-ImgA\Exe\SensorTag" added as post-build action. This creates the .bin file used for oad transfer
$PROJ_DIR$\..\..\common\cc2540\cc254x_f256_imgA.xcl selected as linker file.
This is true for Img A. There's also Img B, which is placed at another place in flash. The flash is split in three between BIM, ImgA and ImgB.
To do OAD, you first need1) BIM programmed to the device2) ImgA programmed to the device using either IAR or Flash Programmer, where you make sure you _DON'T_ erase the flash before programming. This would erase BIM3) ImgB .bin file to program OAD. Next time you will need to program ImgA again and so forth.
To get you started, find CC2541DK_BIM_SensorTagOadImgA.hex in Accessories/Hexfiles under the stack install directory, which is 1 and 2 rolled into one that you can program with SmartRF Flash programmer.
I forgot to mention that the linker file is where your missing segment is defined.
Also, in the linker extra output the OAD builds output a .sim file for conversion to .bin. You can also change the normal output to "SensorTag.hex" and format Other->Intel-extended, for programming via flash programmer.
Thank you very much for the full explanation. I have OAD running and tested using the TI iPhone app. It seems to work well.
I do have two followup questions.
1) Does the OAD service indicate which location it is running from (A or B)? The iPhone app tells you if you try to update using the wrong side, but the source isn't available yet, so I'm not sure how it can tell.
2) What is the best way to combine the BIM (BIM_CC254xF256.hex) and Image A into single flashable hex file for production. Should cc254x_ubl_pp.bat be used for that? Are there recommended command line options for this operation?
Peter, can you explain which TI iphone app your using to test the OAD? I didn't realize TI implemented the OAD updater into any of their apps yet
Apologies for any confusion. There was an update today for the TISensorTag app. It now supports the OAD profile. It's possible to upload your own .bin files to the app. I used iExplorer to do this, and placed them in the com.ti.sc.bleweathersample/Documents folder. I don't know if that's documented anywhere, but I was able to update the firmware of my own application this way.
1) The source won't be available, but an example OAD app will be made available. If you use Device Monitor that you can find on the sensortag wiki you can enable notifications from OAD Image Notify and write first 00 and then 01 to the characteristic. If image A is running, you will get a sensible notification back after writing 00, otherwise from 01. The response is <image_id><image_len><user_id>, where the LSB of image ID tells you A(0) or B(1), and the 7 LSB are the version you have set.
Currently the Sensortag App looks for 0x41 (A) or 0x42 (B) in the user id, which is a bug that will be fixed.
2) For me it worked to simply concatenate the BIM hex file and the Image A hex file in a text editor or use the command line with type "bim.hex > superhex.hex" and "type imga.hex>>superhex.hex" in dos prompt. Otherwise you could potentially use flash programmer to read back the image that you have flashed to the device. Note that this last solution may be a bad idea, as calibration data could have been written to flash already by the device by the time you read back flash - data which may not be correct for another device.
Thanks so much. That's just what I needed to know to keep things rolling.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.