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.

CCS/LAUNCHXL-CC2640R2: memory range overlap ERROR

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CCSTUDIO

Tool/software: Code Composer Studio

Hi

Everything was working fine with my code until suddenly it decided to throw me these errors

"configPkg/linker.cmd", line 34: error #10264: Code memory range overlaps existing memory range FLASH
"configPkg/linker.cmd", line 35: error #10263: SRAM memory range has already been specified
"configPkg/linker.cmd", line 35: error #10264: SRAM memory range overlaps existing memory range SRAM

I see this in my linker.cmd file:

MEMORY
{
    Code (RWX) : org = 0x0, len = 0x20000000
    SRAM (RW) : org = 0x20000000, len = 0x20000000
}

And this in my Memory Map file:

MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  FLASH                 00000000   00020000  0000a2b5  00015d4b  R  X
  Code                  00000000   20000000  00000000  20000000  RW X
  SRAM                  20000000   00005000  000046f6  0000090a  RW X
  SRAM                  20000000   20000000  00000000  20000000  RW 

I don't know where the FLASH and the first instance of SRAM is getting set from.

I see the following in the linkcmd.xdt file but I don't know where prog.cpu.memoryMap is defined.

MEMORY
{
%for (var i = 0; i < prog.cpu.memoryMap.length; i++) {
    %var mem = prog.cpu.memoryMap[i];
    %var page = (mem.page != null) ? ("PAGE " + mem.page + ": ") : "";
    %var org = utils.toHex(mem.base);
    %var len = utils.toHex(mem.len);
    %var access = (mem.access != null) ? (" (" + mem.access + ")") : "";
    `page``mem.name``access` : org = `org`, len = `len`
%}
}

Please help.

  • Tushar,

    I suspect there is an additional linker command file getting passed to the linker with those conflicting SRAM and FLASH memory specifications. Please take a close look at the build output in the CCS build console and see what other .cmd files are listed in the linker command. Hopefully that should help you identify the suspect linker command file which you can then try excluding from build and see it that fixes the error.

    If this does not help resolve the error, please save the full output of the CCS build console (as described in this page) and attach it here?

  • **** Build of configuration Release for project UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2 ****
    
    "C:\\ti\\ccs910\\ccs\\utils\\bin\\gmake" -k -j 4 all -O 
     
    Building file: "../empty.cfg"
    Invoking: XDCtools
    "C:/ti/ccs910/xdctools_3_55_02_22_core/xs" --xdcpath="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source;C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/kernel/tirtos/packages;C:/ti/simplelink_cc2640r2_sdk_ble_example_pack_1_50_00_62/source;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M3 -r debug -c "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS" "../empty.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring empty.xem3 from package/cfg/empty_pem3.cfg ...
    generating custom ti.sysbios library makefile ... 
    Starting build of library sources ...
    making C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2/src/sysbios/sysbios.aem3 ...
    Build of libraries done.
    clem3 package/cfg/empty_pem3.c ...
    Finished building: "../empty.cfg"
     
    Building file: "../ccfg.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="ccfg.d_raw" --cmd_file="configPkg/compiler.opt" "../ccfg.c"
    Finished building: "../ccfg.c"
     
    Building file: "../Timer.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="Timer.d_raw" --cmd_file="configPkg/compiler.opt" "../Timer.c"
    "../Timer.c", line 91: warning #188-D: pointless comparison of unsigned integer with zero
    "../Timer.c", line 107: warning #188-D: pointless comparison of unsigned integer with zero
    Finished building: "../Timer.c"
     
    Building file: "../CC2640R2_LAUNCHXL_fxns.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="CC2640R2_LAUNCHXL_fxns.d_raw" --cmd_file="configPkg/compiler.opt" "../CC2640R2_LAUNCHXL_fxns.c"
    Finished building: "../CC2640R2_LAUNCHXL_fxns.c"
     
    Building file: "../delay_ns.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="delay_ns.d_raw" --cmd_file="configPkg/compiler.opt" "../delay_ns.c"
    "../delay_ns.c", line 10: warning #163-D: unrecognized #pragma
    "../delay_ns.c", line 12: warning #163-D: unrecognized #pragma
    "../delay_ns.c", line 22: warning #176-D: expression has no effect
    "../delay_ns.c", line 23: warning #176-D: expression has no effect
    "../delay_ns.c", line 24: warning #176-D: expression has no effect
    "../delay_ns.c", line 25: warning #176-D: expression has no effect
    "../delay_ns.c", line 26: warning #176-D: expression has no effect
    Finished building: "../delay_ns.c"
     
    Building file: "../main_tirtos.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="main_tirtos.d_raw" --cmd_file="configPkg/compiler.opt" "../main_tirtos.c"
    Finished building: "../main_tirtos.c"
     
    Building file: "../spi_custom.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="spi_custom.d_raw" --cmd_file="configPkg/compiler.opt" "../spi_custom.c"
    "../spi_custom.c", line 30: warning #225-D: function "CpuShortDelay" declared implicitly
    Finished building: "../spi_custom.c"
     
    Building file: "../empty.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="empty.d_raw" --cmd_file="configPkg/compiler.opt" "../empty.c"
    "../empty.c", line 66: warning #179-D: variable "elapsed_time" was declared but never referenced
    Finished building: "../empty.c"
     
    Building file: "../CC2640R2_LAUNCHXL.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="CC2640R2_LAUNCHXL.d_raw" --cmd_file="configPkg/compiler.opt" "../CC2640R2_LAUNCHXL.c"
    Finished building: "../CC2640R2_LAUNCHXL.c"
     
    Building file: "../timer_stopwatch.c"
    Invoking: ARM Compiler
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --include_path="C:/Users/Param/workspace_v9/UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2" --include_path="C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/posix/ccs" --include_path="C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --preproc_with_compile --preproc_dependency="timer_stopwatch.d_raw" --cmd_file="configPkg/compiler.opt" "../timer_stopwatch.c"
    Finished building: "../timer_stopwatch.c"
     
    Building target: "UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.out"
    Invoking: ARM Linker
    "C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me -O2 --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on -z -m"UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.map" -i"C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/source" -i"C:/ti/simplelink_cc2640r2_sdk_3_20_00_21/kernel/tirtos/packages" -i"C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/lib" --diag_wrap=off --display_error_number --warn_sections --xml_link_info="UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2_linkInfo.xml" --rom_model -o "UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.out" "./CC2640R2_LAUNCHXL.obj" "./CC2640R2_LAUNCHXL_fxns.obj" "./Timer.obj" "./ccfg.obj" "./delay_ns.obj" "./empty.obj" "./main_tirtos.obj" "./spi_custom.obj" "./timer_stopwatch.obj" "../CC2640R2_LAUNCHXL_TIRTOS.cmd" -l"ti/display/lib/display.aem3" -l"ti/grlib/lib/ccs/m3/grlib.a" -l"third_party/spiffs/lib/ccs/m3/spiffs_cc26xx.a" -l"ti/drivers/rf/lib/rf_multiMode_cc26x0r2.aem3" -l"ti/drivers/lib/drivers_cc26x0r2.aem3" -l"ti/dpl/lib/dpl_cc26x0r2.aem3" -l"configPkg/linker.cmd" -l"ti/devices/cc26x0r2/driverlib/bin/ccs/driverlib.lib" -llibc.a 
    <Linking>
    "configPkg/linker.cmd", line 34: error #10264: Code memory range overlaps existing memory range FLASH
    "configPkg/linker.cmd", line 35: error #10263: SRAM memory range has already been specified
    "configPkg/linker.cmd", line 35: error #10264: SRAM memory range overlaps existing memory range SRAM
     
     undefined                   first referenced 
      symbol                         in file      
     ---------                   ---------------- 
     ResetISR                                     
     pthread_attr_init           ./main_tirtos.obj
     pthread_attr_setdetachstate ./main_tirtos.obj
     pthread_attr_setschedparam  ./main_tirtos.obj
     pthread_attr_setstacksize   ./main_tirtos.obj
     pthread_create              ./main_tirtos.obj
     sleep                       ./empty.obj      
     
    error #10234-D: unresolved symbols remain
    warning #10062-D: entry-point symbol "ResetISR" undefined
    error #10010: errors encountered during linking; "UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.out" not built
     
    >> Compilation failure
    makefile:159: recipe for target 'UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.out' failed
    gmake[1]: *** [UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.out] Error 1
    makefile:152: recipe for target 'all' failed
    gmake: *** [all] Error 2
    
    **** Build Finished ****
    
    Hi Aarti

    Yes there's an additional linker file "CC2640R2_LAUNCHXL_TIRTOS.cmd". However it seems that this is the primary linker file and not the "linker.cmd" as I had earlier thought because when I exclude CC2640R2_LAUNCHXL_TIRTOS.cmd from build, I get some unresolved symbols errors as follows:

    undefined                   first referenced
      symbol                         in file      
     ---------                   ----------------
     pthread_attr_init           ./main_tirtos.obj
     pthread_attr_setdetachstate ./main_tirtos.obj
     pthread_attr_setschedparam  ./main_tirtos.obj
     pthread_attr_setstacksize   ./main_tirtos.obj
     pthread_create              ./main_tirtos.obj
     sleep                       ./empty.obj      
     
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "UltraS_HC_SR04_CC2640R2_LAUNCHXL_tirtos_ccs2.out" not built

    However I am not able to exclude the "linker.cmd" from the build - that option is grayed out.

    Including the full CCS console output here with both "linker.cmd" and "CC2640R2_LAUNCHXL_TIRTOS.cmd" included. Please let me know if that is any more useful in understanding this issue.

  • Tushar Bhattacharyya2 said:
    However it seems that this is the primary linker file and not the "linker.cmd" as I had earlier thought

    That is correct. The linker.cmd file is auto-generated by the XDCtools after building the .cfg file.

    Tushar Bhattacharyya2 said:
    I see this in my linker.cmd file:

    MEMORY
    {
        Code (RWX) : org = 0x0, len = 0x20000000
        SRAM (RW) : org = 0x20000000, len = 0x20000000
    }

    MEMORY specifications are typically in the CC2640R2_LAUNCHXL_TIRTOS.cmd only and not in the linker.cmd file, so I don't understand how those appeared in your linker.cmd. 

    Also the linker.cmd is automatically passed to the linker command by the build system but the order of files is different in your project from what I typically see in the example projects. This is part of an example linker command that builds without error:

    Invoking: ARM Linker
    "C:/CCStudio_9.2.0.00013/ccs/tools/compiler/ti-cgt-arm_19.6.0.STS/bin/armcl" -mv7M3 --code_state=16 --float_support=vfplib -me --define=DeviceFamily_CC26X0R2 -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on -z -m"clock_CC2640R2_LAUNCHXL_tirtos_ccs.map" -i"C:/ti/simplelink_cc2640r2_sdk_3_30_00_20/source" -i"C:/ti/simplelink_cc2640r2_sdk_3_30_00_20/kernel/tirtos/packages" -i"C:/CCStudio_9.2.0.00013/ccs/tools/compiler/ti-cgt-arm_19.6.0.STS/lib" --diag_wrap=off --display_error_number --warn_sections --xml_link_info="clock_CC2640R2_LAUNCHXL_tirtos_ccs_linkInfo.xml" --rom_model -o "clock_CC2640R2_LAUNCHXL_tirtos_ccs.out" "./CC2640R2_LAUNCHXL.obj" "./CC2640R2_LAUNCHXL_fxns.obj" "./ccfg.obj" "./clock.obj" "../CC2640R2_LAUNCHXL_TIRTOS.cmd" -l"configPkg/linker.cmd" -l"ti/display/lib/display.aem3" -l"ti/grlib/lib/ccs/m3/grlib.a" -l"third_party/spiffs/lib/ccs/m3/spiffs_cc26xx.a" -l"ti/drivers/rf/lib/rf_multiMode_cc26x0r2.aem3" -l"ti/drivers/lib/drivers_cc26x0r2.aem3" -l"ti/dpl/lib/dpl_cc26x0r2.aem3" -l"ti/devices/cc26x0r2/driverlib/bin/ccs/driverlib.lib" -llibc.a
    <Linking>
    Finished building target: "clock_CC2640R2_LAUNCHXL_tirtos_ccs.out"


    To understand the source of the error, it would help to see your project. Could you zip up your entire project folder and attach it here?

  • Tushar,

    When I import and build your project, I hit compiler errors even before the build gets to the linker step.

    Which version of CCS, SimpleLink SDK and XDCtools are you using for your build? The first step would be to make sure that my versions match up with yours. You should be able to get the versions from Project Properties->General->Products tab.

    Also I see a few other oddities in the project:

    - There is no RTSC Platform selected in the Products tab
    - I get compiler errors on Timer.c and timer_stopwatch.c.
    Both files have this: #include <C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\drivers\Timer.h>

    Is that the correct location of Timer.h in your system. For one that is a very old version of SDK (which I don't have installed) and secondly Timer.h is typically inside the tirtos kernel packages directory, so I can wondering where it is in your system. Do you not see those compiler errors? 

    Because of the compiler errors due to not finding Timer.h I am unable to get past that into the linking stage. 

    I think the project has some pretty fundamental issues that need to be addressed first.

    Did you create this project by starting with an example from SimpleLink SDK?
    If you do a Rebuild Project, do you still see only the linker error or does it fail in the first XDCtools build step? If it fails in XDCtools then there are more fundamental issues. So a more step by step approach would be required to debug it. I would then suggest starting a new project based on an example project and slowly building it up by adding your source files into it.

  • Tushar,

    Since I haven’t heard back from you, I’m assuming you were able to move past this issue using example projects as a reference starting point. If you still need assistance after doing that, please feel free to post a reply here or create a new thread. Thanks.