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 OAD: size of minimal A-image ?

Other Parts Discussed in Thread: CC2540

I've read the OAD guide and believe I understand the memory map and mechanism.

I'd like an asymmetric A/B setup (minimal A image just for loading, large B image for the 'real' application), and I think I understand how to tweak the projects to do that.

But:

When stripping the SimpleBlePeripheral project (imgA configuration) of everything I can think of, leaving just the stack and the OAD service, the map file still reports a whopping 102kb of code. Not good, my application is around 170k (and 102 + 170 > 256).

Anyone with experience on what size to expect of the simplest possible 'image-A', I.e. just the stack and the OAD service ?

BR

Per

  • I have the same question.

    I was looking at the "Developer's Guide for Over Air Download for CC254x" version 1.0. The section 12 "Maximize the Image-B area" suggest that you can get the image size down to about 12K ( see the -D_CODE_BEG=0x0830 and -D_CODE_END=0x2FFF .. 0x2FFF - 0x0830 = 0x27CF or about 10.2 K Bytes. ), however the next page, at item 6. has OAD_IMG_A_AREA at 60, which I think are pages (one page is 2K, so 120K of space).

    I think I've either mis-understood how these defines are being used, or they are saying two very different things.

    [ EDIT 1]

    * Same basic question is asked here: http://e2e.ti.com/support/low_power_rf/f/538/t/247590.aspx , they suggest they can get imgA down to about 80K.

    [Edit 2]

    * I used intelhex.py and python v2.7 to look at the CC2541DK_BIM_SensorTagOadImgA.hex file provided by TI in the BLE v1.3 release (under Accessories/HexFiles). By looking at 0x0800 + 6 and 0x0800 +7 in the hex file, I found that the Length was set to 0x7C00, which translates to 31744 . However, by looking at oad_target.c , we can see that the data in the len filed is the (Number of pages ) * (( Singe Page size ) / (write block size)) . In order to get the number of bytes total, we need to multiply by the write block size (see OAD_FLASH_PAGE_MULT which is (single Page size / write block size), and HAL_FLASH_WORD_SIZE which is write block size.

    So the length of data in the Image A for the Sensor tag (in the BLE v1.3 release) is 31744 * 4 = 126,976 Bytes.

    Data location was found by looking at the structure of img_hdr_t in oad.h, and using the -Z(CODE)CHECKSUM=0x0800-0x0801) to locate this item. Verified that it was the correct data by reading back the 0x65 ('A') from locations 0x0800 + 8,0x0800 + 9,0x0800 + 10,0x0800 + 11

  • There is a plan to document this on the following wiki page:

    http://processors.wiki.ti.com/index.php/OAD

    LPRF Rocks the World

  • I want to support Over The Air Firmup function of CC2541 Keyfob.

    According to 《OAD_for_CC254x.pdf》document, I can't produce the binary file(. bin file).

    on page 11 of 《OAD_for_CC254x.pdf》

    "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."

    But I have builded twice,still  didn't get the  binary file.

    My IAR Version is :

    Can you advice how to produce the binary file?

  • I was able to produce the .bin file manually using cc254x_sim2bin.exe file that was installed with the TI BLE Stack.

    It is found here: (for stack version 1.3.1)

    C:\Texas Instruments\BLE-CC254x-1.3.1\Projects\ble\common\cc2540\cc254x_sim2bin.exe

    I called this from a command prompt (start menu, run, "cmd"), the use 'cd' to get to the directory shown above

    The call is

    cc254x_sim2bin.exe <name of sim file> <name of bin file>

    e.g.

    cc254x_sim2bin.exe SimpleBLEPeripheral.sim SimpleBLEPeripheral.bin

    will create SimpleBLEPeripheral.bin from the file SimpleBLEPeripheral.sim

    you can see how TI is doing this by looking in the .js file in the same directory as cc254x_sim2bin.exe

  • I got it,thank you very much!

  • Hi

    Has anyone answered this question? I have the same issue where I am trying to minimize the imgA code size. I get around 102kB as well after stripping everything down.

    I followed the OAD guide so that it reduces the imgA to about 81kB and extends the imgB area accordingly.

    However, I can't get imgA size below 102kB! 

  • Did anyone ever find an answer to getting imgA down in size?

  • Hi

    Could you show me how to create SimpleBLEPeripheral.bin from the file SimpleBLEPeripheral.sim by running the "cmd". attaching picture will be better. the BLE stack i use is 1.4.0 and instelled in E:\..........

    Thanks in advance.

  • Follow the step here. blog.csdn.net/.../50289371 , you may need to do online translate, it in Mandarin.
    The critical point is in file: cc254x_ubl_pp.bat, in folder: E:\BLE-CC254x-1.4.0\Projects\ble\common\cc2540\,
    you need to add in the second line, " %~d1 "
    @echo off
    %~d1
    chdir %1\..\..\common\cc2540
    start cc254x_ubl_pp.js %2 %3 %4 %5

    The rest just follow TI OAD manual. The "%~d1" will gen .bin.
    You may use the following for both Image-A and Image-B.
    1. Linker->Extra output (simple-code) [gen .sim]
    2. Linker->Extra option-> -Ointel-extended,2=.hex [gen .hex]
    3. cc254x_ubl_pp.bat-> add line 2: (%~d1) [gen .bin]

    You should then get the .sim, .hex, and .bin
  • Hi KW Lee:

        Thanks for your help!