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.

CCSTUDIO-WCS: What is the rule for memory locate in CCS

Part Number: CCSTUDIO-WCS

Customer is using CCS10.0.0.00010  no optimize level selected.

Only a few lines of code added (around 20). But big memory allocation change happen in hex file.

Before make code change the memory allocation in flash is as below:

But if only add one line in code, then the memory allocation in flash is

Why will the non-contiguous empty address be filled?

Is there any rules for memory allocation for compiler?

  • The memory allocation is controlled by the linker command file.  In a CCS project, it is typically found at the top level, and uses the file extension .cmd.  For an introduction to this file, please see the article Linker Command File Primer.

    To better understand why the memory allocation changed, compare the linker map file before and after the code is added.  In a CCS project, the linker map file is found in the directory with the same name as the build configuration, often Debug.  It has the same name as the project, with the file extension .map.

    Thanks and regards,

    -George