This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540 over-the-air firmware upgrade

Other Parts Discussed in Thread: CC2541, CC2540

Hello,

I am trying to upgrade firmware of CC2540F256 Mini Developement Kit by over-the-air option.

So far I managed to load it with BIM firmware, load SimpleBLEPeripheral .hex file via CC debugger and then by iOS SensorTag app load the .bin firmware. I used manual from this topic: http://e2e.ti.com/support/low_power_rf/f/538/t/238079.aspx. Here is some recapitulation of steps what I did because I still had difficulties to follow. Maybe someone will find it interesting:

  1. Load C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\util\BIM\cc254x\BIM.eww in IAR and compile it.
  2. With SmartRF flash programmer load C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\util\BIM\cc254x\CC254xF256\Exe\BIM_CC254xF256.hex to the KeyFob device. Use option Erase, program and verify.
  3. Load C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\SimpleBLEPeripheral\CC2540DB\SimpleBLEPeripheral.eww in IAR.
  4. In the Workspace window select CC2540-OAD-ImgA option and in project options > linker > output select option other.
  5. Compile.
  6. With SmartRF flash programmer load C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\SimpleBLEPeripheral\CC2540DB\CC2540-OAD-ImgA\Exe\SimpleBLEPeripheral.hex to the KeyFob device. Use option Append and verify.
  7. Connect the device to the iOS TI-BLE SensorTag app. Go to profiles > TI OAD Profile > ON. Select Upload FW Image and choose internal or your own .bin file. Use the other one than the current one (imgA or imgB). They should be load in the to the different parts of the memory so with this you don't rewrite running firmware.

And now to my question. My first problem is that after loading firmware via over-the-air option (I tried so far with internal SensorTagImgB.bin) the KeyFob is not advertising any more even after reset of the device. What could be the problem?

My other question is if this is extendable for other projects? I would like to make it work with my project built on KeyFobDemo sample app. I guess I need to:

  1. Enable OAD service. Any suggestions?
  2. Change configuration to imgA. Is it available for KeyFobDemo?
  3. Produce .bin file from my project. No idea how to do that..

Thanks for the help. I hope this topic will finally provide some guide for over-the-air firmware upgrade.

Best regards,

Ondrej

  • Hi Ondrej,

    thanks for your effort! Perhaps you could complete the info in the BLE Wiki with your findings.

    I can only try to figure out keyfob has auto ADVertising disabled.

    Try to find this line which is probably set to FALSE and switch it to true.

    uint8 initial_advertising_enable = TRUE

    in the keyfob project prior compiling and flashing it.

    It's been a while since I last used the keyfob but as far as I remember you had to press a button to make it ADV.

    Nothing to say about OAD since I have not worked with it, sorry :)

  • Hello,

    thanks for reply! Its good idea about wiki. I will get to it when I find some time.

    I know this line. I will try maybe it helps. But I think the biggest problem is now generating .bin file from IAR. Because I now tried load just file of SensorTag to the device where original code is SimpleBLEPeripheral firmware.

    So does anybody know how to produce .bin file? I set in extra output option to generate msp-txt file. But when I upload it via iTunes to SensorTag app and I try to load it to Keyfob device over-the-air it says: "Image you choose is type A that is the same like in the device". But I am sure I compile it with ImgB configuration file! Some suggestions?

    Ondrej

  • The following link contains very detailed information about how to set up your configuration for building Image A and Image B. I'm not sure if this is the guide you're already following, but it seems to explain just what you need in sections 10 and 11:

    http://processors.wiki.ti.com/images/8/82/OAD_for_CC254x.pdf

    Hope this helps,

    David

  • Hi David,

    thanks so much. That was exactly the document I was looking for. I haven't gone through it in details so far but looks very promising. I am wondering why I didn't find it on wiki before. I was also searching there by the way. Probably not properly enough. I will let you know if it works.

    Regards,

    Ondrej

  • Hello,

    so I have tested setting up the OAD according to the guide with SimpleBLEPeripheral project and everything is working perfectly. I can update the firmware via SensorTag application.

    Now I would like to extend it to the project that I built on KeyFobDemo app. I created the ImgA and ImgB configurations, added OAD service and so on. Plus couple more dependencies that were missing. I created "super" .hex file (BIM + ImgA + ImgB) on KeyFob device by uploading via IAR. Seems image A is running after that. So then I can update ImgB via SensorTag app. It works with no error. But the problem is that after that upgrade the ImgA is still running (I can rewrite ImgB over and over again but I can never program ImgA by OAD). The device doesn't want to switch to ImgB even after "battery removed" reset. Also when I upload ImgB with higher version by IAR it doesn't switch. I think the problem is with memory addressing. But I don't know where to start to correct it. I am still quite new to this topic.

    Thanks for suggestions.

    Ondrej

  • Hi Ondrej,

    Have you got this issue resolved? If so can you share the solution?

    I followed the instruction for "BLE Developer's Guide for Over-the-Air Download for CC254x version 1.2" to build image-A and image-B of a keyfobdemo based project.  I did the following steps

    1. Download BIM to keyfob via CC debug in IAR;

    2. Downlaod Imag-A to keyfob via CC debug in IAR;

    3. Down load Imag-B to key fob via CC debug in IAR;

    The keyfob has CC2541 on it. I followed the guide and used smartRF05 with a CC2540 as the OAD manager. The SBL successfully loaded the image to the OAD Manager (steop 7 on page 10 of the Guide). However the OAD failed when the progress bar on the LCD is 2 (step 10 on page 11 of the Guide). 

    Any suggestions?

    Thank you!

    Qin

     

     

     

  • Hi Ondrej!

    Have you resolved your problem already?

    I have the same problem and I don't know what to do.

  • Hi igor,

    I did not get response from Ondrej. 

    Instead, I used the BLE Device Monitor to download directly from PC bypassing the SBL tool. It works for me. Though this tool always alternates between image A and B.  Here is the link to the wiki page.

    http://processors.wiki.ti.com/index.php/BLE_Device_Monitor_User_Guide#Over-the-Air-Download_.28OAD.29

    Hope this helps.

    Qin

     

  • Hello Ondrej ,

    Could you please explain the steps how you were created " Super hex file " . I have BIM hex file , OAD Img A.hex file , OAD Img B hex file but still i am unable to create Super hex file for my applkication . I am using CC2541 based device. and ios based application

    Thanks in Advance

  • Kadari,

    Pls see the followings if you haven't got it done.

    Nor could I generate the super hex file as "OAD_for_CC254x.pdf" described. However, there are ways to do it as below,

    1. Refer to thread "http://e2e.ti.com/support/wireless_connectivity/f/538/t/267516.aspx".

    2. Enter command like "type BIM.hex OADImgA.hex OADImgB.hex > superhex.hex" under the DOS prompt.

    Jed

  • Hello,

    I want to burn the code on CC2540 chip using OAD feature from mobile App

    Is it possible to burn different code on c2540 chip using its OAD feature ?

    How should I proceed? 

    Thanks in advanced

  • Hi,

    Yes, you can burn the code using OAD. 

    First you need to generate BIM and IMage A which supports OAD feature.

    First flash BIM using smart RF flash programmer (Use "Erase and Program" option)

    Then Flash image A which supports OAD. (Now use "Append and verify option).

    Now your device will be in OAD mode. so you can easily update firmware using mobile application as many time as you want. I mean above procedure you have to do once and then you can load different firmware images as image B and always perform OAD. 

    Also refer to OAD guide for cc254x. 

  • Thank you very much Maulik for kind reply, this information is  really helpful

    Is there any existing Mobile App available? so that i can use to burn new code on my chip?

    & in which format I should keep the image B (new code) in App to transfer it to my chip?( .hex or any other file format?)

    Thanks & Regards,

    Shruti

  • You can use download sensortag mobile app freely from TI website , The format of the image should be .bin file

  • Thank you 

    Do I need to use any external hardware with this (except from my cc2540 chip with BIM & image A already burnt on it),  to transfer the code using the Mobile App?

    Please guide

  • No, You can directly update image B via application. 

  • Hello,

    I have generated imgA of my code & successfully uploaded on the chip

    I am facing a problem, while running TI-BLE Sensor Tag app. I am unable to get OAD profile in that

    & while I press "Upgrade FW" in the app, it gt crash

    Please guide me to fix this issue

    Thanks

  • Hi,

    Did you enable flag "FEATURE_OAD" while compilation of new firmware image?  If not then compiler will not enable OAD feature. 

  • Yes

    I have add "FEATURE_OAD" under the Defined Symbols in options->C/C++ compiler->processor

    & then compiled code

    But still not getting OAD profile in app

  • Are you adding all 3 options as listed below?

    FEATURE_OAD_BIM
    HAL_IMAGE_A
    FEATURE_OAD

  • Yes

    I have add all of them too, but still not working

    is there something else, that i am missing?

    Please guide me

    Thank you very much

  • Hi Shruti,

    No, I don't think so. From compilation point of view everything should be fine.

    Can you revert your changes and check if it's working fine? 

    and analyse your changes that you are not changing UUID of service.

    May be it can be something else.  

  • Shruti,

    Did it have the same crash problem while using TI BLE Multitool App?

    Jed

  • Hi,

    Yes, facing same crash problem with TI BLE Multitool App also when I choose the option "Update FW"

    What could be the problem?

    Please help

    Thanks

  • May be problem with app.

    Check this:

    http://e2e.ti.com/support/wireless_connectivity/f/538/t/358032.aspx

  • Hi,

    Thank you so much for kind response

    It is now working....have fixed issue

    Please guide me I want to upload my image B code in to the chip instead of internal image present in the app already, how to do it?

    I am trying the same using BLE Device Monitor desktop app but the option for Program (OAD) in same app is not working (enabled)

    Thanks

  • Hi,

    Do you mean, you are unable to click on OAD option in BLE device monitor? or OAD option is not successfully updating your image?

    You can use same TI's sensorTag application to flash your image. Your image should be in *.bin format. you can enable it from project->options->Linker->Extra output tab. 

    1. Enable extra output and select "Simple-code" in output format. Don't check "override default" option. and format variant as "None". 

    Once bin file is generated you can upload it via mobile app.

  • Yes, I am unable to click on "Program (OAD)" option in BLE Device Monitor Desktop app

    i have generated image b file of my code but don't know how to add it in sensor tag app?? so that i can use that to upload it in my chip?

    Thank you

  • Hi,

    It means that BLE device monitor is not able to find OAD service.

    I guess in image B you don't have OAD service.

    You'll have to make image B invalid. thus you have image A running which will have OAD and then try to update firmware. I am not aware how to make image B invalidate, you can create new post and ask other guys. 

    Problem here is you don't have OAD service in Image  B. 

  • Hi,

    Thanks for valuable reply

    I have burn BIM.hex file & image A file(with OAD profile) in my hardware. Now I am trying to burn image B in my hardware but not getting how to include image B in TI Sensortag app

    Should I burn image B file also on my hardware with BIM & image A using CC debugger?

  • Hi,

    You can try to burn image using CC debugger but most probably it won't work.

    I haven't used TI sensor Tag application for OAD so don't know.

    I think there should be an option for OAD. You can download bin file to iphone via mail or dropbox.

      

  • Hi,

    Thank you

    I have successfully burn image B on my chip using sensortag app

    Now i am trying to burn another code on same chip what changes i should make in my code?

    Right now i have generated new image B with higher OAD_IMAGE_VERSION  & tried to burn on same chip but it gives me an error that "chip consists of same image B file" I have also tried to burn .bin file of image A with different OAD_IMAGE_VERSION & that error is gone but unable to burn file

    am I missing something in code or can't I burn more than 1 file using Over the air feature on a single chip?

    Please guide

    Regards,

  • Hi,

    Can you try without changing version of  Image?

  • Hi,
    I am trying to adapt the simpleBLEPeripheral to update some beacons I have. I already have .bin files that I received with the beacons so I don't think I need to go through steps 1-3. I am starting at step 4 but when I select CC2541-OAD-ImgA IAR stops responding. Can anyone tell me why? I am using IAR 8.2 and ble stack 1.4.

    Thanks