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-CC1350: Memory Allocation View of Non TI App

Expert 1530 points
Part Number: LAUNCHXL-CC1350

Tool/software: Code Composer Studio

Hello, I'm debugging Contiki-ng using the famous ppt: https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/158/contiki_2D00_ccs_2D00_debugging.pptx

In CCS, When I click view  -> Memory Allocation, it says the project needs to be built first. I build it and it still shows the same message. 

Is there a fix for that?

Note: it's working fine for TI apps

  • Ahmed Ibrahim31 said:
    In CCS, When I click view  -> Memory Allocation, it says the project needs to be built first. I build it and it still shows the same message. 

    Is there a fix for that?

    The CCS Memory Allocation view attempts to parse the .map file produced by the linker. The Memory Allocation view appears to have a hard-coded assumption that the .map file has the pathname ${BuildDirectory}/${ProjName}.map on the assumption that the CCS project has been set to generate Makefiles automatically.

    However, Contiki-ng is built using custom makefiles.

    I tried the changing the CCS Project Properties CCS Build -> GNU Linker -> Basic -> Write a map file (-Map) to set the name of the map file as ${CONTIKI_ROOT}/examples/platform-specific/cc26x0-cc13x0/build/cc26x0-cc13x0/srf06/cc26x0/cc26x0-demo.map to point at the map file created by the Contiki-ng makefiles. However, the Memory Allocation view still reported that the project needed to be built.

    A symbolic link was created from the map file produced by the Contiki-ng makefiles to the assumed pathname expected by CCS:

    mr_halfword@Haswell-Ubuntu:~/workspace_v9/cc26xx_demo/Debug$ ln -s ~/contiki-ng/examples/platform-specific/cc26x0-cc13x0/build/cc26x0-cc13x0/srf06/cc26x0/cc26x0-demo.map cc26xx_demo.map

    Following the creation of the symbolic link, with CCS 9.1 running under Ubuntu the Memory Allocation View then displayed the memory usage:

  • Chester Gillon said:
    I tried the changing the CCS Project Properties CCS Build -> GNU Linker -> Basic -> Write a map file (-Map) to set the name of the map file as ${CONTIKI_ROOT}/examples/platform-specific/cc26x0-cc13x0/build/cc26x0-cc13x0/srf06/cc26x0/cc26x0-demo.map to point at the map file created by the Contiki-ng makefiles. However, the Memory Allocation view still reported that the project needed to be built.

    After deleting the symbolic link and restarting CCS found that the Memory View was reporting the contents of the map file set via the "Write a map file (-Map)" project property.

    Also, on the menu at the top right of the Memory Usage view you can use the "Open TI link-info or GNU linker-map file..." option to point at the map file to process:

  • Chester Gillon said:

    Chester Gillon
    I tried the changing the CCS Project Properties CCS Build -> GNU Linker -> Basic -> Write a map file (-Map) to set the name of the map file as ${CONTIKI_ROOT}/examples/platform-specific/cc26x0-cc13x0/build/cc26x0-cc13x0/srf06/cc26x0/cc26x0-demo.map to point at the map file created by the Contiki-ng makefiles. However, the Memory Allocation view still reported that the project needed to be built.

    After deleting the symbolic link and restarting CCS found that the Memory View was reporting the contents of the map file set via the "Write a map file (-Map)" project property.

    Also, on the menu at the top right of the Memory Usage view you can use the "Open TI link-info or GNU linker-map file..." option to point at the map file to process:

    FYI:

    I'd like to point out that using this latter method (Open TI link-info or GNU linker-map file) I've had to explicitly go to that menu and reopen that map file after every build, else it didn't update by itself. I'm using CCSv9 (Version: 9.1.0.00010) on Linux. I am building a project that depends on NuttX, a RTOS, that uses its own Makefile and build system. With the symbolic link in place, the Memory Allocation view works correctly.

    If any TI devs are reading this, it would be nice if the logic were not hard-coded.

  • twelve12pm said:
    I'd like to point out that using this latter method (Open TI link-info or GNU linker-map file) I've had to explicitly go to that menu and reopen that map file after every build, else it didn't update by itself.

    I see that limitation as well. I have filed this issue so it can be addressed for a future release, the tracking ID is CCSIDE-3638.

  • AartiG said:

    I see that limitation as well. I have filed this issue so it can be addressed for a future release, the tracking ID is CCSIDE-3638.

    Thank you.

    For now as a workaround the symbolic link solution presented by Chester Gillon earlier in this thread is working perfectly, with the caveat that it only works on platforms that support symbolic links.