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.

Minimal image A for CC2541 OAD

Other Parts Discussed in Thread: CC2541
Hi,

I'm trying to minimize the size of ImageA in my project, I'm able to get it to around 100 KB, which is still quite large. 
There isn't enough information in OAD Guide, it would be great help if someone can guide me further or can share a generic ImageA project which is minimal in size.
Thanks.
  • Hi Ravi,

    You will need 256K flash version of CC2541 to implement the OAD feature.

    Regards,

    Vijayasarathy Shastri

  • Hi Vijayasarathy,

    The BLE Large Image OAD example on http://processors.wiki.ti.com/index.php/BLE_Large_Image_OAD, it‘s hard for me to understand  the following contents in cc254x_f256_imgB_Large.xcl :

    -D_CODE_BEG=0x4030 // Last 10 pages of Bank 0.
    -D_CODE_END=0x7FFF
    
    -Z(CODE)CHECKSUM=0x3000-0x3001
    -Z(CODE)IMAGE_HEADER=0x3002-0x300F
    -Z(CODE)AES_HEADER=0x3010-0x302F

    The code begin at 0x4030 , but the CHECKSUM start at 0x3000, why 0x3000,not 0x4000?

  • Yes, 

    I do have 256K version of CC2541, I've got OAD working. All I want is to have a tiniest possible ImageA.

    Thanks.

  • Hello,

    There is small img project example included in the LargeOAD example zip on the wiki.

    http://processors.wiki.ti.com/index.php/File:Large_OAD_Example.zip

    The map file 

    94 489 bytes of CODE memory (+ 1 767 range fill )
    35 bytes of DATA memory (+ 76 absolute )
    5 638 bytes of XDATA memory
    194 bytes of IDATA memory
    8 bits of BIT memory
    370 bytes of CONST memory

    This was SimpleBlePeripheral IMGA, with following removed

    -profiles, simple, dev info

    - gatt bond manager calls removed (so no bonding)

    - snv removed

    You can dig into project further and see what you can get rid of. Maybe some hal drivers, but this is about as small as we can make it.

    BR,

    -Greg

  • I'm trying to further reduce image-a size and in doing so i removed some of the hal driver associated to leds, keys and lcd. Now i'm in this situation:

    92 701 bytes of CODE memory (+     3 555 range fill )
    35 bytes of DATA memory (+ 71 absolute )
    5 622 bytes of XDATA memory
    194 bytes of IDATA memory
    8 bits  of BIT memory
    4 036 bytes of CONST memory

    In this configuration, using the linker files provided in the large oad example i'm able to download to the device via ccdebugger the bim and the image a and then succesfully oad image b( which the contain a custom profile to read the current version and eventually invalidate crc and reboot).


    I assume now that the 3555 range fill are "wasted" space on image a that could be re allocated to image b. I then tried to remove add a page to image b removing one from image b modifying linker files and headers as so:

    //Image A
    -D_BANK5_BEG=0x5B000            // Last 10 pages of 5
    -D_BANK5_END=0x5FFFF

    //Image B
    -D_BANK5_BEG=0x58000         // First 6 pages of 5
    -D_BANK5_END=0x5AFFF

    //oad_target.h
    #define OAD_IMG_A_AREA        46

    Using this configuration i get this on the map file

    92 691 bytes of CODE memory (+     1 517 range fill )
    35 bytes of DATA memory (+ 71 absolute )
    5 622 bytes of XDATA memory
    194 bytes of IDATA memory
    8 bits  of BIT memory
    4 036 bytes of CONST memory

    The bim now starts the image a but it seam that osal isn't working well since i'm able to follow my application until

    osal_set_event( App_TaskID, START_DEVICE_EVT). My osal task that toggle advertise mode is not called and i can't find my device to test oad (even with avertise enabled at startup the device isn't discoverable)

  • I also have another question concerning oad. I was able to generate a "suepr hex" containing the bootloader and the image a using a batch file and the type command but i'm not able to use the same procedure to generate an hex containing bootloader + imaga+ imageb together ( wich would be more practical than loading the image ota or in a second step with cc debugger during production)

  • After some research in the forum i found info about a program called srec_cat used for merging hex files. I successfully merged image a and the bootloader ( as i did with the type command) and it works but when i try to add image an error is produced

    srec_cat: ImageB.hex: 2: multiple 0x00003000 values (previous = 0x12, this one = 0x75)

    Still have no clue about the first problem of image-a size. An help would be very appreciated

  • Any chance of getting some help?

  • Hope is the last to die!

    I really need to know if and how i can allocate that one more page to image b without making the system unstable.
    Also some help in the "super hex" problem would be very appreciated altough that may be better to discuss in another topic.

  • Can PLEASE at least some guy from ti give an answer?? At this point i event accept something like "we dont care. f**k you" wich is better than getting ignored. I've been bumping the post for more than a week and is becoming quite frustrating. I thought that the forum was the most efficient way to communicate and get help from people that are more expert then myself but maybe i was wrong, if there is another way of getting an help please point me in the right direction.

  • Hello, still no one?

  • The BLE stack codes eats a lot of flash, ImgA and ImgB both use the same stack, so you should use one stack code that shared by ImgA and ImgB, duplicate two stack lib is unacceptable!
  • I have the same problem. However, my srec_cat message is:
    srec_cat: ImageB.hex: 2: multiple 0x00003000 values (previous = 0xFD, this one = 0x64)
  • I fully agree with you! There should be a way to better reuse the ble stack code to save space.