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.

CC2640R2F: CC2640R2F

Part Number: CC2640R2F

Hi 

I trying to understand the Linker Command file to make changes for my project.

I want Bootloader code and Application code to reside in FLASH at different memory locations.

Bootloader @ 0x0000 location. Application @ 0x2000. Do I need 2 Linker commands files, i.e. 1 for Bootloader and 1 for Application

Can you please provide sample linker command file with my above requirements?

Is there any link or document which gives insight to this? 

  • I suppose you can refer to linker commander files of bim and simple_peripheral_oad_offchip example.
  • Thanks a lot. This worked if I create new project one for Bootloader and one for Application.

    But if I change the linker command file (CC2640R2_LAUNCHXL_TIRTOS.cmd) of example code (C:\ti\simplelink_cc2640r2_sdk_2_30_00_28\examples\rtos\CC2640R2_LAUNCHXL\drivers\empty) to load the code at 0x1000 in Flash(FLASH (RX) : origin = FLASH_BASE + 0x1000, length = FLASH_SIZE - (2 * 0x1000)), I am getting the following error

    tirtos_builds_CC2640R2_LAUNCHXL_release_ccs/Debug/configPkg/linker.cmd", line 699: warning #10096-D: specified address lies outside memory map
    error #10264: DEFAULT memory range overlaps existing memory range FLASH
    error #10264: DEFAULT memory range overlaps existing memory range SRAM

    I checked the line 699 in linker.cmd
    .resetVecs: load > 0x0

    I want to know
    a. What is resetVecs is?
    b. How to fix the issue to load the code at 0x1000?
  • The fact that you're asking what reset vectors are makes me recommend that you shouldn't be doing these types of changes. Can you explain why you want the code around? There has been a lot of design and testing into the current system design and linker placement.
  • Hi Tim,

    I want to load the example code at 0x1000 location in Flash instead of 0x0000. I have created a Flash Bootlaoder, that will load at 0x0000 in Flash and will load my application.
    So when I changed the Flash origin to 0x1000 in example code (C:\ti\simplelink_cc2640r2_sdk_2_30_00_28\examples\rtos\CC2640R2_LAUNCHXL\drivers\empty)). Please see snippet
    FLASH (RX) : origin = FLASH_BASE + 0x1000, length = FLASH_SIZE - (2 * 0x1000)

    I am getting an Linker error as follows
    tirtos_builds_CC2640R2_LAUNCHXL_release_ccs/Debug/configPkg/linker.cmd", line 699: warning #10096-D: specified address lies outside memory map
    error #10264: DEFAULT memory range overlaps existing memory range FLASH
    error #10264: DEFAULT memory range overlaps existing memory range SRAM

    So, please help to fix the error and load the application code to load at 0x1000 in Flash


    Regards,
    Ajay
  • You should not be touching the linker.cmd file. This is automatically generated during the RTOS build. The linker file can be found under the TOOLS folder. Here is an example from the default simple_peripheral project:

    In any case, you should be putting your bootloader on the last page; not the first page because:

    - the CCFG section is enforced to be placed on the last page. You can therefore use the remainder of this page for you bootloader and not need to consume an entire new page (i.e. the first page)

    - there are RTOS symbols that are hardcoded (due to ROM) to certain locations in the RTOS linker.cmd.

    Currently, in cc26xx_app.cmd, the last page is reserved and the CCFG is placed here. However, you should have the bootloader manage the CCFG similar to how it is done in the BIM (see cc26xx_bim_r2.cmd).

    So you should remove the following line from SECTIONS in cc26xx_app.cmd:

      .ccfg           :   >  FLASH_LAST_PAGE (HIGH)

    You should then be able to use the cc26xx_bim_r2.cmd file for your bim