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 memory mapping in linker file

Other Parts Discussed in Thread: CC2541

Hello all,

I am trying to implement OAD in my system. For that I was trying to decrease the size of Image A. I edited the linker file. Project compiled without any problems. I was able to flash BIM and Image A in my cc2541. But the Image A doesn't start executing.

When I tried to debug, I saw that execution is stuck at some whole another place.

What I did in the cc254x_f256_imgA.xcl file is as below: 

1. 1st change:

//
// CODE
//
-D_CODE_BEG=0x0830 // First page is for the IBM which intercepts the H/W INTVECS.
-D_CODE_END=0x3FFF // Next 7 pages of Bank 0.
//

//Commented these two LINES 
//-D_BANK4_BEG=0x4B000 // Last 10 pages of Bank 4.          
//-D_BANK4_END=0x4FFFF
//

-D_BANK5_BEG=0x58000
-D_BANK5_END=0x5FFFF
//
-D_BANK6_BEG=0x68000
-D_BANK6_END=0x6FFFF
//
-D_BANK7_BEG=0x78000
// Cannot use the lock-bits page in a boot-loadable image; skip NV pages area.
-D_BANK7_END=0x7E7FF


2nd Change: 

-Z(CODE)ALIGNED_CODE|2=_CODE_BEG-_CODE_END,_BANK4_BEG-_BANK4_END,_BANK5_BEG-_BANK5_END,\
_BANK6_BEG-_BANK6_END,_BANK7_BEG-_BANK7_END
-P(CODE)BANKED_CODE=_CODE_BEG-_CODE_END,_BANK4_BEG-_BANK4_END,_BANK5_BEG-_BANK5_END,\
_BANK6_BEG-_BANK6_END,_BANK7_BEG-_BANK7_END

Removed "BANK4_BEG-BANK4_END" from above two lines


-Z(CODE)ALIGNED_CODE|2=_CODE_BEG-_CODE_END,_BANK5_BEG-_BANK5_END,\
_BANK6_BEG-_BANK6_END,_BANK7_BEG-_BANK7_END
-P(CODE)BANKED_CODE=_CODE_BEG-_CODE_END,_BANK5_BEG-_BANK5_END,\
_BANK6_BEG-_BANK6_END,_BANK7_BEG-_BANK7_END


I am not making any changes in rest of the xcl file. Can anybody tell me that is there anything that I am missing?

Thanks

  • Hello,

    Take a look at example for small imgA in 

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

    Flash is layed out like this

    A (page 1-8)

    B (next 62 pages)

    A (rest of pages)

    In example we take B past 62 and shrink A by same amount.

    Br,

    -Greg

  • Hi Greg,

    Thanx this explains the memory map. And I also got that I have to change the number of pages in BIM.

    So initially BIM consisted 62 pages for imageA, now because I removed 10 pages (in the xcl file for imageA), I edited that macro and put 52 pages instead.  You can see it below:

    #define BIM_IMG_A_PAGE 1
    #define BIM_IMG_A_AREA 52                  //Changed line, initial value was 62

    #define BIM_IMG_B_PAGE 8
    #define BIM_IMG_B_AREA (124 - BIM_IMG_A_AREA)

    But the problem still persists. Image A is not coming into execution.

    Can you please tell me anything else that I could be missing.

    Thanks,

    Hardik

  • Hello,

    I would start by verifying the issue. After you download BIM and Image-A, go back and "debug without downloading" the BIM. Step through and see if CRC fails or if it jumps to correct start of IMG-A.

    Also, check IMG-A settings in oad_target.h. They should also match.

    If CRC is problem, you can also look at header of sim/bin files with hex editor. 

    BR,

    -Greg