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.

Error when modifying location of XDATA_ROM_C_FLASH (@ IAR, CC2531, TIMAC)

Other Parts Discussed in Thread: CC2531, TIMAC

Dear Community,

I'm using the CC2531 with 256kb and the TIMAC (Version 1.5.0, May 09, 2013) with the default "banked code model", TI linker file "ti_51ew_cc2531b.xcl" (from TIMAC) and IAR CSTARTUP file (from C:\Program Files (x86)\IAR Systems_8051\Embedded Workbench 6.5\8051\src\lib, IAR 8.30.2).
I want to modify that linker configuration file (of the firmware) in context of bootloader creation (making space for the bootloader code). I encountered a problem when changing the segment location of XDATA_ROM_C_FLASH from

-P(CODE)XDATA_ROM_C_FLASH=0x18000-0x1FFFF  //-> WORKS

to one of the following variants

-P(CODE)XDATA_ROM_C_FLASH=0x48000-0x4FFFF  //-> ERROR
-P(CODE)XDATA_ROM_C_FLASH=0x48000-0x49FFF  //-> ERROR
-P(CODE)XDATA_ROM_C_FLASH=0x4000-0x7FFF    //-> ERROR
-P(CODE)XDATA_ROM_C_FLASH=0xC000-0xFFFF    //-> ERROR

The error that I notice is a undefined firmware behaviour, e.g. simple operations do not work correctly and generally the firmware crashes.

Question: Is there any reason why the location of XDATA_ROM_C_FLASH is restricted to bank 1?

  • Timo,

    Can you please explain in detail what is the intended goal of modifying the linker configuration file ? Are bootloader and app code compiled separately and you intend to fit both sequentially on the flash ? (in which case -D_CODE_START needs to be modified)  . Let us know


    Saurabh

  • Hello Saurabh,


    correct, bootloader (BL) and app are two IAR projects and compiled seperately. I took the ZSTACK BL as starting point to modify the linker file, cstartup and interrupt_stubs (INTVEC starting at >0x0000).

    I intend to realize a memory layout like this:

    BL:
    0-3FFF (bank 0/root) = 8000-BFFF

    18000-48000 (bank 1,2,3) = C000-FFFF

    App:

    4000-FFFF (bank 0/root)
    48000-7FFFF (bank 4-7)

    For the xlnker file of the APP: By default (in the TIMAC example code), this is used in the linker file:

    -P(CODE)XDATA_ROM_C_FLASH=0x18000-0x1FFFF.

    Unfortunately, according to my wished memory layout, this is in the bank 1, where the BL shall be placed. Thus, I want to move the XDATA_ROM_C_FLASH segment to a memory address that is reserved for the APP. Thus, I tried different options***, but non of them worked. Is this a restriction of the CC2531, or of the CSTARTUP, or am I missing something here?

    *** these were my options:

    -P(CODE)XDATA_ROM_C_FLASH=0x48000-0x4FFFF  //-> ERROR
    -P(CODE)XDATA_ROM_C_FLASH=0x48000-0x49FFF  //-> ERROR
    -P(CODE)XDATA_ROM_C_FLASH=0x4000-0x7FFF    //-> ERROR
    -P(CODE)XDATA_ROM_C_FLASH=0xC000-0xFFFF    //-> ERROR