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.

CC2541: Regarding OAD in cc2541

Part Number: CC2541

>I am implementing OAD in cc2541 by referring to your large image OAD example. In the example, in oad_target.h file there are macros to set the page for image A and Image B and also there are some macros for defining the size(area of particular page)
>I have a doubt regarding the size of Image B because image A will reside  from page 1 and it will be of 124KB in size and image B will reside either from page 8 if FEATURE_OAD_BIM is defined. My question is how can image B can start from page 8 if image A is of size 124 KB which means image A will go till page 62?
>
>Also please let me know that what does following macros mean ?
>FEATURE_OAD_BIM
>
>what does this statement mean
>" Image-A/B can be very differently sized areas when implementing BIM vice OAD boot loader."
>
>I have attached an image of the file please go thorugh it and let me know your feedback.
>  

  • Hi Vidula,

    I think you'll find most of your answers here; processors.wiki.ti.com/.../OAD_for_CC254x.pdf

    Have you read through that documentation?

    For your first question, refer and read through section 11 and 12 and let me know if you have questions.

    FEATURE_OAD_BIM is a predefine that just tells the project to use BIM. It's necessary for OAD to be in a project.

    Your attachement did not go through.
  • Hi,

    I referred that document and also I went through the "large OAD image" code. I compiled Image A code and observed map file. I believe that for image A and Image B  code following area of the memory is reserved

    Image A:

    # -D_CODE_BEG=0x0830 -D_CODE_END=0x3FFF #
    # -D_BANK4_BEG=0x4B000 -D_BANK4_END=0x4FFFF #
    # -D_BANK5_BEG=0x58000 -D_BANK5_END=0x5FFFF #
    # -D_BANK6_BEG=0x68000 -D_BANK6_END=0x6FFFF #
    # -D_BANK7_BEG=0x78000 -D_BANK7_END=0x7E7FF

    Image B:
    # -D_CODE_BEG=0x4030 -D_CODE_END=0x7FFF #
    # -D_BANK1_BEG=0x18000 -D_BANK1_END=0x1FFFF #
    # -D_BANK2_BEG=0x28000 -D_BANK2_END=0x2FFFF #
    # -D_BANK3_BEG=0x38000 -D_BANK3_END=0x3FFFF #
    # -D_BANK4_BEG=0x48000 -D_BANK4_END=0x4AFFF

     the function "static bStatus_t oadImgBlockWrite( uint16 connHandle, uint8 *pValue )" defined in file "oad_target.c", there is address of the memory area where image B is written is calculated using following formula:

    uint16 addr = oadBlkNum * (OAD_BLOCK_SIZE / HAL_FLASH_WORD_SIZE) +(OAD_IMG_D_PAGE * OAD_FLASH_PAGE_MULT);

    oadBlkNum++;

    here oadBlkNum is the incremented everytime new block is requested. As per the formula for addr mentioned above, it seems that for every new block to be written for image B, subsequent address is calculated which means that at certain point image B is placed at the memory location which lies outside the range as described above in map file. I want to know that  Is this condition is taken care inside BLE stack so that code can be placed in the dedicated range? In simple word do I need to provide only starting address where I need to write any particular image( Image A or Image B). 

    Can you provide me with the packet format for "Image Identify characteristic" and for "Image request characteristic". As per my understanding I think 0th block number packet consist of block number (first two byte) and rest is image header  and actual image starts coming from block number 1. Is my understanding right?